/* --- GLOBAL FONTS & RESET --- */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;600&display=swap');

:root {
    --primary: #00d2ff;
    --secondary: #007aff;
    --danger: #ff4757;
    --success: #2ecc71;
    --bg-dark: #101318;
    --glass: rgba(16, 19, 24, 0.85);
    --border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Kanit', sans-serif;
    margin: 0; padding: 0;
    background-color: var(--bg-dark);
    /* พื้นหลัง */
    background-image: url('/static/images/background.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    user-select: none; /* ห้ามคลุมดำตามสั่ง */
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

/* --- ANIMATIONS (ทำให้สวยงาม) --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(0, 210, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); } }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }

.fade-in { animation: fadeIn 0.8s ease-out forwards; }
.pulse-anim { animation: pulse 2s infinite; }
.float-anim { animation: float 3s ease-in-out infinite; }

/* --- MAIN CONTAINER --- */
.main-content {
    width: 90%; max-width: 1200px;
    padding: 20px;
    margin: 40px auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- GLASS CARD (กรอบแก้วหลัก) --- */
.glass-card {
    background: var(--glass);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 40px;
    width: 100%; max-width: 700px; /* ขนาดปกติ */
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

/* --- TYPOGRAPHY --- */
h1 {
    font-size: 2.5rem; margin-bottom: 15px;
    background: linear-gradient(90deg, #fff, var(--primary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}
.greeting { color: #aaa; line-height: 1.6; font-size: 1.1rem; }
.website-name { color: var(--primary); font-weight: bold; }

/* --- STATUS BOX (หน้า Maintenance) --- */
.status-box {
    background: rgba(0,0,0,0.5); border-radius: 15px;
    padding: 20px; margin: 25px 0; text-align: left;
    border: 1px solid var(--border);
}
.status-box p { margin: 10px 0; font-size: 1.05rem; display: flex; align-items: center; }
.status-icon { width: 30px; text-align: center; margin-right: 15px; }
#countdown-timer { 
    color: var(--danger); font-weight: bold; background: rgba(255, 71, 87, 0.1);
    padding: 2px 8px; border-radius: 4px; margin-left: 10px;
}

/* --- FORMS & INPUTS --- */
.notify-form { display: flex; flex-direction: column; align-items: center; width: 100%; margin-top: 20px; }
input {
    width: 100%; padding: 15px; border-radius: 50px;
    border: 1px solid var(--border); background: rgba(0,0,0,0.5);
    color: white; text-align: center; font-size: 1rem; margin-bottom: 15px;
    transition: 0.3s; font-family: 'Kanit';
}
input:focus { border-color: var(--primary); box-shadow: 0 0 15px rgba(0, 210, 255, 0.3); outline: none; }

/* --- BUTTONS --- */
.btn-main, .subscribe-button {
    padding: 12px 35px; border-radius: 50px; border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; font-weight: bold; font-size: 1.1rem; cursor: pointer;
    transition: 0.3s; box-shadow: 0 5px 15px rgba(0, 122, 255, 0.3);
    text-decoration: none; display: inline-block;
}
.btn-main:hover, .subscribe-button:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 25px rgba(0, 122, 255, 0.5); }

/* --- SOCIAL LINKS (กู้คืนส่วนนี้!) --- */
.social-links {
    margin-top: 30px; padding-top: 20px;
    border-top: 1px dashed var(--border); width: 100%;
}
.icon-container { display: flex; justify-content: center; gap: 20px; margin-top: 15px; }
.social-icon {
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    display: flex; justify-content: center; align-items: center;
    color: #ccc; font-size: 1.4rem; transition: 0.3s; text-decoration: none;
}
.social-icon:hover { background: white; color: #000; transform: translateY(-5px) rotate(360deg); }
.social-icon.youtube:hover { color: #ff0000; }
.social-icon.facebook:hover { color: #1877f2; }
.social-icon.discord:hover { color: #5865F2; }

/* --- ROOT DASHBOARD (กู้คืนส่วนนี้!) --- */
.dashboard-container { max-width: 1400px; } /* ขยายกว้าง */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 20px; }
.logout-btn { background: var(--danger); padding: 8px 20px; border-radius: 20px; color: white; text-decoration: none; font-size: 0.9rem; }

.chart-card { min-height: 400px; margin-bottom: 20px; }
.chart-controls button {
    background: transparent; border: 1px solid #555; color: #aaa;
    padding: 5px 15px; border-radius: 20px; cursor: pointer; margin-left: 5px;
}
.chart-controls button.active { background: var(--primary); color: #000; border-color: var(--primary); }

/* Export CSV */
.radio-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 15px 0; }
.radio-box {
    padding: 10px; background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    border-radius: 8px; cursor: pointer; text-align: center; color: #888;
}
.radio-option input:checked + .radio-box { border-color: var(--success); color: var(--success); background: rgba(46, 204, 113, 0.1); }
.download-btn { width: 100%; background: var(--success); color: white; padding: 15px; border-radius: 10px; border: none; font-size: 1.1rem; cursor: pointer; font-weight: bold; }

/* Root Login Specific */
.root-card { border: 1px solid var(--danger); box-shadow: 0 0 30px rgba(255, 71, 87, 0.15); max-width: 450px; }