/* =========================
   BRASIL WORLD V6 - CSS COMPLETO
   ========================= */

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* VARIABLES - TEMA CLARO */
:root {
    --brasil-azul: #002776;
    --brasil-verde: #009739;
    --brasil-amarelo: #FFDF00;
    --bg-primary: #F5F7FA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E8ECF1;
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-tertiary: #64748B;
    --border: #E2E8F0;
    --shadow-sm: 0 2px 8px rgba(0, 39, 118, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 39, 118, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 39, 118, 0.12);
}

/* TEMA ESCURO */
[data-theme="dark"] {
    --bg-primary: #0a0e17;
    --bg-secondary: #151b2b;
    --bg-tertiary: #1e2635;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border: #2d3748;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================
   LOADING SCREEN
   ================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--brasil-azul) 0%, #001a5c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
    color: white;
}

.brazil-flag-loader {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.flag-stripe {
    position: absolute;
    width: 100%;
    height: 33.33%;
    left: 0;
    animation: slideIn 0.8s ease-out;
}

.flag-stripe.blue {
    top: 0;
    background: var(--brasil-azul);
    animation-delay: 0.1s;
}

.flag-stripe.yellow {
    top: 33.33%;
    background: var(--brasil-amarelo);
    animation-delay: 0.2s;
}

.flag-stripe.green {
    top: 66.66%;
    background: var(--brasil-verde);
    animation-delay: 0.3s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.loading-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.loading-text {
    font-size: 1rem;
    opacity: 0.9;
}

/* ==================
   HEADER
   ================== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--brasil-azul), var(--brasil-verde), var(--brasil-amarelo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    animation: gradientShift 3s ease infinite;
    letter-spacing: -0.5px;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(10deg); }
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.badge-oficial {
    background: var(--brasil-verde);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
}

/* THEME TOGGLE */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: var(--brasil-amarelo);
    border-color: var(--brasil-amarelo);
    transform: scale(1.1) rotate(15deg);
}

/* HEADER ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==================
   FILTERS
   ================== */
.filters {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
}

.search-input,
.filter-select {
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--brasil-azul);
    box-shadow: 0 0 0 3px rgba(0, 39, 118, 0.1);
}

/* ==================
   DEPUTIES GRID
   ================== */
.deputies-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.deputy-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.deputy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brasil-verde), var(--brasil-amarelo), var(--brasil-azul));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.deputy-card:hover::before {
    transform: scaleX(1);
}

.deputy-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brasil-azul);
}

.deputy-photo {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
}

.deputy-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deputy-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.party-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

/* ==================
   MODAL
   ================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    transition: background-color 0.3s ease;
}

.modal-close {
    position: sticky;
    top: 1rem;
    right: 1rem;
    float: right;
    background: var(--brasil-azul);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #001a5c;
    transform: rotate(90deg);
}

/* Profile Header */
.profile-header {
    background: linear-gradient(135deg, var(--brasil-azul), #001a5c);
    color: white;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-header img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
}

.profile-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    background: var(--bg-tertiary);
    padding: 0 1rem;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-button:hover {
    background: rgba(0, 39, 118, 0.05);
    color: var(--brasil-azul);
}

.tab-button.active {
    color: var(--brasil-azul);
    border-bottom-color: var(--brasil-azul);
    background: white;
}

/* Tab Contents */
.tab-contents {
    padding: 2rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Info Grid */
.info-grid {
    display: grid;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.info-label {
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 200px;
}

/* RESPONSIVE */
/* RESPONSIVE */
@media (max-width: 768px) {
    .filters {
        grid-template-columns: 1fr;
    }
    
    .deputies-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
        padding: 0 1rem 2rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tabs {
        flex-wrap: wrap;
        padding: 0 0.5rem;
    }
    
    .tab-button {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-tab {
        padding: 1rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .nav-icon {
        font-size: 1.25rem;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .construction-banner {
        padding: 2rem 1.5rem;
    }
    
    .construction-banner h2 {
        font-size: 1.5rem;
    }
}

/* ==================
   NAVIGATION TABS
   ================== */
.main-navigation {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
    margin-bottom: 0;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--brasil-azul);
    border-bottom-color: var(--brasil-azul);
    background: var(--bg-primary);
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-text {
    font-size: 1rem;
}

.nav-count {
    background: var(--brasil-verde);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
}

.nav-badge {
    background: var(--brasil-amarelo);
    color: #1a1a1a;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* CONTENT SECTIONS */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ==================
   SENADORES PLACEHOLDER
   ================== */
.senadores-placeholder {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.construction-banner {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.construction-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.construction-banner h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.construction-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.progress-container {
    margin: 2rem 0;
}

.progress-bar {
    background: var(--bg-tertiary);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    background: linear-gradient(90deg, var(--brasil-verde), var(--brasil-amarelo));
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.feature-item {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    font-size: 2rem;
}

.feature-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.info-box {
    background: var(--bg-secondary);
    border-left: 4px solid var(--brasil-azul);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: left;
    margin: 2rem 0;
}

.info-box p {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.update-note {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}
