/* =========================
   GENERAL
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #080b18;
    color: white;
    min-height: 100vh;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;

    width: 240px;
    height: 100vh;

    padding: 25px 15px;

    background: #10152b;
    border-right: 1px solid #252b4a;
}

.sidebar h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar a {
    text-decoration: none;
    color: #b9bfd8;

    padding: 12px 15px;
    border-radius: 10px;

    transition: 0.3s;
}

.sidebar a:hover {
    background: #20284b;
    color: white;
    transform: translateX(5px);
}


/* =========================
   MAIN CONTENT
========================= */

.main-content {
    margin-left: 240px;
    padding: 30px;
}


/* =========================
   TOP BAR
========================= */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 35px;
}

.topbar h2 {
    font-size: 24px;
}

#darkModeBtn {
    border: none;
    background: #20284b;
    color: white;

    padding: 10px 14px;
    border-radius: 10px;

    cursor: pointer;
    font-size: 18px;
}


/* =========================
   WELCOME
========================= */

.welcome {
    margin-bottom: 30px;
}

.welcome h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.welcome p {
    color: #9da5c5;
}

/* =========================
   STAT CARDS
========================= */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;

    margin-bottom: 25px;
}

.card {
    background: #11172d;

    padding: 20px;

    border: 1px solid #252b4a;
    border-radius: 15px;

    transition: 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #6674ff;
}

.card h3 {
    margin-bottom: 15px;
}

.card p {
    font-size: 30px;
    font-weight: bold;

    margin-bottom: 5px;
}

.card span {
    color: #8f97b5;
    font-size: 14px;
}


/* =========================
   DASHBOARD GRID
========================= */

.dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-card {
    background: #11172d;

    padding: 25px;

    border: 1px solid #252b4a;
    border-radius: 15px;
}

.dashboard-card h2 {
    margin-bottom: 20px;
}


/* =========================
   LIGHT MODE
========================= */

body.light-mode {
    background: #f2f4fa;
    color: #171a2b;
}

body.light-mode .sidebar {
    background: #ffffff;
    border-color: #dddddd;
}

body.light-mode .sidebar a {
    color: #555b72;
}

body.light-mode .sidebar a:hover {
    background: #e9ecf5;
    color: #171a2b;
}

body.light-mode .card{
    background: #ffffff;
    
}
body.light-mode .dashboard-card {
    background: #ffffff;
    border-color: #dddddd;
}

body.light-mode .card span,
body.light-mode .welcome p {
    color: #666b7d;
}

/* =========================
   TO-DO LIST
========================= */

.todo-container {
    background: #11172d;

    border: 1px solid #252b4a;

    border-radius: 15px;

    padding: 25px;
}


/* =========================
   ADD TASK
========================= */

.todo-input-section {
    display: grid;

    grid-template-columns:
        2fr 1fr 1fr auto;

    gap: 10px;

    margin-bottom: 25px;
}

.todo-input-section input,
.todo-input-section select {

    padding: 12px;

    border: 1px solid #30385f;

    border-radius: 8px;

    background: #0b1022;

    color: white;

    font-size: 14px;
}

.todo-input-section input:focus,
.todo-input-section select:focus {

    outline: none;

    border-color: #6674ff;
}


#addTaskBtn {

    padding: 12px 18px;

    border: none;

    border-radius: 8px;

    background: #6674ff;

    color: white;

    cursor: pointer;

    font-size: 14px;
}

#addTaskBtn:hover {

    background: #5362e5;

}


/* =========================
   FILTERS
========================= */

.todo-filters {

    display: flex;

    gap: 10px;

    margin-bottom: 20px;
}

.filter-btn {

    padding: 8px 16px;

    border: none;

    border-radius: 20px;

    background: #252d55;

    color: #c5cbe3;

    cursor: pointer;
}

.filter-btn:hover {

    background: #37427a;

}

.filter-btn.active {

    background: #6674ff;

    color: white;

}


/* =========================
   TASK
========================= */

.task-item {

    display: flex;

    align-items: center;

    gap: 15px;

    padding: 15px;

    margin-bottom: 10px;

    border-radius: 10px;

    background: #1a2140;

    border-left: 5px solid #6674ff;

    transition: 0.2s;
}

.task-item:hover {

    transform: translateX(3px);

}


/* Checkbox */

.task-checkbox {

    width: 20px;

    height: 20px;

    cursor: pointer;
}


/* Task information */

.task-info {

    flex: 1;
}

.task-title {

    font-size: 16px;

    color: white;

    margin-bottom: 5px;
}

.task-date {

    font-size: 12px;

    color: #9da5c5;
}


/* Completed task */

.task-item.completed .task-title {

    text-decoration: line-through;

    opacity: 0.5;
}

.task-item.completed {

    opacity: 0.7;
}


/* Delete button */

.delete-task {

    border: none;

    background: transparent;

    color: #ff6b6b;

    font-size: 18px;

    cursor: pointer;
}

.delete-task:hover {

    transform: scale(1.2);

}


/* =========================
   PRIORITY
========================= */

.priority-low {

    border-left-color: #4caf50;

}

.priority-medium {

    border-left-color: #ffc107;

}

.priority-high {

    border-left-color: #ff5252;

}


/* =========================
   EMPTY STATE
========================= */

.empty-task-message {

    text-align: center;

    padding: 50px 20px;

    color: #8f97b5;
}

.empty-icon {

    font-size: 45px;

    margin-bottom: 10px;
}

.empty-task-message h2 {

    color: #c5cbe3;

}


/* =========================
   SUMMARY
========================= */

.todo-summary {

    display: flex;

    align-items: center;

    gap: 25px;

    margin-top: 25px;

    padding-top: 20px;

    border-top: 1px solid #252b4a;

    color: #9da5c5;
}

.todo-summary strong {

    color: white;

}

#clearCompletedBtn {

    margin-left: auto;

    padding: 8px 12px;

    border: none;

    border-radius: 8px;

    background: #252d55;

    color: #ff8a8a;

    cursor: pointer;
}

#clearCompletedBtn:hover {

    background: #37427a;

}


/* =========================
   LIGHT MODE
========================= */

body.light-mode .todo-container {

    background: white;

    border-color: #dddddd;

}

body.light-mode
.todo-input-section input,
body.light-mode
.todo-input-section select {

    background: #f5f6fa;

    color: #2c3e50;

    border-color: #d5d9e5;

}

body.light-mode .task-item {

    background: #f1f3f8;

}

body.light-mode .task-title {

    color: #2c3e50;

}

body.light-mode .task-date {

    color: #666b7d;

}

body.light-mode .filter-btn {

    background: #e9edfa;

    color: #2c3e50;

}

body.light-mode .filter-btn.active {

    background: #6674ff;

    color: white;

}

body.light-mode .todo-summary {

    border-color: #dddddd;

}

body.light-mode .todo-summary strong {

    color: #2c3e50;

}

body.light-mode #clearCompletedBtn {

    background: #e9edfa;

}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 800px) {

    .todo-input-section {

        grid-template-columns: 1fr;

    }

    .todo-summary {

        flex-wrap: wrap;

    }

    #clearCompletedBtn {

        margin-left: 0;

    }

}

@media (max-width: 700px) {
    body {
        overflow-x: hidden;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 18px 12px;
        border-right: 0;
        border-bottom: 1px solid #252b4a;
    }

    .sidebar h1 {
        margin-bottom: 14px;
        font-size: 21px;
    }

    .sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .sidebar a {
        flex: 1 1 135px;
        padding: 10px;
        text-align: center;
    }

    .sidebar a:hover {
        transform: none;
    }

    .main-content {
        margin-left: 0;
        padding: 18px 14px 28px;
    }

    .topbar {
        gap: 12px;
        margin-bottom: 24px;
    }

    .topbar h2 {
        font-size: 20px;
    }

    .welcome h1 {
        font-size: 26px;
    }

    .todo-container {
        padding: 16px;
    }

    .todo-input-section input,
    .todo-input-section select,
    #addTaskBtn {
        min-height: 44px;
        width: 100%;
    }

    .todo-filters {
        flex-wrap: wrap;
    }

    .filter-btn {
        flex: 1 1 90px;
        min-height: 40px;
    }

    .task-item {
        align-items: flex-start;
        gap: 10px;
        padding: 13px 10px;
    }

    .todo-summary {
        gap: 12px 18px;
    }

    #clearCompletedBtn {
        width: 100%;
        min-height: 44px;
    }
}
