/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Light Mode (Default) */
body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    background-color: #FFFFEA;
    color: #000000;
    padding: 20px 0 0;
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    margin-bottom: 30px;
    padding: 0 20px;
}

/* Section */
section {
    padding: 40px 15px;
}

section h2 {
    margin: -40px -30px 10px -30px;
    padding: 10px 20px;
    background-color: #EAFFFF;
    border-top: 2px solid #000000;
    border-bottom: 1px solid #8888CC;
    font-size: 1em;
}

section > form {
    margin: 0;
}

section table {
    margin: 0;
}

/* Buttons */
button {
    background-color: #EAFFFF;
    color: #000000;
    border: 1px solid #000000;
    border-radius: 0;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: Arial, sans-serif;
}

button:hover {
    background-color: #D0EFFF;
}

button:active {
    background-color: #B0DFFF;
}

button.status {
    background-color: #8888CC;
    color: #FFFFFF;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    width: 100%;
    text-align: left;
    font-size: 24px;
    margin-bottom: 0;
}

/* Tabs */
nav.tabs {
    display: flex;
    flex-direction: row;
    gap: 0;
    border-bottom: 1px solid #000000;
    margin-bottom: 20px;
    padding: 0 20px;
}

nav.tabs.hidden {
    display: none;
}

/* Back Button */
#backButton {
    display: none;
    margin: 0 20px 20px 20px;
}

.tab {
    background-color: #FFFFEA;
    border: 1px solid #000000;
    border-bottom: none;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tab:hover {
    background-color: #FFFFD7;
}

.tab.active {
    background-color: #EAFFFF;
    font-weight: bold;
}

/* Category Filter Buttons */
.filters {
    display: flex;
    flex-wrap: wrap;
}

/* Checkbox Filters */
.checkbox-filters {
    display: block;
    margin-bottom: 20px;
}

.checkbox-filter-item {
    display: block;
    margin-bottom: 4px;
    cursor: pointer;
    user-select: none;
}

.checkbox-filter-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.filter-btn {
    background-color: #FFFFEA;
    border: 1px solid #000000;
    padding: 8px 16px;
    font-size: 14px;
    margin: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.filter-btn:hover {
    background-color: #FFFFD7;
}

.filter-btn.active {
    background-color: #8888CC;
    color: #FFFFFF;
    border: 2px solid #000000;
}

.filter-btn.active:active {
    transform: scale(0.98);
}

/* Forms */
fieldset {
    border: none;
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="url"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    background-color: #FFFFFF;
    border: 1px solid #000000;
    border-radius: 0;
}

select[multiple] {
    min-height: 100px;
}

select[multiple] option {
    padding: 8px;
}

select[multiple] option:checked {
    background-color: #8888CC;
    color: #FFFFFF;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-field {
    display: flex;
    align-items: center;
}

.checkbox-field label {
    margin: 0;
    font-weight: normal;
}

/* Progress Bar */
#uploadProgress {
    display: none;
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: #FFFFEA;
    border: 1px solid #000000;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background-color: #EAFFFF;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 12px;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000000;
}

table.mobile-hidden {
    display: table;
}

thead {
    background-color: #EAFFFF;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #8888CC;
    cursor: pointer;
    user-select: none;
}

th:hover {
    background-color: #D0EFFF;
}

th .sort-indicator {
    opacity: 0.3;
    font-size: 12px;
}

th.sorted .sort-indicator {
    opacity: 1;
}

td {
    padding: 12px;
    border: 1px solid #8888CC;
}

tbody tr:hover {
    background-color: #FFFFD7;
}

/* Cards (Mobile) */
.mobile-cards {
    display: none;
}

.event-card {
    background-color: #FFFFD7;
    border: 1px solid #000000;
    padding: 15px;
    margin-bottom: 15px;
}

.event-card-header {
    margin-bottom: 10px;
}

.event-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.event-card-activity {
    font-size: 18px;
    font-weight: bold;
}

.event-card-category {
    background-color: #8888CC;
    color: #FFFFFF;
    border: 1px solid #000000;
    padding: 4px 8px;
    font-size: 12px;
}

.event-card-datetime {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.event-card-details {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 10px;
}

.event-card-details dt {
    font-weight: bold;
}

.event-card-details dd {
    margin: 0;
}

.event-card-footer {
    border-top: 1px solid #000000;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-card-footer p {
    margin: 0;
}

.event-card-actions {
    display: flex;
    gap: 8px;
}

.hidden {
    display: none !important;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1E1F21;
        color: #EEEFF1;
    }

    section h2 {
        background-color: #3A5F7D;
        border-bottom-color: #555555;
    }

    button {
        background-color: #3A5F7D;
        color: #EEEFF1;
        border-color: #555555;
    }

    button:hover {
        background-color: #4A6F8D;
    }

    button:active {
        background-color: #2A4F6D;
    }

    button.status {
        background-color: #3A5F7D;
    }

    .tab {
        background-color: #1E1F21;
        border-color: #555555;
    }

    .tab:hover {
        background-color: #2A2B2D;
    }

    .tab.active {
        background-color: #3A5F7D;
    }

    nav.tabs {
        border-color: #555555;
    }

    .filter-btn {
        background-color: #1E1F21;
        border-color: #555555;
    }

    .filter-btn:hover {
        background-color: #2A2B2D;
    }

    .filter-btn.active {
        background-color: #3A5F7D;
        border-color: #BAD7FF;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="time"],
    input[type="url"],
    input[type="file"],
    textarea,
    select {
        background-color: #1E1F21;
        color: #EEEFF1;
        border-color: #555555;
    }

    select[multiple] option:checked {
        background-color: #3A5F7D;
        color: #EEEFF1;
    }

    input:focus,
    textarea:focus,
    select:focus {
        border-color: #BAD7FF;
        outline: none;
    }

    .progress-bar {
        background-color: #1E1F21;
        border-color: #555555;
    }

    .progress-bar-fill {
        background-color: #3A5F7D;
    }

    thead {
        background-color: #3A5F7D;
    }

    th, td {
        border-color: #555555;
    }

    th:hover {
        background-color: #35363A;
    }

    tbody tr:hover {
        background-color: #35363A;
    }

    table {
        border-color: #555555;
    }

    .event-card {
        background-color: #2A2B2D;
        border-color: #555555;
    }

    .event-card-category {
        background-color: #3A5F7D;
        border-color: #555555;
    }

    .event-card-footer {
        border-color: #555555;
    }
}

/* Mobile Layout */
@media (max-width: 767px) {
    body {
        padding: 10px;
    }

    h1 {
        padding: 0;
    }

    .hamburger {
        display: block;
        background-color: #FFFFEA;
        border: 1px solid #000000;
        border-bottom: 1px solid #000000;
        border-left: none;
        border-right: none;
        padding: 12px 10px;
        margin-bottom: 0;
        text-align: left;
    }

    .hamburger:hover {
        background-color: #FFFFD7;
    }

    nav.tabs {
        flex-direction: column;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .tab {
        width: 100%;
        border-top: none;
        border-bottom: 1px solid #000000;
        border-left: none;
        border-right: none;
        padding: 12px 10px;
        text-align: left;
    }

    table.mobile-hidden {
        display: none;
    }

    .mobile-cards {
        display: block;
    }

    button {
        min-width: 44px;
        min-height: 44px;
    }

    .filter-btn {
        min-width: 44px;
        min-height: 44px;
    }

    select[multiple] {
        min-height: 120px;
    }

    select[multiple] option {
        min-height: 44px;
        padding: 12px 10px;
    }

    .checkbox-filter-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .checkbox-filter-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
}
