/* ============================================
   CALCULADORA DE FINANCIAMENTO IMOBILIÁRIO
   Tema: Azul Imobiliário (#3498db)
   Design: Glassmorphism + Vapor Theme
   ============================================ */

:root {
    --color-primary: #3498db;
    --color-primary-dark: #2980b9;
    --color-primary-light: #5dade2;
    --color-secondary: #1abc9c;
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #3498db;
    
    --glass-bg: rgba(52, 152, 219, 0.05);
    --glass-border: rgba(52, 152, 219, 0.15);
    --glass-shadow: 0 8px 32px rgba(52, 152, 219, 0.15);
    
    --gradient-primary: linear-gradient(135deg, rgba(52, 152, 219, 0.9) 0%, rgba(41, 128, 185, 0.8) 100%);
    --gradient-card: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(142, 68, 173, 0.06) 100%);
}

/* ============================================
   ÍCONE DA CALCULADORA
   ============================================ */
.calculator-icon {
    font-size: 5rem;
    color: var(--color-primary);
    text-shadow: 0 0 30px rgba(52, 152, 219, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   GLASS EFFECT CARDS
   ============================================ */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.glass-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(52, 152, 219, 0.25);
    border-color: rgba(52, 152, 219, 0.3);
}

/* ============================================
   FORMULÁRIO
   ============================================ */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    color: #fff;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
    color: #fff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-group-text {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.2);
    color: var(--color-primary-light);
}

.form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* ============================================
   BOTÕES PERSONALIZADOS
   ============================================ */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline-primary:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.btn-check:checked + .btn-outline-primary {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* ============================================
   CARDS DE RESUMO
   ============================================ */
.summary-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
}

.summary-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.summary-card-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.summary-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.summary-card-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Cores específicas por tipo */
.summary-card.price {
    border-left: 4px solid var(--color-primary);
}

.summary-card.sac {
    border-left: 4px solid var(--color-secondary);
}

.summary-card.warning {
    border-left: 4px solid var(--color-warning);
}

.summary-card.success {
    border-left: 4px solid var(--color-success);
}

/* ============================================
   TABS PERSONALIZADAS
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid rgba(52, 152, 219, 0.2);
}

.nav-tabs .nav-link {
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tabs .nav-link:hover {
    color: var(--color-primary-light);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--color-primary);
    border-color: transparent;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

/* ============================================
   TABELA DE AMORTIZAÇÃO
   ============================================ */
.table {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

.table thead th {
    background: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.2);
    color: var(--color-primary-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody td {
    border-color: rgba(52, 152, 219, 0.1);
    padding: 0.75rem 1rem;
}

.table tbody tr:hover {
    background: rgba(52, 152, 219, 0.08);
}

.table tbody tr:nth-child(odd) {
    background: rgba(52, 152, 219, 0.03);
}

/* Destaque para anos completos */
.table tbody tr.year-row {
    background: rgba(52, 152, 219, 0.12);
    font-weight: 600;
}

.table tbody tr.year-row td {
    border-top: 2px solid rgba(52, 152, 219, 0.3);
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
}

/* ============================================
   TABELA RESPONSIVA
   ============================================ */
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
}

.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.4);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.6);
}

/* ============================================
   GRÁFICOS
   ============================================ */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* ============================================
   COMPARAÇÃO PRICE VS SAC
   ============================================ */
.comparison-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comparison-card {
    background: var(--gradient-card);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.comparison-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.comparison-card.recommended {
    border-color: var(--color-success);
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.3);
}

.comparison-card.recommended::before {
    background: linear-gradient(90deg, var(--color-success), var(--color-secondary));
}

.comparison-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-success);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.comparison-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #fff;
}

.comparison-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(52, 152, 219, 0.1);
}

.comparison-detail:last-child {
    border-bottom: none;
}

.comparison-detail-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.comparison-detail-value {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.comparison-detail-value.highlight {
    color: var(--color-primary-light);
    font-size: 1.25rem;
}

/* ============================================
   ANIMAÇÕES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .calculator-icon {
        font-size: 3.5rem;
    }
    
    .summary-card-value {
        font-size: 1.5rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }
    
    .comparison-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 0.5rem;
    }
    
    .summary-card {
        margin-bottom: 1rem;
    }
}

/* ============================================
   IMPRESSÃO
   ============================================ */
@media print {
    .navbar,
    .footer,
    .bg-shapes,
    .btn,
    .adsbygoogle {
        display: none !important;
    }
    
    .glass-effect {
        background: #fff;
        border: 1px solid #000;
    }
    
    .table {
        color: #000;
    }
    
    body {
        background: #fff;
        color: #000;
    }
}

/* ============================================
   BACKGROUND SHAPES (DECORATIVO)
   ============================================ */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--color-primary);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--color-secondary);
    bottom: 20%;
    right: 15%;
    animation-delay: 5s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--color-primary-dark);
    top: 60%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .chart-container {
        max-width: 100%;
        overflow-x: hidden;
        padding: 0.5rem;
    }
    
    /* Responsive tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 100%;
        font-size: 0.875rem;
    }
    
    /* Full width inputs and buttons */
    .form-control,
    .form-select,
    .btn {
        width: 100% !important;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Adjust text sizes */
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Card padding */
    .card-body {
        padding: 1rem !important;
    }
}
