/* ====== BASIC PAGE STYLES ====== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, #f0f8ff, #e6f7ff);
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ====== HEADER ====== */
header {
    background: #003366;
    color: white;
    padding: 20px 0;
}

h1 {
    color: white;
    margin: 0;
}

h2 {
    color: DarkMagenta;
}

/* ====== MAIN SECTION ====== */
main {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

/* ====== FOOTER ====== */
footer {
    background: #003366;
    color: white;
    padding: 20px 0;
    width: 100%;
}

/* ====== NAVIGATION ====== */
ul.nav {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000;
    width: 100%;
}

li.nav {
    float: left;
    border-right: 1px solid #bbb;
}

li.nav a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

li.nav a:hover:not(.active) {
    background-color: #1a18eb;
}

li.nav.nav-right {
    float: right;
    border-left: 1px solid #bbb;
    border-right: none;
}

/* ====== DATE PICKER ====== */
#datePicker {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ====== DATE NAVIGATION ====== */
.date-navigation {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.date-navigation button {
    background: #003366;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.date-navigation button:hover {
    background-color: #1a18eb;
}

.date-navigation select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin: 0 5px;
}

#currentDayBtn {
    margin-left: auto;
    padding: 8px 16px;
}

/* ====== CALENDAR TABLE ====== */
table {
    border: 1px solid #003366;
    border-collapse: collapse;
    margin: 2rem auto;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

th, td {
    border: 1px solid #003366;
    padding: 8px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

th {
    font-weight: bold;
    background: #003366;
    color: white;
}

td {
    vertical-align: top;
    width: 100px;
    height: 80px;
}

/* ====== TODAY HIGHLIGHT ====== */
.today {
    background-color: #e6f7ff !important;
    font-weight: bold;
    position: relative;
}

.today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: #003366;
    border-radius: 2px;
}

/* ====== SELECTED DAY ====== */
.selected-day {
    background-color: #fff3e0 !important;
    box-shadow: 0 0 0 2px #ff9800 inset;
}

/* ====== MODALS (Event, Auth) ====== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 350px;
    height: 500px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ====== AUTHENTICATION FORMS ====== */
.auth-input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

.auth-btn {
    width: 100%;
    background-color: #003366;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background-color: #1a18eb;
}

.auth-toggle {
    text-align: center;
    margin: 15px 0 0 0;
    color: #666;
}

.auth-toggle a {
    color: #003366;
    text-decoration: none;
    font-weight: bold;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* ====== MODAL CLOSE BUTTON ====== */
.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #666;
}

/* ====== CONTENT BOX STYLE ====== */
.content-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin: 20px auto;
    max-width: 800px;
    text-align: left;
}

/* ====== FEATURES LIST ====== */
.feature-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.feature-list li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.feature-list ul {
    list-style-type: circle;
    margin: 0.5rem 0 0.5rem 1.5rem;
    padding-left: 1rem;
}

dt {
    font-weight: bold;
    margin-top: 1rem;
    color: #003366;
}

dd {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* ====== COLOR THEME (LIGHT + DARK MODE) ====== */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --header-bg: #003366;
    --nav-bg: #000000;
    --calendar-bg: #ffffff;
    --border-color: #003366;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --header-bg: #001a33;
    --nav-bg: #1a1a1a;
    --calendar-bg: #2d2d2d;
    --border-color: #4d4d4d;
}

body {
    background: linear-gradient(to bottom, var(--bg-color), var(--bg-color));
    color: var(--text-color);
}

/* Nav and Table Colors in Dark Mode */
header { background: var(--header-bg); }
ul.nav { background-color: var(--nav-bg); }
table { background-color: var(--calendar-bg); border-color: var(--border-color); }
th { background: var(--header-bg); border-color: var(--border-color); }
td { border-color: var(--border-color); }

/* ====== DARK MODE TOGGLE ====== */
.theme-toggle {
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
    background-color: #ccc;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 21px;
    height: 21px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

#darkModeToggle:checked + .toggle-slider {
    background-color: #2196F3;
}

#darkModeToggle:checked + .toggle-slider::before {
    transform: translateX(25px);
}

#darkModeToggle {
    display: none;
}

/* ====== STATS BOXES (Admin Page) ====== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.stat-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-item h4 {
    color: #003366;
    margin: 0 0 1rem 0;
}

.stat-item p {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
    color: #1a18eb;
}

/* ====== EVENT STRIPS ====== */
.event-strip {
    margin-top: 2px;
    padding: 2px 4px;
    font-size: 0.7em;
    color: white;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.more-strip {
    background-color: #888 !important;
}

/* Multi-Day Event Connections */
.event-strip.multi-day-start {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.event-strip.multi-day-middle {
    border-radius: 0;
}

.event-strip.multi-day-end {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}