/* Variables y Reset */
:root {
    --primary-dark: #1a1a2e;
    --primary-blue: #16213e;
    --accent-blue: #0f3460;
    --accent-pink: #e94560;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.2);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    background-color: var(--glass-bg);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    max-width: 1400px;
    width: 95%;
    backdrop-filter: blur(10px);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.header h1 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 2.8em;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.subtitle {
    color: #64748b;
    font-size: 1.2em;
    font-weight: 400;
}

/* Executive Summary */
.executive-summary {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    justify-content: center;
}

.summary-card.president {
    background: var(--gradient-1);
    padding: 30px 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 25px;
    color: white;
    box-shadow: var(--shadow-medium);
    flex: 1;
    min-width: 350px;
    max-width: 500px;
}

.president-badge {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
}

.president-info h2 {
    margin: 0 0 5px 0;
    font-size: 0.95em;
    font-weight: 500;
    opacity: 0.9;
}

.president-name {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
}

.president-party {
    margin: 5px 0 0 0;
    font-size: 1em;
    opacity: 0.85;
}

.power-metrics {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.metric-card {
    background: white;
    padding: 25px 35px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    text-align: center;
    min-width: 120px;
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.metric-value {
    display: block;
    font-size: 2.5em;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    display: block;
    font-size: 0.9em;
    color: #64748b;
    font-weight: 500;
    margin-top: 5px;
}

/* Cabinet Section */
.cabinet-section {
    margin-bottom: 50px;
}

.cabinet-section h2 {
    color: var(--primary-dark);
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
}

.cabinet-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.cabinet-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: white;
    border-radius: 50px;
    box-shadow: var(--shadow-soft);
    font-size: 0.9em;
}

.cabinet-stat-item .party-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.cabinet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.minister-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border-left: 5px solid;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.minister-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.minister-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.minister-title {
    font-size: 0.85em;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.minister-party-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    color: white;
}

.minister-name {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.minister-eval {
    display: grid;
    gap: 10px;
}

.eval-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85em;
    line-height: 1.4;
}

.eval-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.eval-good {
    color: #22c55e;
}

.eval-bad {
    color: #ef4444;
}

/* Quorum Section */
.quorum-section {
    margin-bottom: 50px;
}

.quorum-section h2 {
    color: var(--primary-dark);
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
}

.quorum-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.quorum-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-soft);
    border-top: 4px solid;
    text-align: center;
}

.quorum-type {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.quorum-desc {
    font-size: 0.85em;
    color: #64748b;
    margin-bottom: 20px;
}

.quorum-numbers {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
}

.quorum-num {
    text-align: center;
}

.quorum-num .value {
    font-size: 2em;
    font-weight: 800;
}

.quorum-num .label {
    font-size: 0.75em;
    color: #64748b;
    text-transform: uppercase;
}

.quorum-status {
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9em;
    display: inline-block;
}

.quorum-status.success {
    background: #dcfce7;
    color: #16a34a;
}

.quorum-status.warning {
    background: #fef3c7;
    color: #d97706;
}

.quorum-status.danger {
    background: #fee2e2;
    color: #dc2626;
}

/* Hemiciclo Section */
.hemicycle-section {
    margin-bottom: 50px;
}

.hemicycle-section h2 {
    color: var(--primary-dark);
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
}

.dashboard {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.card {
    background: white;
    padding: 20px 30px;
    border-radius: var(--radius-md);
    min-width: 250px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #eee;
}

.card h3 {
    margin-top: 0;
    color: var(--primary-dark);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-weight: 700;
    font-size: 1.5em;
}

.stat-label {
    font-size: 0.8em;
    color: #64748b;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 15px 30px;
    background: white;
    border-radius: 50px;
    display: inline-flex;
    box-shadow: var(--shadow-soft);
    margin-left: 50%;
    transform: translateX(-50%);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dot.left {
    background-color: #e74c3c;
}

.dot.center {
    background-color: #2ecc71;
}

.dot.right {
    background-color: #3498db;
}

#hemicycle-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    height: 800px;
    margin: 0 auto;
    overflow: visible;
    margin-top: 20px;
}

.seat {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seat-dot {
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 -3px 3px rgba(0, 0, 0, 0.2),
        inset 0 3px 3px rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.7);
    z-index: 20;
    transition: all 0.3s ease;
}

.seat:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 100;
}

.seat:hover .seat-dot {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4),
        inset 0 -3px 3px rgba(0, 0, 0, 0.2),
        inset 0 3px 3px rgba(255, 255, 255, 0.4);
}

/* Party Glossary */
.party-glossary {
    margin-bottom: 50px;
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.party-glossary h3 {
    color: var(--primary-dark);
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 1.3em;
}

.party-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.party-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    transition: all 0.2s ease;
}

.party-item:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.party-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 700;
    font-size: 0.85em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.party-name {
    font-size: 0.9em;
    color: #475569;
    font-weight: 500;
}

/* Scenarios Section */
.scenarios-section {
    margin-bottom: 50px;
}

.scenarios-section h2 {
    color: var(--primary-dark);
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
}

.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.scenario-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-soft);
    border-left: 5px solid;
}

.scenario-card.positive {
    border-color: #22c55e;
}

.scenario-card.neutral {
    border-color: #f59e0b;
}

.scenario-card.negative {
    border-color: #ef4444;
}

.scenario-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scenario-desc {
    font-size: 0.9em;
    color: #64748b;
    line-height: 1.6;
}

.scenario-probability {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.probability-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.probability-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.probability-fill.high {
    background: #22c55e;
}

.probability-fill.medium {
    background: #f59e0b;
}

.probability-fill.low {
    background: #ef4444;
}

.probability-text {
    font-size: 0.85em;
    font-weight: 600;
    color: #64748b;
    min-width: 45px;
}

/* Gastos Section */
.gastos-section {
    margin-bottom: 40px;
}

.gastos-section h2 {
    color: var(--primary-dark);
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.8em;
}

/* Filters */
.filters-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.filter-input,
.filter-select {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    outline: none;
    transition: all 0.2s;
    flex: 1;
    min-width: 200px;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Table */
.table-container {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    overflow-x: auto;
    margin-bottom: 20px;
}

.gastos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.gastos-table th,
.gastos-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.gastos-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.gastos-table tr:hover {
    background: #f8fafc;
}

.text-right {
    text-align: right;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.btn-page {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-page:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Charts Section */
.charts-section {
    margin-bottom: 40px;
}

.charts-section h2 {
    color: var(--primary-dark);
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.8em;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid #eee;
}

.chart-container-fixed {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-card h3 {
    margin-top: 0;
    color: #475569;
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Tooltip styles */
.seat-tooltip {
    visibility: hidden;
    background-color: rgba(15, 23, 42, 0.95);
    color: #fff;
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    position: absolute;
    z-index: 1001;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    box-shadow: var(--shadow-medium);
}

.seat:hover .seat-tooltip {
    visibility: visible;
    opacity: 1;
}

.info-panel {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .executive-summary {
        flex-direction: column;
    }

    .summary-card.president {
        min-width: auto;
    }

    .power-metrics {
        justify-content: center;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-grid {
        grid-template-columns: 1fr;
    }

    .legend {
        flex-wrap: wrap;
        gap: 15px;
    }
}