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

:root {
    --primary-color: #E9A420; /* Gold */
    --primary-hover: #c6891c; /* Darker gold hover */
    --danger-color: #B22222; /* Dark Red */
    --danger-hover: #8B0000;
    --success-color: #32CD32; /* Lime Green */
    --success-bg: #1A1A1A;
    --error-color: #FF4500;
    --error-bg: #2B2B2B;
    --alert-color: #FFA500;
    --alert-bg: #1F1F1F;
    --text-color: #E6E6E6; /* Light text for dark background */
    --text-light: #CCCCCC;
    --border-color: #444444;
    --background: #0D0D0D; /* Main black background */
    --card-bg: #1A1A1A; /* Dark card background */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
}

/* Global gold links */
a,
a:link,
a:visited,
a:active {
    color: var(--primary-color);
}
a:hover {
    color: var(--primary-hover);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--primary-color);
    color: var(--background);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    color: #0D0D0D; /* Dark text inside gold header */
}

header nav a {
    color: #0D0D0D;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
}

header nav a:hover {
    text-decoration: underline;
}

/* Admin Navigation */
.admin-nav {
    background: #1A1A1A;
    color: var(--text-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.admin-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-nav h2 {
    font-size: 1.25rem;
    margin-right: 2rem;
    color: var(--primary-color);
}

.admin-nav a {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.admin-nav a:hover {
    text-decoration: underline;
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
}

section {
    margin-bottom: 3rem;
}

/* Event Grid */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.event-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.event-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.event-meta p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

.event-description {
    margin: 1rem 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.past-event {
    opacity: 0.7;
}

/* Event Detail */
.event-detail {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.event-info {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.event-info p {
    margin: 0.75rem 0;
    font-size: 1rem;
}

.event-description-full {
    margin: 2rem 0;
}

.event-description-full h2 {
    margin-top: 0;
}

.rsvp-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(233, 164, 32, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: #0D0D0D;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
    color: #0D0D0D;
}

.btn-primary {
    background: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--text-light);
    color: #0D0D0D;
}

.btn-secondary:hover {
    background: #666666;
    color: #0D0D0D;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
    color: #fff;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    background: var(--card-bg);
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
    color: var(--text-color);
}

thead {
    background: var(--background);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: #222222;
}

/* Messages */
.success {
    background: var(--success-bg);
    color: var(--success-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--success-color);
}

.error {
    background: var(--error-bg);
    color: var(--error-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--error-color);
}

.alert {
    background: var(--alert-bg);
    color: var(--alert-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--alert-color);
}

/* Login Box */
.login-box {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    color: var(--text-color);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1,
.page-header h2 {
    color: var(--primary-color);
}

/* Footer */
footer {
    background: var(--text-color);
    color: var(--background);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer a {
    color: var(--background);
}

footer a:hover {
    color: #333;
}

/* Utilities */
.text-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    header nav {
        margin-top: 1rem;
    }
    
    header nav a {
        margin: 0 0.75rem;
    }
    
    .admin-nav .container {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-nav a {
        display: inline-block;
        margin: 0.5rem;
    }
    
    .event-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header .btn {
        margin-top: 1rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-small {
        display: block;
        margin: 0.25rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .event-detail {
        padding: 1.5rem;
    }
}

/* Calendar Integration Buttons */
.calendar-buttons {
    background: var(--background);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.calendar-buttons h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.calendar-button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-calendar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-calendar svg {
    flex-shrink: 0;
}

.btn-google {
    background: #4285f4;
    color: white;
}

.btn-google:hover {
    background: #3367d6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.btn-outlook {
    background: #0078d4;
    color: white;
}

.btn-outlook:hover {
    background: #006bc1;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 120, 212, 0.3);
}

.btn-apple {
    background: #555555;
    color: white;
}

.btn-apple:hover {
    background: #333333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(85, 85, 85, 0.3);
}

.btn-ics {
    background: var(--primary-color);
    color: #0D0D0D;
}

.btn-ics:hover {
    background: var(--primary-hover);
    color: #0D0D0D;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(233, 164, 32, 0.3);
}

.calendar-note {
    margin: 1rem 0 0 0;
    color: var(--text-light);
    font-size: 0.875rem;
    text-align: center;
}

/* Responsive Calendar Buttons */
@media (max-width: 768px) {
    .calendar-button-group {
        grid-template-columns: 1fr;
    }
    
    .btn-calendar {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calendar-buttons {
        padding: 1.5rem;
    }
    
    .btn-calendar {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
}

/* Public page notice */
.public-notice {
    background: #1A1A1A;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.public-notice h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.public-notice p {
    margin: 0;
    color: var(--text-light);
}

.public-notice a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

.public-card {
    opacity: 0.9;
}

.public-summary {
    color: var(--text-light);
    font-style: italic;
    margin: 1rem 0;
}

.login-prompt {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* RSVP Status */
.rsvp-status {
    padding: 0.75rem;
    border-radius: 4px;
    margin: 1rem 0;
    font-weight: 500;
}

.rsvp-status.success {
    background: var(--success-bg);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

/* Enhanced event info sections */
.event-info h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.event-info {
    margin-bottom: 1.5rem;
}

.settings-section {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* Past events */
.past-section {
    margin-top: 3rem;
}

.past-section h2 {
    color: #6b7280;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.past-card {
    opacity: 0.65;
    filter: grayscale(30%);
}

.past-badge {
    display: inline-block;
    background: #2a2a2a;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}