/* =======================================================
   RESET
======================================================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    width:100%;
    min-height:100vh;
    font-family:Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
    background:#f5f7fb;
    color:#222;
}

button{
    cursor:pointer;
    border:none;
    outline:none;
}

input,
select,
textarea{
    outline:none;
}

/* =======================================================
   TOPBAR
======================================================= */

.topbar{
    width:100%;
    background:#1f3c88;
    color:white;
    padding:18px 24px;

    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;

    box-shadow:0 2px 10px rgba(0,0,0,.15);
}

.topbar h1{
    font-size:24px;
    font-weight:700;
}

.nav-buttons{
    display:flex;
    gap:10px;
}

.nav-buttons button{
    padding:10px 18px;
    border-radius:8px;
    font-size:15px;
    font-weight:600;
    background:white;
    color:#1f3c88;
}

.nav-buttons button.active{
    background:#ffd54f;
    color:#000;
}

/* =======================================================
   PAGE
======================================================= */

.page{
    display:none;
    width:100%;
}

.active-page{
    display:block;
}

/* =======================================================
   LAYOUT
======================================================= */

.main-layout{
    display:grid;
    grid-template-columns: 45% 55%;
    gap:20px;

    padding:20px;
}

/* =======================================================
   LEFT PANEL
======================================================= */

.calendar-panel{
    background:white;
    border-radius:16px;
    padding:20px;

    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

/* =======================================================
   CALENDAR HEADER
======================================================= */

.calendar-header{
    display:flex;
    align-items:center;
    justify-content:space-between;

    margin-bottom:20px;
}

.calendar-header h2{
    font-size:24px;
    text-align:center;
    flex:1;
}

.calendar-header button{
    width:40px;
    height:40px;

    border-radius:50%;
    background:#1f3c88;
    color:white;

    font-size:18px;
    font-weight:bold;
}

.calendar-header button:hover{
    opacity:.9;
}

/* =======================================================
   WEEKDAYS
======================================================= */

.weekdays{
    display:grid;
    grid-template-columns:repeat(7,1fr);

    margin-bottom:10px;
}

.weekdays div{
    text-align:center;
    font-weight:700;
    padding:8px 0;
    font-size:14px;
}

.weekdays div:first-child{
    color:#d50000;
}

.weekdays div:last-child{
    color:#d50000;
}

/* =======================================================
   CALENDAR GRID
======================================================= */

.calendar-grid{
    display:grid;
    grid-template-columns:repeat(7,1fr);

    gap:6px;
}

/* =======================================================
   DATE CELL
======================================================= */

.date-cell{
    position:relative;

    min-height:72px;

    border:1px solid #e0e0e0;
    border-radius:10px;

    padding:6px;

    background:white;

    transition:.2s;
}

.date-cell:hover{
    background:#f3f6ff;
}

.date-number{
    font-size:15px;
    font-weight:600;
}

/* =======================================================
   TODAY
======================================================= */

.today{
    border:2px solid #1f3c88;
    background:#eef3ff;
}

/* =======================================================
   SATURDAY
======================================================= */

.saturday .date-number{
    color:#c62828;
}

/* =======================================================
   SUNDAY
======================================================= */

.sunday .date-number{
    color:#d50000;
    font-weight:700;
}

/* =======================================================
   HOLIDAY
======================================================= */

.holiday{
    background:#fff4f4;
}

.holiday .date-number{
    color:#d50000;
    font-weight:700;
}

/* =======================================================
   SELECTED DATE
======================================================= */

.selected-date{
    border:3px solid #4caf50;
}

/* =======================================================
   TASK BADGE
======================================================= */

.task-badge{
    position:absolute;

    top:4px;
    right:4px;

    min-width:22px;
    height:22px;

    border-radius:50%;

    background:#ff9800;
    color:white;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:11px;
    font-weight:700;
}

/* =======================================================
   HOLIDAY BOX
======================================================= */

.holiday-box{
    margin-top:24px;

    border-top:2px solid #ececec;
    padding-top:16px;
}

.holiday-box h3{
    margin-bottom:12px;
    color:#1f3c88;
}

#holidayList,
#holidayListPage2{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.holiday-item{
    background:#fafafa;
    border-left:5px solid #d50000;

    padding:10px;
    border-radius:8px;
}

.holiday-item-date{
    font-weight:700;
    margin-bottom:4px;
}

.holiday-item-name{
    font-size:14px;
    color:#555;
}

/* =======================================================
   RIGHT PANEL
======================================================= */

.content-panel{
    background:white;

    border-radius:16px;

    padding:20px;

    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.today-card{
    padding:18px;
    border-radius:14px;

    background:#eef3ff;

    margin-bottom:20px;
}

.today-card h2{
    font-size:26px;
    margin-bottom:8px;
}

.today-card p{
    font-size:16px;
    font-weight:500;
}

/* =======================================================
   COURSE HEADER
======================================================= */

.course-header,
.daily-header{
    display:flex;
    justify-content:space-between;
    align-items:center;

    margin-bottom:18px;
}

.course-header h3,
.daily-header h3{
    font-size:22px;
}

.course-header button,
.daily-header button{
    background:#1f3c88;
    color:white;

    padding:10px 16px;

    border-radius:8px;

    font-weight:600;
}

.course-header button:hover,
.daily-header button:hover{
    opacity:.92;
}
/* =======================================================
   COURSE CONTAINER
======================================================= */

#todayCourses{
    display:flex;
    flex-direction:column;
    gap:20px;
}

/* =======================================================
   COURSE CARD
======================================================= */

.course-card{
    background:#fafafa;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:16px;
}

.course-title-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-bottom:14px;
}

.course-title{
    font-size:18px;
    font-weight:700;
}

.course-actions{
    display:flex;
    gap:8px;
}

.add-task-btn{
    background:#2e7d32;
    color:white;
    padding:8px 12px;
    border-radius:8px;
    font-size:13px;
    font-weight:600;
}

.delete-course-btn{
    background:#c62828;
    color:white;
    padding:8px 12px;
    border-radius:8px;
    font-size:13px;
    font-weight:600;
}

/* =======================================================
   TASK LIST
======================================================= */

.task-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.task-item{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:10px 12px;

    border-radius:10px;

    background:white;

    border:1px solid #ececec;
}

.task-left{
    display:flex;
    align-items:center;
    gap:10px;
}

.task-text{
    font-size:15px;
    line-height:1.4;
}

.task-done .task-text{
    text-decoration:line-through;
    color:#888;
}

.delete-task-btn{
    background:#d32f2f;
    color:white;

    padding:6px 10px;
    border-radius:6px;

    font-size:12px;
}

/* =======================================================
   CUSTOM CHECKBOX
======================================================= */

.task-checkbox,
.daily-checkbox{
    width:20px;
    height:20px;
    cursor:pointer;
}

/* =======================================================
   DAILY LIST
======================================================= */

.daily-list-container{
    width:100%;
}

#dailyListContainer{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.daily-item{
    background:#fafafa;

    border:1px solid #e0e0e0;

    border-radius:14px;

    padding:15px;
}

.daily-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:15px;
}

.daily-left{
    display:flex;
    align-items:flex-start;
    gap:10px;
    flex:1;
}

.daily-text{
    font-size:15px;
    line-height:1.5;
    word-break:break-word;
}

.daily-done .daily-text{
    text-decoration:line-through;
    color:#888;
}

.delete-daily-btn{
    background:#c62828;
    color:white;

    padding:8px 12px;

    border-radius:8px;

    font-size:12px;
    font-weight:600;
}

/* =======================================================
   DAILY IMAGE
======================================================= */

.daily-image{
    margin-top:12px;

    width:100%;
    max-height:300px;

    object-fit:cover;

    border-radius:10px;

    border:1px solid #ddd;
}

/* =======================================================
   MODAL
======================================================= */

.modal{
    position:fixed;

    inset:0;

    background:rgba(0,0,0,.45);

    display:none;

    justify-content:center;
    align-items:center;

    z-index:999;
}

.modal.show{
    display:flex;
}

.modal-content{
    width:95%;
    max-width:450px;

    background:white;

    border-radius:16px;

    padding:24px;

    animation:modalPop .25s ease;
}

@keyframes modalPop{
    from{
        opacity:0;
        transform:scale(.92);
    }

    to{
        opacity:1;
        transform:scale(1);
    }
}

.modal-content h3{
    margin-bottom:18px;
    color:#1f3c88;
}

.modal-content label{
    display:block;
    margin-bottom:6px;
    margin-top:10px;
    font-weight:600;
}

.modal-content input[type="text"],
.modal-content select{
    width:100%;

    padding:12px;

    border:1px solid #ccc;

    border-radius:10px;

    margin-bottom:12px;

    font-size:15px;
}

.modal-content input[type="file"]{
    width:100%;
    margin-top:8px;
    margin-bottom:14px;
}

.modal-buttons{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:10px;
}

.modal-buttons button{
    padding:10px 16px;
    border-radius:8px;
    font-weight:600;
}

#saveCourseBtn,
#saveTaskBtn,
#saveDailyBtn{
    background:#1f3c88;
    color:white;
}

#closeCourseModal,
#closeTaskModal,
#closeDailyModal{
    background:#e0e0e0;
}

/* =======================================================
   EMPTY STATE
======================================================= */

.empty-message{
    text-align:center;
    padding:30px 15px;

    color:#777;

    border:2px dashed #ddd;

    border-radius:12px;

    background:#fafafa;
}

/* =======================================================
   SCROLL AREA
======================================================= */

#todayCourses,
#dailyListContainer{
    max-height:65vh;
    overflow-y:auto;
    padding-right:4px;
}

#todayCourses::-webkit-scrollbar,
#dailyListContainer::-webkit-scrollbar{
    width:8px;
}

#todayCourses::-webkit-scrollbar-thumb,
#dailyListContainer::-webkit-scrollbar-thumb{
    background:#c8c8c8;
    border-radius:10px;
}

/* =======================================================
   TABLET
======================================================= */

@media(max-width:1024px){

    .main-layout{
        grid-template-columns:1fr;
    }

    .calendar-panel{
        order:1;
    }

    .content-panel{
        order:2;
    }

    #todayCourses,
    #dailyListContainer{
        max-height:none;
    }
}

/* =======================================================
   MOBILE
======================================================= */

@media(max-width:768px){

    .topbar{
        flex-direction:column;
        align-items:flex-start;
    }

    .topbar h1{
        font-size:20px;
    }

    .nav-buttons{
        width:100%;
    }

    .nav-buttons button{
        flex:1;
    }

    .main-layout{
        padding:12px;
        gap:12px;
    }

    .calendar-panel,
    .content-panel{
        padding:14px;
    }

    .calendar-header h2{
        font-size:18px;
    }

    .weekdays div{
        font-size:11px;
    }

    .date-cell{
        min-height:55px;
        padding:4px;
    }

    .date-number{
        font-size:13px;
    }

    .task-badge{
        width:18px;
        height:18px;
        font-size:10px;
    }

    .today-card h2{
        font-size:20px;
    }

    .course-title{
        font-size:16px;
    }

    .course-title-row{
        flex-direction:column;
        align-items:flex-start;
    }

    .course-actions{
        width:100%;
        flex-wrap:wrap;
    }

    .add-task-btn,
    .delete-course-btn{
        flex:1;
    }

    .daily-top{
        flex-direction:column;
    }

    .delete-daily-btn{
        width:100%;
    }

    .modal-content{
        padding:18px;
    }
}

/* =======================================================
   SMALL MOBILE
======================================================= */

@media(max-width:480px){

    .weekdays div{
        font-size:10px;
    }

    .date-cell{
        min-height:48px;
    }

    .date-number{
        font-size:12px;
    }

    .task-badge{
        width:16px;
        height:16px;
        font-size:9px;
    }

    .holiday-item{
        padding:8px;
    }

    .holiday-item-date{
        font-size:13px;
    }

    .holiday-item-name{
        font-size:12px;
    }
}