:root {
    --primary-color: #fca311;
    /* Amber/Beer color */
    --primary-hover: #e08b00;
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #333;
    --highlight: #ffffff;
    --danger: #ff4d4d;
    --success: #00b894;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo .highlight {
    color: var(--highlight);
    font-weight: 700;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
}

/* Calendar Controls */
.calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.calendar-controls h2 {
    font-size: 1.8rem;
    color: var(--highlight);
    text-transform: capitalize;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day-header {
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px;
}

.calendar-day {
    background-color: var(--bg-card);
    min-height: 120px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.calendar-day:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.calendar-day.empty {
    background-color: transparent;
    cursor: default;
    border: none;
}

.day-number {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
    display: block;
}

.day-capacity {
    font-size: 0.8rem;
    color: var(--text-muted);
    position: absolute;
    top: 10px;
    right: 10px;
}

.day-capacity.full {
    color: var(--danger);
}

.event-indicator {
    display: block;
    background-color: rgba(252, 163, 17, 0.2);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 2px 5px;
    border-radius: 4px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today {
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(252, 163, 17, 0.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--highlight);
}

/* Form Styles */
h2 {
    color: var(--highlight);
    margin-bottom: 10px;
}

#selectedDateDisplay {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #000;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-danger:hover {
    opacity: 0.8;
}

.btn-edit {
    background-color: var(--primary-color);
    color: black;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: 600;
}

/* Event List Styles */
.events-list {
    margin-top: 20px;
}

.event-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-info h3 {
    color: var(--highlight);
    margin-bottom: 5px;
}

.event-details {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.event-details span {
    margin-right: 15px;
}

.event-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    /* Header Mobile */
    .main-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-bottom: 20px;
    }

    .logo {
        flex-direction: column;
        font-size: 1.2rem;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    nav a {
        margin-left: 0;
        padding: 5px 10px;
        background-color: var(--bg-card);
        border-radius: 4px;
        font-size: 0.9rem;
    }

    nav button#authBtn {
        margin-left: 0 !important;
        width: 100%;
        margin-top: 5px;
    }

    /* Calendar Mobile as List */
    .calendar-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .calendar-day-header {
        display: none;
    }

    .calendar-day {
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        border-left: 4px solid var(--border-color);
        /* Visual indicator */
    }

    /* Hide empty padding days on mobile */
    .calendar-day.empty {
        display: none;
    }

    .calendar-day.today {
        border-color: var(--primary-color);
        background-color: rgba(252, 163, 17, 0.05);
    }

    .day-number {
        font-size: 1.2rem;
        margin-bottom: 10px;
        color: var(--highlight);
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    /* Add "Day of week" label via JS or CSS logic? 
       CSS alone can't add dynamic day name easily without data attr. 
       For now, we keep it simple but clean. 
    */

    .day-capacity {
        position: static;
        margin-bottom: 5px;
        font-size: 0.8rem;
    }

    .event-indicator {
        font-size: 0.9rem;
        padding: 5px 8px;
        margin-top: 5px;
        width: 100%;
    }

    /* Modal Mobile */
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .item-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* Item Grouping in Forms */
.item-fieldset {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.03);
}

.item-fieldset legend {
    color: var(--primary-color);
    padding: 0 10px;
    font-weight: 600;
}

.item-row {
    display: flex;
    gap: 15px;
}

/* Payment Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 5px;
    text-transform: uppercase;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Ensure filter select looks good */
.filter-controls select {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-family: inherit;
    cursor: pointer;
}