/* ===== Parliament Page Styles (Matching Main Site Aesthetic) ===== */

/* Page Background */
body.parliament-page {
    background: #fff;
    color: #111;
    font-family: 'Open Sans', sans-serif;
    line-height: 1.5;
}

.topbar__link--active {
    color: #007fa3 !important;
    font-weight: 800;
}

/* Hero Section */
.parliament-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
    overflow: hidden;
    min-height: auto;
}

.parliament-hero .hero__card {
    position: relative;
    z-index: 1;
    background: #fff;
    max-width: 840px;
    width: 100%;
    padding: 36px 40px;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.parliament-hero .logo {
    margin-bottom: 20px;
    justify-content: center;
}

.parliament-hero__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 12px;
    color: #111;
}

.parliament-hero__desc {
    font-size: 15px;
    line-height: 160%;
    color: #555;
    max-width: 700px;
    margin: 0 auto 24px;
}

/* Chamber Switcher (Matching .map-mode-switch from main page) */
.chamber-switch {
    display: inline-flex;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
    background: #f6f8fa;
    padding: 3px;
    gap: 3px;
    margin: 0 auto;
}

.chamber-btn {
    padding: 8px 20px;
    font-size: 13.5px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chamber-btn:hover {
    color: #0f172a;
}

.chamber-btn.active {
    background: #0f172a;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.chamber-badge {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}

.chamber-btn.active .chamber-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Chamber Summary Stats (Matching .hero__meta & .detail-card from main page) */
.parliament-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.p-stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px 18px;
    border-top: 3px solid #007fa3;
}

.p-stat-card--red {
    border-top-color: #f30;
}

.p-stat-card--gold {
    border-top-color: #eaad1a;
}

.p-stat-card--navy {
    border-top-color: #0f172a;
}

.p-stat-val {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 900;
    color: #111;
    line-height: 1.1;
    margin-bottom: 4px;
}

.p-stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #777;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.p-stat-desc {
    font-size: 12px;
    color: #888;
}

/* Controls Bar (Factions & Filters) */
.parliament-controls {
    background: #f8fafc;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.faction-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.faction-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #d0d7de;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Open Sans', sans-serif;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.faction-btn:hover {
    border-color: #999;
    background: #f1f5f9;
}

.faction-btn.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.faction-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.faction-count {
    background: #f1f5f9;
    color: #444;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 11px;
}

.faction-btn.active .faction-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Secondary Filter & Search */
.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sub-filter-switch {
    display: inline-flex;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.sub-filter-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sub-filter-btn:hover {
    color: #111;
}

.sub-filter-btn.active {
    background: #0f172a;
    color: #fff;
    font-weight: 700;
}

.p-search-input {
    padding: 6px 12px;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: inherit;
    width: 220px;
    outline: none;
    background: #fff;
}

.p-search-input:focus {
    border-color: #007fa3;
    box-shadow: 0 0 0 2px rgba(0, 127, 163, 0.15);
}

/* Hemicycle Card Container */
.hemicycle-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 24px 20px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.hemicycle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.hemicycle-header__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 900;
    color: #111;
}

.hemicycle-header__hint {
    font-size: 12px;
    color: #777;
}

/* SVG Chart */
.hemicycle-svg-wrap {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.hemicycle-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* Seat Elements in SVG */
.seat-circle {
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.15s ease;
    transform-origin: center;
    transform-box: fill-box;
}

.seat-circle:hover {
    transform: scale(1.7);
    stroke: #0f172a !important;
    stroke-width: 2px !important;
}

.seat-circle.dimmed {
    opacity: 0.15 !important;
}

.seat-circle.highlighted {
    stroke: #111 !important;
    stroke-width: 2px !important;
}

/* Presidium & Speaker SVG Elements */
.svg-presidium-desk {
    fill: #f1f5f9;
    stroke: #cbd5e1;
    stroke-width: 1.5;
    rx: 4;
}

.svg-presidium-label {
    fill: #475569;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-anchor: middle;
}

.svg-speaker-chair {
    fill: #007fa3;
    stroke: #ffffff;
    stroke-width: 2.5;
    cursor: pointer;
    transition: transform 0.15s ease, fill 0.15s ease;
    transform-origin: center;
    transform-box: fill-box;
}

.svg-speaker-chair:hover {
    transform: scale(1.3);
    fill: #f30;
}

.svg-rostrum {
    fill: #ffffff;
    stroke: #94a3b8;
    stroke-width: 1.5;
    rx: 3;
}

.svg-bench-box {
    fill: #f8fafc;
    stroke: #e2e8f0;
    stroke-width: 1;
    rx: 3;
}

/* Floating Tooltip (Matching #222 style of regional tooltip) */
.parliament-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: #1e293b;
    color: #fff;
    border-radius: 4px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    max-width: 320px;
    font-size: 12px;
    line-height: 1.4;
    transition: opacity 0.08s ease;
    opacity: 0;
    transform: translate(-50%, -100%) translateY(-10px);
}

.parliament-tooltip.visible {
    opacity: 1;
}

.pt-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 12px;
}

.pt-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pt-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 13.5px;
    color: #fff;
    margin-bottom: 4px;
}

.pt-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10.5px;
    font-weight: 700;
    margin-bottom: 5px;
}

.pt-badge--district {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}

.pt-badge--list {
    background: rgba(234, 173, 26, 0.25);
    color: #facc15;
}

.pt-badge--senate {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.pt-desc {
    color: #cbd5e1;
    font-size: 11.5px;
}

/* Deputy Profile Drawer */
.deputy-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.deputy-drawer.open {
    transform: translateX(0);
}

.deputy-drawer__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.deputy-drawer__overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.deputy-drawer__header {
    background: #0f172a;
    color: #fff;
    padding: 24px 20px 20px;
    position: relative;
}

.deputy-drawer__close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.deputy-drawer__close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.deputy-drawer__badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 8px;
}

.deputy-drawer__name {
    font-family: 'Montserrat', sans-serif;
    font-size: 19px;
    font-weight: 900;
    margin-bottom: 4px;
    line-height: 1.25;
}

.deputy-drawer__sub {
    font-size: 12.5px;
    color: #94a3b8;
}

.deputy-drawer__body {
    padding: 24px 20px;
    flex: 1;
    overflow-y: auto;
}

.drawer-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.drawer-table td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.drawer-table td:first-child {
    color: #666;
    width: 44%;
}

.drawer-table td:last-child {
    font-weight: 700;
    color: #111;
}

.drawer-quote {
    background: #f8fafc;
    border-left: 3px solid #007fa3;
    padding: 12px 14px;
    font-size: 13px;
    font-style: italic;
    color: #475569;
    border-radius: 0 4px 4px 0;
    margin-top: 14px;
}

.drawer-map-btn {
    display: block;
    text-align: center;
    background: #f30;
    color: #fff;
    padding: 11px;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 13px;
    margin-top: 22px;
    text-decoration: none;
    transition: background 0.15s;
}

.drawer-map-btn:hover {
    background: #ff5533;
}

/* Responsive */
@media (max-width: 900px) {
    .parliament-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .parliament-stats-row {
        grid-template-columns: 1fr;
    }
    .parliament-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    .p-search-input {
        width: 100%;
    }
}
