/* style.css */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 20px;
    background-color: var(--background);
    color: var(--text);
    transition: background-color 0.3s, color 0.3s;
}

:root {
    --background: #ffffff;
    --text: #000000;
    --header-bg: #f2f2f2;
    --table-header: #e0e0e0;
    --table-border: #dddddd;
    --toggle-bg: #ccc;
    --toggle-slider: #ffffff;
    --select-bg: #ffffff;
    --select-text: #000000;
    --select-border: #ccc;
    --highlight-bg: #ffeb3b; /* Highlight color for today */
}

body.dark-mode {
    --background: #121212;
    --text: #ffffff;
    --header-bg: #1f1f1f;
    --table-header: #333333;
    --table-border: #444444;
    --toggle-bg: #555;
    --toggle-slider: #ffffff;
    --select-bg: #333333;
    --select-text: #ffffff;
    --select-border: #555555;
    --highlight-bg: #83791e;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg);
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

h1 {
    margin: 0;
    font-size: 2em;
}

.toggle-container {
    display: flex;
    align-items: center;
}

#toggle-label {
    margin-left: 10px;
    font-size: 1em;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-bg);
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--toggle-slider);
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

main {
    max-width: 1200px;
    margin: 0 auto;
}

.selectors {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.selector {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
    font-size: 1.1em;
}

select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--select-border);
    font-size: 1em;
    background-color: var(--select-bg);
    color: var(--select-text);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: #2196F3;
}

.current-date, .current-time {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

th, td {
    border: 1px solid var(--table-border);
    text-align: center;
    padding: 12px;
}

th {
    background-color: var(--table-header);
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.1);
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.dark-mode tr:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.highlight-today {
    background-color: var(--highlight-bg) !important;
}

#error-message {
    text-align: center;
    color: red;
    font-weight: bold;
    margin-top: 20px;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toggle-container {
        margin-top: 10px;
    }

    .selectors {
        flex-direction: column;
    }

    table {
        width: 100%;
        overflow-x: auto;
    }

    th, td {
        padding: 8px;
        font-size: 0.9em;
    }

    .current-date, .current-time {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px;
    }

    h1 {
        font-size: 1.5em;
        text-align: center;
        width: 100%;
    }

    .toggle-container {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .selectors {
        gap: 10px;
    }

    select {
        font-size: 0.9em;
    }

    th, td {
        padding: 8px;
    }

    .current-date, .current-time {
        font-size: 0.9em;
    }
}