/* ==========================================================================
   🌌 MWIT 36.6 MASTERPIECE UI - ULTRA GLOW GLASSMorphism (100% SAFE & CLEAN)
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

body {
    background: #090d16; /* สีกรมท่ามืดมิติอวกาศ ลึกและพรีเมียมกว่าสีดำธรรมดา */
    color: #ffffff;
    min-height: 100vh;
    padding: 25px;
    overflow-x: hidden;
}

/* แสงออร่าพื้นหลังแบบนุ่มนวล ปลอดภัย ไม่ซ้อนทับ ไม่บังปุ่มกด */
.bg-blur {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 999px;
    filter: blur(140px);
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
}

.blur1 { background: #2563eb; top: -120px; left: -120px; }
.blur2 { background: #9333ea; right: -120px; bottom: -120px; }

.container {
    max-width: 1550px; /* ขยายขนาด Container เล็กน้อยเพื่อให้มีพื้นที่พอสำหรับ 5 วันในแถวเดียว */
    margin: auto;
    position: relative;
    z-index: 2;
}

/* --- 1. TOPBAR & CONTROLS --- */
.topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

/* ใช้การซ้อนเงาแสงสีฟ้านีออนให้ตัวหนังสือขาวบริสุทธิ์ดูสว่างทะลุจอ */
.title { 
    font-size: 42px; 
    font-weight: 700; 
    color: #ffffff;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 30px rgba(59, 130, 246, 0.2);
}

.subtitle { 
    color: #64748b; 
    margin-top: 5px; 
    font-weight: 500;
}

.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

select {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 16px;
    min-width: 150px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

select:hover {
    border-color: #3b82f6;
    background: #1f2937;
    transform: translateY(-1px);
}

/* --- 2. ⚡ UPGRADED: STATUS CARD & INFO GROUP (แดชบอร์ดสว่างโดดเด่น ออร่าตาแตก) --- */
.status-card {
    /* ปรับพื้นหลังกระจกให้สว่างและเคลียร์ขึ้น เพิ่มเงาสะท้อนขาวด้านบน */
    background: linear-gradient(135deg, rgba(30, 48, 80, 0.75) 0%, rgba(18, 28, 51, 0.8) 100%);
    padding: 32px;
    border-radius: 28px;
    margin-bottom: 35px;
    /* เพิ่มความหนาและความสว่างของเส้นขอบกระจก */
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* เพิ่มเงาเรืองแสงสีฟ้าอ่อน Ambient Glow แผ่ออกมารอบตัวแดชบอร์ด */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 
                0 0 30px rgba(37, 99, 235, 0.15), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.status-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

/* ปรับฟอนต์เวลากลางแดชบอร์ดให้เรืองแสงคมชัดเด่นขึ้น */
.time {
    font-size: 60px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.45), 0 0 4px rgba(255, 255, 255, 0.3);
}

/* ตัวหนังสือวันด้านบนสว่างชัดเจนอ่านง่าย */
.day {
    font-size: 18px;
    color: #cbd5e1;
    margin-top: 10px;
    font-weight: 600;
}

.info-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

/* กล่องวิชาด้านบนแดชบอร์ด */
.next-class {
    background: rgba(10, 15, 30, 0.7);
    padding: 20px;
    border-radius: 20px;
    min-width: 260px;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.next-class:hover {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.next-title {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 🌟 ไฮไลต์เด่นพิเศษ: ดึงกล่อง "คาบที่กำลังเรียนอยู่" ในแดชบอร์ดให้สว่างสดใส สาดออร่าสีน้ำเงินเข้มข้น */
.info-group .next-class:nth-child(1) {
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid #60a5fa;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.4), 
                inset 0 0 12px rgba(59, 130, 246, 0.3);
}
.info-group .next-class:nth-child(1) .next-title {
    color: #38bdf8; /* ตัวหนังสือข้อความส่วนหัวสว่างขึ้นชัดเจน */
    font-weight: 800;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.next-subject {
    font-size: 24px;
    font-weight: 700;
    margin-top: 6px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-detail {
    margin-top: 8px;
    font-size: 14px;
    color: #f1f5f9; /* ปรับข้อความรายละเอียดวิชาเรียนในแดชบอร์ดให้สว่างขึ้น */
}

/* --- 3. TIMETABLE LAYOUT BLOCK --- */
#scheduleGrid {
    display: flex !important;
    flex-direction: column !important;
    gap: 35px;
    width: 100%;
}

.week-container {
    width: 100%;
    display: block;
    background: rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 28px;
    padding: 20px; /* รักษาพื้นที่เปิด 5 วันในแถวเดียว */
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
}

.week-group-header {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.week-current-badge {
    font-size: 11px;
    background: #2563eb;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* แบ่งกระเบื้องตารางเรียนเป็น 5 วันเป๊ะในแถวเดียวบนหน้าจอเดสก์ท็อป */
.days-flex-layout {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important; 
    gap: 14px; 
    width: 100%;
}

/* --- 4. THE LUXURY DAY CARD --- */
.day-card {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.day-header {
    font-size: 16px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

/* --- 5. CLASS ITEM (คาบเรียนแต่ละวิชา) --- */
.class-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.class-item {
    background: #1f2937;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s ease;
}

.class-item:hover {
    background: #263244;
    transform: scale(1.01);
}

/* คาบที่กำลังเรียนอยู่ ณ วินาทีนี้ในตาราง สว่างเด่นมีมิติ */
.class-item.current {
    border: 1px solid #3b82f6 !important;
    background: #1e3a8a !important;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.class-time { 
    color: #94a3b8; 
    font-size: 11px; 
    font-weight: 500;
}
.class-item.current .class-time { 
    color: #93c5fd; 
    font-weight: 600;
}

.class-subject { 
    font-size: 14px; 
    font-weight: 700; 
    color: #ffffff;
    margin-top: 4px; 
    line-height: 1.4;
}

.class-teacher { 
    margin-top: 4px; 
    color: #cbd5e1; 
    font-size: 12px; 
}
.class-item.current .class-teacher {
    color: #e2e8f0;
}

.class-room {
    margin-top: 8px;
    display: inline-block;
    background: #334155;
    color: #cbd5e1;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.class-item.current .class-room {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* --- 6. 🚨 จุดเด่นสูงสุด: TODAY CARD (การ์ดของวันปัจจุบัน) --- */
/* กรอบเรืองแสงสีเขียวเข้มสว่าง (Emerald Green) ตัดกับโทนน้ำเงินอย่างสมบูรณ์แบบ */
.day-card.today-card {
    background: #0f172a !important;
    border: 2px solid #10b981 !important; 
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.25), inset 0 0 15px rgba(16, 185, 129, 0.05) !important;
}

.day-card.today-card .day-header {
    color: #10b981 !important;
    font-weight: 700;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.day-card.today-card .class-room {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- 7. MOBILE & TABLET RESPONSIVE --- */
@media(max-width:1200px) {
    .days-flex-layout {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
        gap: 16px;
    }
}

@media(max-width:1024px) {
    .info-group {
        justify-content: flex-start;
    }
}

@media(max-width:768px){
    body { padding: 15px; }
    .status-card { padding: 20px; }
    .title { font-size: 32px; }
    .time { font-size: 44px; }
    .next-class { min-width: 100%; } 
    .week-container { padding: 20px; }
}

/* --- 📅 8. SPECIAL NOTIFY POPUP (GLASSMORPHISM PREMUIUM) --- */

/* ปุ่มกดเปิดที่หน้าเว็บหลัก */
.special-schedule-btn {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: white;
    padding: 12px 20px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 5;
}
.special-schedule-btn:hover {
    border-color: #60a5fa;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.35) 0%, rgba(147, 51, 234, 0.35) 100%);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}
.active-count-badge {
    background: #ef4444;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* ฉากหลังโปร่งแสงมืดทับทั้งหน้าจอ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 8, 15, 0.85);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

/* การ์ดบอร์ดข้อความ Popup */
.modal-card {
    background: linear-gradient(135deg, rgba(20, 32, 55, 0.85) 0%, rgba(12, 18, 33, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 
                0 0 40px rgba(37, 99, 235, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 750px;
    max-height: 85vh;
    border-radius: 28px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* แถบเครื่องมือ ซ้ายบน - ขวาบน */
.modal-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}

/* ปุ่มซ้ายบน: สลับดูกำหนดการที่หมดอายุ */
.archive-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.archive-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #ffffff;
}
.archive-toggle-btn.active-view {
    background: rgba(234, 179, 8, 0.15);
    border-color: #eab308;
    color: #fde047;
}

/* ปุ่มขวาบน: ปุ่มปิดกากบาท */
.modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-close-btn:hover {
    color: #ef4444;
}

/* ส่วนหัวข้อ */
.modal-header {
    margin-bottom: 25px;
}
.modal-header h2 {
    font-size: 26px;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}
.modal-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
}

/* รายการคอนเทนเนอร์ด้านในสกรอลล์ได้ */
.modal-notify-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 6px;
}

/* ตกแต่งรูปร่างตัวเลื่อนเศษซาก (Scrollbar) ให้สวยเนียน */
.modal-notify-list::-webkit-scrollbar { width: 6px; }
.modal-notify-list::-webkit-scrollbar-track { background: transparent; }
.modal-notify-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

/* 🌟 คอนเทนเนอร์แต่ละกำหนดการแบบย่อย */
.modal-item-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 18px 22px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.modal-item-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: #3b82f6; /* สีบาร์หลักกำหนดการปกติ */
}
.modal-item-card:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(59, 130, 246, 0.3);
}

/* สไตล์เมื่อรายการนั้นหมดอายุการใช้งานแล้ว */
.modal-item-card.expired {
    opacity: 0.6;
}
.modal-item-card.expired::before {
    background: #64748b; /* แถบเทาเมื่อหมดอายุ */
}

/* โครงสร้างตัวอักษรของกำหนดการย่อย */
.item-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.item-subject {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}
.item-time-badge {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3px 10px;
    border-radius: 999px;
    color: #cbd5e1;
}
.item-note {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.5;
    white-space: pre-line;
}

.no-notify-text {
    text-align: center;
    color: #64748b;
    padding: 40px 0;
    font-size: 15px;
}

@keyframes modalFadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

@media(max-width: 768px) {
    .modal-card { padding: 20px; max-height: 90vh; }
    .item-meta-bar { flex-direction: column; align-items: flex-start; gap: 4px; }
}

select {
  pointer-events: auto;
  -webkit-appearance: menulist;
}