/**
 * 🍎 ELITE SECTIONS REDESIGN - Apple Engineer Level
 * REDESIGN TOTAL: Insights, Resumo, Categorias
 *
 * 🎯 CONCEITO:
 * - Container externo: IGUAL aos country cards BRASIL/ESTADOS UNIDOS
 *   → Morphing blobs animados
 *   → Backdrop-filter blur
 *   → Mesh gradients no light mode
 *
 * - Cards internos (dark mode): Semi-transparentes suaves
 * - Cards internos (light mode): CORES SÓLIDAS VIBRANTES + TEXTO BRANCO
 *   → 100% visíveis e impactantes
 *   → Gradientes coloridos (cyan, purple, green, blue, pink, orange, yellow)
 *   → Sombras e hover effects impressionantes
 *
 * 🏗️ ESTRUTURA:
 * .elite-section-container → Container principal (3 temas: cyan/purple/pink)
 * .section-blob-container → Blobs animados de fundo
 * .section-header-redesign → Header com ícone + título
 * .section-cards-grid → Grid de cards internos
 * .inner-card-redesign → Card individual (dark: glass / light: colorido)
 */

/* ===================================
   🎨 BASE CONTAINER - Padrão Painel Financeiro (Apple Zen)
=================================== */

/* Container base - IGUAL ao apple-zen-banner */
.elite-section-container {
    position: relative;
    padding: 1.75rem;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 2rem;

    /* Fundo limpo (muda com tema) */
    background: var(--apple-bg-primary);

    /* Borda sutil */
    border: 1px solid var(--apple-border);

    /* Sombra Apple */
    box-shadow:
        0 25px 50px -12px var(--apple-shadow),
        0 12px 24px -8px var(--apple-shadow),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);

    /* Transição premium */
    transition: all 0.8s cubic-bezier(0.28, 0.11, 0.32, 1);
}

/* Hover sutil (opcional) */
.elite-section-container:hover {
    transform: translateY(-4px);
    box-shadow:
        0 30px 60px -15px var(--apple-shadow),
        0 15px 30px -10px var(--apple-shadow),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

/* ===================================
   🌀 MORPHING BLOBS - Padrão Painel Financeiro
   (SEM LINHAS DE GRADE)
=================================== */

.section-blob-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    opacity: 0.08; /* Sutil no light mode */
}

[data-theme="dark"] .section-blob-container {
    opacity: 0.12; /* Mais visível no dark mode */
}

.section-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    mix-blend-mode: multiply;
    animation: apple-blob-morph 20s ease-in-out infinite;
}

[data-theme="dark"] .section-blob {
    mix-blend-mode: screen;
}

.section-blob-1 {
    width: 450px;
    height: 450px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.section-blob-2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

@keyframes apple-blob-morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(30px, -30px) rotate(90deg) scale(1.05);
    }
    50% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: translate(-20px, 20px) rotate(180deg) scale(0.95);
    }
    75% {
        border-radius: 70% 30% 50% 50% / 30% 70% 50% 50%;
        transform: translate(20px, 10px) rotate(270deg) scale(1.02);
    }
}

/* ===================================
   💡 INSIGHTS SECTION - Cyan Blobs
=================================== */

.elite-insights-redesign .section-blob-1 {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.elite-insights-redesign .section-blob-2 {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
}

/* ===================================
   💰 RESUMO SECTION - Purple Blobs
=================================== */

.elite-resumo-redesign .section-blob-1 {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.elite-resumo-redesign .section-blob-2 {
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
}

/* ===================================
   📊 CATEGORIAS SECTION - Pink Blobs
=================================== */

.elite-categorias-redesign .section-blob-1 {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.elite-categorias-redesign .section-blob-2 {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

/* ===================================
   💰 BALANCE SECTION - Emerald/Green Blobs
=================================== */

.elite-balance-redesign .section-blob-1 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.elite-balance-redesign .section-blob-2 {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

/* ===================================
   📋 SECTION HEADER - Redesigned
=================================== */

.section-header-redesign {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.28, 0.11, 0.32, 1);
}

/* Insights Icon */
.elite-insights-redesign .section-icon-badge {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.05));
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #06b6d4;
}

[data-theme="light"] .elite-insights-redesign .section-icon-badge {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(255, 255, 255, 0.8));
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}

/* Resumo Icon */
.elite-resumo-redesign .section-icon-badge {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.05));
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

[data-theme="light"] .elite-resumo-redesign .section-icon-badge {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(255, 255, 255, 0.8));
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

/* Categorias Icon */
.elite-categorias-redesign .section-icon-badge {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: #ec4899;
}

[data-theme="light"] .elite-categorias-redesign .section-icon-badge {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(255, 255, 255, 0.8));
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.15);
}

.section-title-redesign {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Dark Mode Title Colors */
.elite-insights-redesign .section-title-redesign {
    color: #e5e7eb;
}

.elite-resumo-redesign .section-title-redesign {
    color: #e5e7eb;
}

.elite-categorias-redesign .section-title-redesign {
    color: #e5e7eb;
}

/* Light Mode Title Colors */
[data-theme="light"] .section-title-redesign {
    color: #1f2937;
}

/* ===================================
   🎴 CARDS INTERNOS - CORES SÓLIDAS VISÍVEIS
=================================== */

/* Container de cards */
.section-cards-grid {
    display: grid;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* Card individual - MODO ESCURO */
.inner-card-redesign {
    padding: 1.25rem;
    border-radius: 18px;
    transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
    position: relative;
    overflow: hidden;
}

/* Dark Mode - Cards semi-transparentes */
.inner-card-redesign {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
}

.inner-card-redesign:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ===================================
   💡 LIGHT MODE - CARDS SÓLIDOS E VISÍVEIS
=================================== */

/* Insights Cards - Cyan sólido */
[data-theme="light"] .elite-insights-redesign .inner-card-redesign {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 24px rgba(6, 182, 212, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .elite-insights-redesign .inner-card-redesign:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 12px 32px rgba(6, 182, 212, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Resumo Cards - Purple/Green/Blue sólidos */
[data-theme="light"] .elite-resumo-redesign .inner-card-redesign.card-brasil {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 24px rgba(16, 185, 129, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .elite-resumo-redesign .inner-card-redesign.card-usa {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 24px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .elite-resumo-redesign .inner-card-redesign.card-total {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 10px 30px rgba(168, 85, 247, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .elite-resumo-redesign .inner-card-redesign:hover {
    transform: translateY(-6px) scale(1.02);
}

/* Categorias Cards - Pink/Orange/Yellow/etc sólidos */
[data-theme="light"] .elite-categorias-redesign .inner-card-redesign:nth-child(1) {
    background: linear-gradient(135deg, #db2777 0%, #ec4899 100%);
}

[data-theme="light"] .elite-categorias-redesign .inner-card-redesign:nth-child(2) {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
}

[data-theme="light"] .elite-categorias-redesign .inner-card-redesign:nth-child(3) {
    background: linear-gradient(135deg, #ca8a04 0%, #eab308 100%);
}

[data-theme="light"] .elite-categorias-redesign .inner-card-redesign:nth-child(4) {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

[data-theme="light"] .elite-categorias-redesign .inner-card-redesign:nth-child(5) {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
}

[data-theme="light"] .elite-categorias-redesign .inner-card-redesign:nth-child(6) {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

[data-theme="light"] .elite-categorias-redesign .inner-card-redesign {
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .elite-categorias-redesign .inner-card-redesign:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ===================================
   ⚪ TEXTO BRANCO NO MODO CLARO
   Cards coloridos = Texto branco para contraste
=================================== */
[data-theme="light"] .inner-card-redesign * {
    color: white !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Garantir que ícones também sejam brancos */
[data-theme="light"] .inner-card-redesign i {
    color: white !important;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

/* ===================================
   📝 CARD CONTENT STYLES
=================================== */

.card-label-redesign {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.card-value-redesign {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.card-subtitle-redesign {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* ===================================
   🎯 TABS NAVIGATION - Redesigned
=================================== */

.tabs-container-redesign {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.tab-btn-redesign {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 14px;
    border: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
    backdrop-filter: blur(10px);
}

/* Insights Tabs */
.elite-insights-redesign .tab-btn-redesign {
    background: rgba(6, 182, 212, 0.1);
    color: rgba(6, 182, 212, 0.6);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.elite-insights-redesign .tab-btn-redesign.active {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
}

[data-theme="light"] .elite-insights-redesign .tab-btn-redesign.active {
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
}

/* ===================================
   🔘 ACTION BUTTON - Redesigned
=================================== */

.action-btn-redesign {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Resumo Analyze Button */
.elite-resumo-redesign .action-btn-redesign {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.elite-resumo-redesign .action-btn-redesign:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

[data-theme="light"] .elite-resumo-redesign .action-btn-redesign {
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

/* ===================================
   📐 LAYOUTS
=================================== */

/* Grid 2 colunas (Resumo) */
.grid-2-cols {
    grid-template-columns: repeat(2, 1fr);
}

/* Grid auto (Categorias) */
.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Card que ocupa todas as colunas (Total) */
.span-full {
    grid-column: 1 / -1;
}

/* ===================================
   📱 RESPONSIVE
=================================== */

@media (max-width: 768px) {
    .elite-section-container {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .section-icon-badge {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .section-title-redesign {
        font-size: 1.25rem;
    }

    .section-cards-grid.grid-2-cols {
        grid-template-columns: 1fr;
    }

    .card-value-redesign {
        font-size: 1.75rem;
    }

    .tabs-container-redesign {
        flex-direction: column;
    }
}

/* ===================================
   🎬 ANIMATIONS
=================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inner-card-redesign {
    animation: fadeInUp 0.6s cubic-bezier(0.28, 0.11, 0.32, 1) backwards;
}

.inner-card-redesign:nth-child(1) { animation-delay: 0.1s; }
.inner-card-redesign:nth-child(2) { animation-delay: 0.2s; }
.inner-card-redesign:nth-child(3) { animation-delay: 0.3s; }
.inner-card-redesign:nth-child(4) { animation-delay: 0.4s; }
.inner-card-redesign:nth-child(5) { animation-delay: 0.5s; }
.inner-card-redesign:nth-child(6) { animation-delay: 0.6s; }

/* ===================================
   💵 BALANCE INPUT SECTION
=================================== */

.balance-input-section {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.balance-input-label {
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--section-text-primary);
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.balance-input-group {
    display: flex;
    gap: 0.75rem;
}

.balance-input-field {
    flex: 1;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--section-text-primary);
    transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .balance-input-field {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.balance-input-field:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.balance-apply-btn {
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 14px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.balance-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.balance-apply-btn:active {
    transform: translateY(0);
}

/* ===================================
   💰 BALANCE CARDS - Cores Específicas (Light Mode)
=================================== */

/* Grid específico para balance (3 colunas) */
.balance-cards-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* USD Card - Green */
[data-theme="light"] .balance-card-usd {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 24px rgba(16, 185, 129, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .balance-card-usd:hover {
    box-shadow:
        0 12px 32px rgba(16, 185, 129, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* BRL Card - Blue */
[data-theme="light"] .balance-card-brl {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 24px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .balance-card-brl:hover {
    box-shadow:
        0 12px 32px rgba(59, 130, 246, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* BTC Card - Orange */
[data-theme="light"] .balance-card-btc {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 24px rgba(249, 115, 22, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .balance-card-btc:hover {
    box-shadow:
        0 12px 32px rgba(249, 115, 22, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Balance Icon Badge (wallet icon) */
.elite-balance-redesign .section-icon-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

[data-theme="light"] .elite-balance-redesign .section-icon-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(255, 255, 255, 0.8));
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

/* ===================================
   📱 BALANCE RESPONSIVE
=================================== */

@media (max-width: 768px) {
    .balance-cards-grid {
        grid-template-columns: 1fr;
    }

    .balance-input-group {
        flex-direction: column;
    }

    .balance-apply-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   ♿ ACCESSIBILITY
=================================== */

@media (prefers-reduced-motion: reduce) {
    .elite-section-container,
    .inner-card-redesign,
    .tab-btn-redesign,
    .action-btn-redesign,
    .section-blob {
        animation: none;
        transition: none;
    }
}
