/* Classical Choral Theme - Alliance Alumni Mixed Choir (AAMC) */
:root {
    --navy-dark: #0f1a2e;
    --navy-primary: #1a2b4c;
    --navy-light: #253b68;
    --gold-primary: #c59b27;
    --gold-light: #dfb235;
    --gold-subtle: #fcf8ee;
    --gold-border: #e6cb7a;
    --cream-bg: #faf8f5;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #15803d;
    --success-bg: #f0fdf4;
    --error: #b91c1c;
    --error-bg: #fef2f2;
    --font-heading: 'Cinzel', Georgia, serif;
    --font-subheading: 'Lora', Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 14px rgba(26,43,76,0.08);
    --shadow-lg: 0 10px 25px rgba(26,43,76,0.12);
}

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

body {
    background-color: var(--cream-bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Crest */
.site-header {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-primary) 100%);
    color: #ffffff;
    padding: 2.25rem 1rem 2rem;
    text-align: center;
    border-bottom: 4px solid var(--gold-primary);
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
}

.crest-icon {
    display: inline-block;
    width: 64px;
    height: 64px;
    line-height: 64px;
    background: rgba(197, 155, 39, 0.15);
    border: 2px solid var(--gold-primary);
    border-radius: 50%;
    color: var(--gold-light);
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    letter-spacing: 0.04em;
    color: #ffffff;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.site-subtitle {
    font-family: var(--font-subheading);
    font-size: 1.05rem;
    color: var(--gold-light);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.election-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(197, 155, 39, 0.4);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #e2e8f0;
}

/* Main Container */
.main-content {
    flex: 1;
    max-width: 820px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.75rem;
}

/* Header Action Badges & Returning Officer Button */
.header-badges {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.ro-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(197, 155, 39, 0.22);
    border: 1px solid var(--gold-primary);
    padding: 0.35rem 0.95rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ro-badge-btn:hover {
    background: var(--gold-primary);
    color: var(--navy-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(197, 155, 39, 0.35);
}

/* Status Pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.95rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-pill-gold {
    background: var(--gold-subtle);
    color: var(--navy-dark);
    border: 1px solid var(--gold-border);
}

.ro-access-divider {
    display: flex;
    align-items: center;
    max-width: 440px;
    margin: 1.5rem auto 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ro-access-divider::before,
.ro-access-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.ro-access-divider span {
    padding: 0 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
    transition: color 0.15s;
}

.modal-close-btn:hover {
    color: var(--navy-dark);
}

.card-gold {
    border-top: 4px solid var(--gold-primary);
}

/* Voter Status Bar */
.voter-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gold-subtle);
    border: 1px solid var(--gold-border);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.voter-info strong {
    font-size: 1.1rem;
    color: var(--navy-dark);
}

.voter-badge {
    display: inline-block;
    background: var(--navy-primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Instructions */
.ballot-header {
    margin-bottom: 1.5rem;
}

.ballot-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--navy-primary);
    margin-bottom: 0.35rem;
}

.ballot-rules {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Counter Sticky Bar */
.counter-bar {
    position: sticky;
    top: 1rem;
    z-index: 50;
    background: var(--navy-dark);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--gold-primary);
}

.counter-badge {
    background: var(--gold-primary);
    color: var(--navy-dark);
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Candidate Grid */
.candidate-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.candidate-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.candidate-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.candidate-card.selected {
    border-color: var(--gold-primary);
    background: #fffdf9;
    box-shadow: 0 0 0 1px var(--gold-primary);
}

.candidate-card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f8fafc;
}

.candidate-checkbox {
    margin-top: 0.25rem;
    width: 22px;
    height: 22px;
    accent-color: var(--navy-primary);
    cursor: pointer;
}

.candidate-content {
    flex: 1;
}

.candidate-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.candidate-name {
    font-family: var(--font-subheading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy-dark);
}

.voice-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.voice-soprano { background: #fdf2f8; color: #9d174d; border: 1px solid #fbcfe8; }
.voice-alto    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.voice-tenor   { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.voice-bass    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

.candidate-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--navy-primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(26,43,76,0.2);
}

.btn-primary:hover {
    background: var(--navy-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(26,43,76,0.3);
}

.btn-gold {
    background: var(--gold-primary);
    color: var(--navy-dark);
    font-weight: 700;
}

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

.btn-block {
    width: 100%;
}

.input-field {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--navy-primary);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 26, 46, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #ffffff;
    max-width: 500px;
    width: 100%;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--gold-primary);
}

.modal-title {
    font-family: var(--font-heading);
    color: var(--navy-primary);
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.modal-candidates {
    background: var(--cream-bg);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0 1.5rem;
}

.modal-candidates li {
    margin-left: 1.25rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--navy-dark);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/* Results & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table th {
    background: var(--navy-primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.progress-bar-bg {
    width: 100%;
    background: #e2e8f0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
    border-radius: 5px;
}

/* Footer */
.site-footer {
    background: var(--navy-dark);
    color: #94a3b8;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.85rem;
    margin-top: auto;
    border-top: 1px solid #1e293b;
}

.site-footer a {
    color: var(--gold-light);
    text-decoration: none;
}

@media (max-width: 600px) {
    .site-title { font-size: 1.35rem; }
    .site-subtitle { font-size: 0.95rem; }
    .card { padding: 1.25rem; }
    .candidate-card { padding: 1rem; }
    .counter-bar { flex-direction: column; gap: 0.5rem; text-align: center; }
}
