:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-psoe: #e31c1c;
    --accent-pp: #1e88e5;
    --accent-podemos: #6a1b9a;
    --accent-vox: #63be21;
    --accent-cs: #ff6600;
    --accent-otros: #607d8b;
    --cat-corruption: #ef5350;
    --cat-legislation: #66bb6a;
    --cat-decision: #42a5f5;
    --cat-crisis: #ff7043;
    --cat-statement: #ab47bc;
    --cat-election: #ffd54f;
    --cat-contradiction: #ec407a;
    --cat-terrorism: #8d6e63;
    --border-color: #2a2a3a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
h1 { font-family: 'DM Serif Display', serif; font-size: 2.5rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 2rem; }
.filters-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.filter-group label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.filter-group select, .search-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}
.search-input { flex: 1; min-width: 250px; }
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}
.stat-item { display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }
.events-grid { display: grid; gap: 16px; }
.event-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}
.event-card:hover { transform: translateY(-2px); border-color: #3a3a4a; }
.event-card.historic { border-left: 4px solid #ffd700; }
.event-card.contradiction { border-right: 4px solid var(--cat-contradiction); }
.event-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.event-date { font-size: 0.9rem; color: var(--text-secondary); }
.event-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-party-psoe { background: var(--accent-psoe); color: white; }
.badge-party-pp { background: var(--accent-pp); color: white; }
.badge-party-podemos { background: var(--accent-podemos); color: white; }
.badge-party-vox { background: var(--accent-vox); color: white; }
.badge-party-cs { background: var(--accent-cs); color: white; }
.badge-party-otros { background: var(--accent-otros); color: white; }
.badge-party-gobierno { background: #37474f; color: white; }
.badge-cat-corruption { background: var(--cat-corruption); color: white; }
.badge-cat-legislation { background: var(--cat-legislation); color: white; }
.badge-cat-decision { background: var(--cat-decision); color: white; }
.badge-cat-crisis { background: var(--cat-crisis); color: white; }
.badge-cat-statement { background: var(--cat-statement); color: white; }
.badge-cat-election { background: var(--cat-election); color: #000; }
.badge-cat-contradiction { background: var(--cat-contradiction); color: white; }
.badge-cat-terrorism { background: var(--cat-terrorism); color: white; }
.badge-cat-taxes { background: #ff8a65; color: white; }
.event-title { font-family: 'DM Serif Display', serif; font-size: 1.25rem; margin-bottom: 10px; }
.event-description { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 14px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.meta-item { display: flex; align-items: center; gap: 4px; }
.sources { display: flex; flex-wrap: wrap; gap: 8px; }
.source-link {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #64b5f6;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.source-link:hover { background: #1e3a5f; border-color: #64b5f6; }
.legend {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.legend-title { font-weight: 600; margin-bottom: 12px; }
.legend-items { display: flex; flex-wrap: wrap; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.legend-color { width: 12px; height: 12px; border-radius: 3px; }
@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    .filters-row { flex-direction: column; }
    .filter-group { width: 100%; }
}
    
/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.tab:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Calendar View */
.calendar-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.month-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.month-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.month-header {
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-count {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.month-events {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.month-event {
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.month-event:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.month-event-date {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.month-event-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.month-event-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.month-event-category {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.mini-badge {
    font-size: 0.8rem;
}

.click-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.month-event:hover .click-hint {
    opacity: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.modal-sources {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.modal-sources h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.modal-sources a {
    display: block;
    color: var(--accent);
    text-decoration: none;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.modal-sources a:hover {
    text-decoration: underline;
}

