/* --- Global Styles & Variables --- */
:root {
    --bg-light: #f4f7f6;
    --text-light: #333;
    --card-bg-light: #ffffff;
    --border-light: #e0e0e0;
    --primary-color: #007bff;
    --completed-color: #28a745; /* Green */
    --not-completed-color: #dc3545; /* Red */


    --bg-dark: #121212;
    --text-dark: #e0e0e0;
    --card-bg-dark: #1e1e1e;
    --border-dark: #333;

    --font-family: 'Roboto', sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--bg-light);
    color: var(--text-light);
    transition: background-color 0.3s, color 0.3s;
}

/* --- Dark Mode --- */
body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}
body.dark-mode .side-menu,
body.dark-mode .main-content {
    background-color: var(--card-bg-dark);
}
body.dark-mode .side-menu {
    border-right-color: var(--border-dark);
}
body.dark-mode header {
    border-bottom-color: var(--border-dark);
}
body.dark-mode .side-menu-item:hover {
    background-color: #2c2c2c;
}
body.dark-mode .side-menu-item.active {
    background-color: var(--primary-color);
}
body.dark-mode .chapter-table th,
body.dark-mode .chapter-table td {
    border-color: var(--border-dark);
}
body.dark-mode .chapter-table tbody tr:nth-child(even) {
    background-color: #2a2a2a;
}
body.dark-mode #theme-toggle {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

/* --- Main Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.side-menu {
    width: 250px;
    background-color: var(--card-bg-light);
    border-right: 1px solid var(--border-light);
    padding: 20px 0;
    flex-shrink: 0;
}

.menu-title {
    padding: 0 20px;
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 15px;
}

.side-menu-item {
    padding: 15px 20px;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: background-color 0.2s, border-left-color 0.2s;
}

.side-menu-item:hover {
    background-color: #f0f0f0;
}

.side-menu-item.active {
    background-color: #e6f2ff;
    border-left-color: var(--primary-color);
    font-weight: 500;
    color: var(--primary-color);
}

.main-content {
    flex-grow: 1;
    padding: 20px;
    background-color: var(--bg-light);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 2em;
}

#theme-toggle {
    padding: 10px 15px;
    border: 1px solid #ccc;
    background-color: var(--card-bg-light);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

/* --- Chapter Table --- */
.chapter-table {
    width: 100%;
    border-collapse: collapse;
}

.chapter-table th, .chapter-table td {
    border: 1px solid var(--border-light);
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.chapter-table thead {
    background-color: #f8f9fa;
}
body.dark-mode .chapter-table thead {
    background-color: #2c2c2c;
}

.chapter-table th {
    font-weight: 700;
}

.chapter-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

/* --- Checkbox and Status Text --- */
.chapter-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.status-completed {
    color: var(--completed-color);
    font-weight: bold;
}

.status-not-completed {
    color: var(--not-completed-color);
    font-weight: 500;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .side-menu {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        display: flex;
        overflow-x: auto;
        padding: 0;
    }
    .menu-title {
        display: none;
    }
    .side-menu-item {
        border-left: none;
        border-bottom: 4px solid transparent;
        white-space: nowrap;
    }
    .side-menu-item.active {
        border-bottom-color: var(--primary-color);
    }
    .main-content {
        padding: 15px;
    }
    header h1 {
        font-size: 1.5em;
    }
}
