/* ==========================================================================
   Management Committee (MC5) Election Portal - Executive UI & Design System
   ========================================================================== */

:root {
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Slate & Primary Tones */
    --primary-950: #070b14;
    --primary-900: #0f172a;
    --primary-850: #131d36;
    --primary-800: #1e293b;
    --primary-700: #334155;
    
    /* Accent & Brand Colors */
    --accent-600: #2563eb;
    --accent-700: #1d4ed8;
    --accent-light: #eff6ff;
    --accent-border: #bfdbfe;
    
    /* Hierarchy Specific Tiers */
    --color-president: #4338ca;
    --bg-president: #eef2ff;
    --border-president: #c7d2fe;
    
    --color-vp: #1d4ed8;
    --bg-vp: #eff6ff;
    --border-vp: #bfdbfe;
    
    --color-gs: #047857;
    --bg-gs: #ecfdf5;
    --border-gs: #a7f3d0;
    
    --color-js: #0f766e;
    --bg-js: #f0fdfa;
    --border-js: #99f6e4;
    
    --color-treasurer: #b45309;
    --bg-treasurer: #fffbeb;
    --border-treasurer: #fde68a;
    
    --color-jt: #c2410c;
    --bg-jt: #fff7ed;
    --border-jt: #ffedd5;
    
    --color-ec: #6d28d9;
    --bg-ec: #f5f3ff;
    --border-ec: #ddd6fe;

    /* Surfaces, Text, Borders */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-subtle: #f1f5f9;
    --border-light: #e2e8f0;
    --border-subtle: #cbd5e1;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    /* Radii & Elevations */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 10px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 20px -3px rgba(15, 23, 42, 0.09), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* -------------------------------------------------------------
   Hero Banner
   ------------------------------------------------------------- */
.hero {
    background: radial-gradient(circle at 85% 15%, rgba(37, 99, 235, 0.25), transparent 50%),
                radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.18), transparent 50%),
                linear-gradient(145deg, #070b14 0%, #0f1a30 55%, #18233f 100%);
    color: var(--text-inverse);
    padding: 3.75rem 0 3.25rem;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-content {
    text-align: center;
    max-width: 920px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.official-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    padding: 0.45rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 1.25rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #34d399;
    box-shadow: 0 0 10px #34d399;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.6; }
}

.hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 2.25rem;
}

/* Timeline Cards */
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.15rem;
    margin-bottom: 2.25rem;
    text-align: left;
}

.timeline-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all var(--transition-fast);
}

.timeline-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.timeline-card.start .timeline-header { color: #34d399; }
.timeline-card.close .timeline-header { color: #f87171; }
.timeline-card.results .timeline-header { color: #fbbf24; }

.timeline-time {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.2rem;
}

.timeline-note {
    font-size: 0.82rem;
    color: #94a3b8;
}

/* Hero Actions & Countdown */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
}

.countdown-box {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.btn-portal-vote {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.98rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-full);
    box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.5);
    transition: all var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-portal-vote:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -4px rgba(37, 99, 235, 0.6);
}

/* -------------------------------------------------------------
   Sticky Navigation Bar
   ------------------------------------------------------------- */
.sticky-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    z-index: 60;
    transition: box-shadow var(--transition-fast);
    width: 100%;
}

.sticky-nav.is-stuck {
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    gap: 0.75rem;
    width: 100%;
}

.nav-tabs-group {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px;
}

.nav-tabs-group::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

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

.tab-text-full {
    display: inline;
}

.tab-text-mobile {
    display: none;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-subtle);
}

.tab-btn.active {
    background-color: var(--primary-900);
    color: var(--text-inverse);
    border-color: var(--primary-900);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.nav-meta-info {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-meta-info span {
    color: var(--accent-600);
}

/* -------------------------------------------------------------
   Control Bar: Search, Filters, View Mode, & Sort
   ------------------------------------------------------------- */
.control-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.control-bar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.search-box-wrapper {
    position: relative;
    flex: 1;
    min-width: 260px;
    max-width: 420px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.search-field {
    width: 100%;
    padding: 0.65rem 2.4rem 0.65rem 2.6rem;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    outline: none;
    transition: all var(--transition-fast);
}

.search-field:focus {
    background: var(--bg-surface);
    border-color: var(--accent-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-clear-btn {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    padding: 0.2rem;
}

.search-clear-btn.visible {
    display: block;
}

/* Controls Right: View Switcher & Sort */
.controls-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.view-mode-toggle {
    display: inline-flex;
    background: var(--bg-surface-subtle);
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
}

.view-btn {
    background: transparent;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.view-btn.active {
    background: #ffffff;
    color: var(--primary-900);
    box-shadow: var(--shadow-sm);
}

.sort-select {
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 0.45rem 1rem;
    outline: none;
    cursor: pointer;
}

/* Position Filter Pills (Hierarchy Ordered) */
.position-filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

.position-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pos-pill {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.pos-pill:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.pos-pill.active {
    background: var(--primary-900);
    color: #ffffff;
    border-color: var(--primary-900);
}

.pill-count {
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.pos-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.control-bar-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.84rem;
    color: var(--text-muted);
}

.reset-btn {
    background: none;
    border: none;
    color: var(--accent-600);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* -------------------------------------------------------------
   Position Group & Headers
   ------------------------------------------------------------- */
.position-section {
    margin-bottom: 3.75rem;
    scroll-margin-top: 90px;
}

.position-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.position-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.position-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-900);
    letter-spacing: -0.02em;
}

.position-quota-tag {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.quota-president { background: var(--bg-president); color: var(--color-president); border: 1px solid var(--border-president); }
.quota-vp { background: var(--bg-vp); color: var(--color-vp); border: 1px solid var(--border-vp); }
.quota-gs { background: var(--bg-gs); color: var(--color-gs); border: 1px solid var(--border-gs); }
.quota-js { background: var(--bg-js); color: var(--color-js); border: 1px solid var(--border-js); }
.quota-treasurer { background: var(--bg-treasurer); color: var(--color-treasurer); border: 1px solid var(--border-treasurer); }
.quota-jt { background: var(--bg-jt); color: var(--color-jt); border: 1px solid var(--border-jt); }
.quota-ec, .quota-executive { background: var(--bg-ec); color: var(--color-ec); border: 1px solid var(--border-ec); }

.position-desc {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    max-width: 780px;
}

.alphabetical-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface-subtle);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* -------------------------------------------------------------
   Candidates Cards View (Modern & Touch Friendly)
   ------------------------------------------------------------- */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

/* Modern Pro Card */
.pro-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    position: relative;
    transition: all var(--transition-fast);
    overflow: hidden;
}

.pro-card:hover {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}



.pro-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-pos-badge {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
}

.badge-flat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
}

.card-avatar-wrap {
    width: 125px;
    height: 125px;
    margin: 0.5rem auto 0.75rem;
    border-radius: 50%;
    position: relative;
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 3px solid #ffffff;
    outline: 2px solid var(--border-subtle);
    overflow: hidden;
}

.card-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform var(--transition-smooth);
}

.pro-card:hover .card-avatar-img {
    transform: scale(1.05);
}

.card-name-block {
    text-align: center;
    margin-bottom: 0.75rem;
}

.card-candidate-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-900);
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.card-candidate-alias {
    font-size: 0.88rem;
    color: var(--accent-600);
    font-weight: 600;
    margin-top: 0.15rem;
    min-height: 1.25rem;
}

.card-summary-box {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
    background: var(--bg-surface-subtle);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    text-align: left;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Actions */
.card-actions-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.btn-view-bio {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-900);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn-view-bio:hover {
    background: var(--primary-900);
    color: #ffffff;
    border-color: var(--primary-900);
}

/* -------------------------------------------------------------
   Table / Comparison View Mode
   ------------------------------------------------------------- */
.table-view-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.comparison-table th {
    background: var(--bg-surface-subtle);
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}

.comparison-table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.comparison-table tr:hover td {
    background-color: #f8fafc;
}

.table-candidate-col {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.table-name {
    font-weight: 700;
    color: var(--primary-900);
}

.table-alias {
    font-size: 0.78rem;
    color: var(--accent-600);
    font-weight: 600;
}

/* -------------------------------------------------------------
   Modal Dialogs (Bio & Ballot Planner)
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 650px;
    max-height: 88vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 2rem;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.modal-close-btn:hover {
    background: var(--primary-900);
    color: #ffffff;
}

.modal-header-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-avatar-frame {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border: 2px solid var(--border-subtle);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.modal-name {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-900);
}

.modal-position {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-600);
    margin-top: 0.2rem;
}

.modal-flat {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-surface-subtle);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.modal-bio-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* -------------------------------------------------------------
   Tab 2: Voting Demo Video
   ------------------------------------------------------------- */
.media-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-sm);
    max-width: 880px;
    margin: 2rem auto 4rem;
}

.section-head-center {
    text-align: center;
    margin-bottom: 1.75rem;
}

.section-head-center h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-900);
    letter-spacing: -0.02em;
}

.section-head-center p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.4rem;
}

.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.voting-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.step-card {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: left;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-600);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.step-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-900);
    margin-bottom: 0.35rem;
}

.step-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* -------------------------------------------------------------
   Tab 3: FAQs & Guidelines
   ------------------------------------------------------------- */
.faq-wrapper {
    max-width: 880px;
    margin: 2rem auto 4rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.faq-category-label {
    margin-top: 1.75rem;
    margin-bottom: 0.65rem;
}

.faq-category-label:first-of-type {
    margin-top: 0.5rem;
}

.category-chip {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-900);
    background: #e2e8f0;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
}

.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast);
}

.faq-item:hover {
    border-color: var(--border-subtle);
}

.faq-trigger {
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-900);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.faq-trigger:hover {
    background-color: var(--bg-surface-subtle);
}

.faq-item.is-open .faq-trigger {
    color: var(--accent-600);
}

.faq-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

.faq-item.is-open .faq-arrow {
    transform: rotate(180deg);
    color: var(--accent-600);
}

.faq-content {
    display: none;
    padding: 0 1.5rem 1.25rem;
    font-size: 0.94rem;
    color: var(--text-secondary);
    line-height: 1.65;
    border-top: 1px solid var(--bg-surface-subtle);
    margin-top: 0.25rem;
}

.faq-item.is-open .faq-content {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--primary-900);
    margin-bottom: 0.5rem;
}

/* -------------------------------------------------------------
   Footer
   ------------------------------------------------------------- */
.portal-footer {
    background: var(--primary-950);
    color: #94a3b8;
    padding: 3rem 0;
    border-top: 1px solid var(--primary-800);
    font-size: 0.88rem;
    text-align: center;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-note {
    max-width: 600px;
    line-height: 1.6;
}

.footer-divider {
    width: 40px;
    height: 2px;
    background: var(--primary-800);
    margin: 0.5rem 0;
}

/* -------------------------------------------------------------
   Responsive Media Queries
   ------------------------------------------------------------- */
@media (max-width: 768px) {
    .nav-meta-info {
        display: none;
    }
    
    .control-bar-top {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box-wrapper {
        max-width: 100%;
    }
    
    .ballot-planner-bar {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .planner-trigger-btn {
        width: 100%;
        justify-content: center;
    }
    
    .media-container {
        padding: 1.25rem;
    }
}


/* -------------------------------------------------------------
   My Home Avatar Logo Styling (Sleek & Tasteful)
   ------------------------------------------------------------- */
.hero-brand-header {
    text-align: center;
    margin-bottom: 1rem;
}

.hero-brand-logo {
    height: 34px !important;
    width: auto !important;
    max-height: 34px !important;
    max-width: 140px !important;
    object-fit: contain;
    display: inline-block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
    transition: transform var(--transition-fast);
}

.hero-brand-logo:hover {
    transform: scale(1.04);
}

/* Nav Brand Logo */
.nav-brand-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-brand-logo {
    height: 26px !important;
    width: auto !important;
    max-height: 26px !important;
    max-width: 110px !important;
    object-fit: contain;
    display: block;
}

/* Footer Logo */
.footer-logo-img {
    height: 28px !important;
    width: auto !important;
    max-height: 28px !important;
    max-width: 115px !important;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity var(--transition-fast);
}

.footer-logo-img:hover {
    opacity: 1;
}


/* =============================================================
   Mobile-First Card & Responsive Polish
   ============================================================= */
.pro-card {
    cursor: pointer;
}

/* Desktop default: flex column layout with centered avatar */
@media (min-width: 641px) {
    .pro-card-main {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .pro-card-avatar-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 0.75rem;
    }

    .card-avatar-wrap {
        width: 125px;
        height: 125px;
        margin: 0.5rem auto 0.75rem;
        border-radius: 50%;
        position: relative;
        background: #f1f5f9;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border: 3px solid #ffffff;
        outline: 2px solid var(--border-subtle);
        overflow: hidden;
    }

    .pro-card-info-col {
        width: 100%;
        text-align: center;
    }

    .pro-card-info-top {
        display: flex;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .badge-flat {
        margin-top: 0.25rem;
    }
}

/* Mobile-First Layout (<640px): High-density horizontal card */
@media (max-width: 640px) {
    .candidates-grid {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    .pro-card {
        padding: 1rem !important;
        border-radius: var(--radius-md) !important;
    }

    .pro-card-main {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.85rem !important;
        align-items: flex-start !important;
        margin-bottom: 0.75rem !important;
    }

    .pro-card-avatar-col {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.4rem !important;
        flex-shrink: 0 !important;
    }

    .card-avatar-wrap {
        width: 78px !important;
        height: 78px !important;
        margin: 0 !important;
        border-width: 2px !important;
    }

    .badge-flat {
        font-size: 0.72rem !important;
        padding: 0.2rem 0.5rem !important;
        white-space: nowrap !important;
    }

    .pro-card-info-col {
        flex: 1 !important;
        min-width: 0 !important;
        text-align: left !important;
    }

    .pro-card-info-top {
        display: flex !important;
        align-items: center !important;
        margin-bottom: 0.3rem !important;
    }

    .card-candidate-name {
        font-size: 1.12rem !important;
        text-align: left !important;
        line-height: 1.25 !important;
    }

    .card-candidate-alias {
        text-align: left !important;
        font-size: 0.82rem !important;
        min-height: auto !important;
        margin-top: 0.1rem !important;
        margin-bottom: 0.35rem !important;
    }

    .card-summary-box {
        font-size: 0.8rem !important;
        line-height: 1.45 !important;
        padding: 0.5rem 0.65rem !important;
        margin: 0 !important;
        -webkit-line-clamp: 2 !important;
    }

    .btn-view-bio.full-btn {
        padding: 0.55rem 0.85rem !important;
        font-size: 0.82rem !important;
    }

    /* Bottom Sheet Modal on Mobile */
    .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .modal-content {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: 85vh !important;
        border-radius: 20px 20px 0 0 !important;
        padding: 1.5rem !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
    }

    .modal-overlay.active .modal-content {
        transform: translateY(0) !important;
    }

    .modal-avatar-frame {
        width: 76px !important;
        height: 76px !important;
        min-width: 76px !important;
        min-height: 76px !important;
        border-radius: 14px !important;
    }

    .modal-name {
        font-size: 1.25rem !important;
        line-height: 1.25 !important;
    }

    /* Mobile Sticky Nav & Header Polish */
    .sticky-nav {
        padding: 0 !important;
    }

    .nav-inner {
        padding: 0.5rem 0 !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }

    .nav-brand-wrap {
        display: none !important;
    }

    .nav-tabs-group {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 0.35rem !important;
        overflow-x: hidden !important;
        padding: 0 !important;
    }

    .tab-btn {
        flex: 1 1 0 !important;
        padding: 0.45rem 0.35rem !important;
        font-size: 0.76rem !important;
        justify-content: center !important;
        gap: 0.3rem !important;
        min-width: 0 !important;
    }

    .tab-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .tab-text-full {
        display: none !important;
    }

    .tab-text-mobile {
        display: inline !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Mobile Control Bar */
    .control-bar {
        padding: 1rem !important;
        margin-top: 1.25rem !important;
        margin-bottom: 1.75rem !important;
        border-radius: var(--radius-md) !important;
    }

    .control-bar-top {
        gap: 0.75rem !important;
        margin-bottom: 0.85rem !important;
    }

    .controls-right {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }

    .view-mode-toggle {
        flex-shrink: 0 !important;
    }

    .sort-select {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 0.78rem !important;
        padding: 0.4rem 0.65rem !important;
    }

    /* Position Filter Row Carousel on Mobile */
    .position-filter-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.4rem !important;
    }

    .position-pills {
        width: 100% !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 0.2rem 0 !important;
    }

    .position-pills::-webkit-scrollbar {
        display: none !important;
    }

    .pos-pill {
        flex-shrink: 0 !important;
        padding: 0.35rem 0.75rem !important;
        font-size: 0.78rem !important;
    }

    /* Comparison Table mobile touch wrapper */
    .table-view-wrapper {
        border-radius: var(--radius-md) !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.65rem 0.65rem !important;
        font-size: 0.8rem !important;
    }

    .table-avatar {
        width: 38px !important;
        height: 38px !important;
    }
}
