/* ===== VARIABLES BÁSICAS CERTUAP ===== */
:root {
    --color-primary: #0E2954;
    --color-secondary: #1A5F7A;
    --color-accent: #57C5B6;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-orange: #ff6b35;
    --navbar-dark: #151a22;
    --navbar-secondary: #2c3e50;
}

/* ===== BASE ===== */
body { 
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding-top: 70px;
    line-height: 1.6;
}

/* ===== NAVBAR SIMPLE ===== */
.navbar { 
    background: linear-gradient(135deg, var(--navbar-dark) 0%, var(--navbar-secondary) 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.navbar-brand img {
    height: 45px;
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-auth {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-auth:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

.btn-plans {
    background: linear-gradient(135deg, var(--color-warning) 0%, #fbbf24 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-plans:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 15px;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* ===== DASHBOARD ===== */
.dashboard-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(87, 197, 182, 0.2);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}

.credits-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f5f9 100%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    margin-bottom: 2rem;
}

.credits-status.exhausted {
    border-color: var(--color-danger);
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.credits-status.low {
    border-color: var(--color-warning);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.credits-status.guest {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.credits-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.credits-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.credits-status.guest .credits-icon {
    background: linear-gradient(135deg, var(--color-accent) 0%, #16a34a 100%);
}

.credits-text h4 {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
}

.credits-count {
    font-size: 1.25rem;
    font-weight: 600;
    color: #475569;
}

.plan-badge {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6366f1 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge.guest {
    background: linear-gradient(135deg, var(--color-accent) 0%, #16a34a 100%);
}

.plan-badge.pro {
    background: linear-gradient(135deg, var(--color-success) 0%, #16a34a 100%);
}

.plan-badge.enterprise {
    background: linear-gradient(135deg, var(--color-warning) 0%, #ea580c 100%);
}

/* ===== TARJETA DE PROCESAMIENTO ===== */
.processing-card { 
    background: #ffffff;
    border-radius: 20px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 3rem; 
    margin: 2rem auto;
    max-width: 900px;
    border: 1px solid rgba(87, 197, 182, 0.2);
    transition: all 0.3s ease;
}

.processing-card:hover {
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

/* ===== ZONA DE SUBIDA ===== */
.upload-zone { 
    border: 3px dashed var(--color-accent);
    border-radius: 16px; 
    padding: 3rem; 
    background: linear-gradient(135deg, #fafcff 0%, #f0f8ff 100%);
    text-align: center; 
    transition: all 0.3s ease; 
    cursor: pointer; 
}

.upload-zone:hover, .upload-zone.dragover { 
    border-color: #00bfae; 
    background: linear-gradient(135deg, #e7f9f7 0%, #e0f7fa 100%);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(87, 197, 182, 0.2);
}

.upload-icon { 
    font-size: 4rem; 
    color: var(--color-accent);
    margin-bottom: 1rem; 
    transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon {
    transform: scale(1.1);
    color: #00bfae;
}

/* ===== INFORMACIÓN DE ARCHIVO ===== */
.file-info { 
    display: none; 
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e8 100%);
    border-radius: 12px; 
    padding: 1.5rem; 
    margin: 1.5rem 0; 
    border-left: 4px solid var(--color-success);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== BOTÓN PROCESAR ===== */
.btn-process {
    background: linear-gradient(135deg, var(--color-accent) 0%, #4db8a8 100%);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 15px 40px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(87, 197, 182, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-process::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.btn-process:hover::before {
    left: 100%;
}

.btn-process:hover {
    background: linear-gradient(135deg, #009688 0%, #4db8a8 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(87, 197, 182, 0.4);
    color: white;
}

.btn-process:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ===== LOADING ===== */
.loading { 
    text-align: center; 
    padding: 3rem;
    display: none;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 600px;
}

.spinner-border {
    width: 4rem;
    height: 4rem;
    border-width: 0.4em;
    color: var(--color-accent);
}

/* ===== RESULTADOS ===== */
.summary-result { 
    display: none; 
    background: #ffffff;
    border-radius: 20px; 
    padding: 3rem; 
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin: 3rem auto; 
    max-width: 1200px;
    border: 1px solid rgba(87, 197, 182, 0.2);
}

.summary-section { 
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px; 
    padding: 2rem; 
    margin-bottom: 2rem;
    border-left: 4px solid var(--color-accent);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.summary-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.summary-section h5 {
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== PDF VIEWER ===== */
.pdf-viewer-container { 
    background: #ffffff;
    border-radius: 16px; 
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    height: 100%;
    border: 1px solid rgba(87, 197, 182, 0.2);
}

.pdf-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1rem; 
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.pdf-header h5 {
    margin: 0;
    color: var(--color-primary);
    font-weight: 600;
}

/* ===== CHAT ===== */
.chat-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(87, 197, 182, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chat-counter {
    background: linear-gradient(135deg, var(--color-warning) 0%, #ffb74d 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.chat-box { 
    background: #ffffff;
    border-radius: 12px; 
    padding: 1.5rem; 
    height: 300px; 
    overflow-y: auto; 
    margin-bottom: 1rem; 
    border: 2px solid #e9ecef;
    scroll-behavior: smooth;
}

.chat-msg {
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-user { 
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: var(--color-primary);
    border-radius: 18px 18px 5px 18px; 
    padding: 12px 18px; 
    margin-left: auto; 
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(14, 41, 84, 0.1);
}

.chat-msg-bot { 
    background: linear-gradient(135deg, #f1f8e9 0%, #dcedc8 100%);
    color: #2e7d32;
    border-radius: 18px 18px 18px 5px; 
    padding: 12px 18px; 
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
}

/* ===== CONTROLES DE FORMULARIO ===== */
.form-control {
    border-radius: 25px;
    border: 2px solid #e9ecef;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 0.2rem rgba(87, 197, 182, 0.25);
}

.btn-chat {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-accent) 0%, #4db8a8 100%);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(87, 197, 182, 0.3);
}

.btn-chat:hover {
    background: linear-gradient(135deg, #009688 0%, #4db8a8 100%);
    transform: scale(1.05);
    color: white;
}

/* ===== ALERTAS ===== */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: var(--color-danger);
    border-left: 4px solid var(--color-danger);
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border-left: 4px solid var(--color-success);
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border-left: 4px solid var(--color-warning);
}

/* ===== MODALES ===== */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    padding: 2rem;
}

.btn-modal-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-modal-primary:hover {
    color: white;
    transform: translateY(-2px);
}

.btn-modal-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-modal-success:hover {
    color: white;
    transform: translateY(-2px);
}
/* ===== SOLUCIÓN DIRECTA PARA MOSTRAR EL TÍTULO ===== */
@media (max-width: 768px) {
    body {
        padding-top: 0px !important; /* SIN padding-top */
    }
    
    .navbar {
        position: relative !important; /* NO fixed */
        padding: 5px 0 !important;
        margin-bottom: 0 !important;
    }
    
    .navbar .container {
        padding: 5px 10px !important;
        gap: 5px !important;
    }
    
    .navbar-brand img {
        height: 25px !important;
    }
    
    .btn-auth {
        padding: 3px 8px !important;
        font-size: 0.7rem !important;
    }
    
    .hero-section {
        padding: 1rem 0 !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-content h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
}
/* ===== NAVBAR FIJO CON TÍTULO VISIBLE ===== */
@media (max-width: 768px) {
    body {
        padding-top: 55px !important; /* Espacio justo para navbar compacto */
    }
    
    .navbar {
        position: fixed !important; /* MANTENER fijo */
        top: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        padding: 3px 0 !important; /* Navbar MUY compacto */
        min-height: 50px !important;
    }
    
    .navbar .container {
        padding: 5px 10px !important;
        gap: 5px !important;
        flex-direction: row !important; /* Horizontal en una línea */
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .navbar-brand img {
        height: 30px !important;
    }
    
    .header-actions {
        gap: 5px !important;
        flex-wrap: nowrap !important;
    }
    
    .auth-buttons {
        gap: 3px !important;
    }
    
    .btn-auth {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
        border-radius: 12px !important;
    }
    
    /* HERO SECTION VISIBLE */
    .hero-section {
        padding: 1rem 0 !important; /* Compacto pero visible */
        margin-bottom: 1rem !important;
        margin-top: 0 !important;
    }
    
    .hero-content {
        padding: 0 1rem !important;
    }
    
    .hero-content h1 {
        font-size: 1.4rem !important; /* Tamaño que se vea */
        margin-bottom: 0.5rem !important;
        line-height: 1.2 !important;
    }
    
    .hero-content p {
        font-size: 0.9rem !important;
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 50px !important;
    }
    
    .navbar {
        min-height: 45px !important;
        padding: 2px 0 !important;
    }
    
    .navbar .container {
        padding: 3px 8px !important;
    }
    
    .navbar-brand img {
        height: 25px !important;
    }
    
    .btn-auth {
        padding: 3px 6px !important;
        font-size: 0.65rem !important;
    }
    
    .hero-content h1 {
        font-size: 1.2rem !important;
    }
    
    .hero-content p {
        font-size: 0.8rem !important;
    }
}
