/* ============================================================================
   VARIABLES Y RESET
   ============================================================================ */
:root {
    --primary: #6a4cff;
    --primary-dark: #5a3cee;
    --secondary: #b5a8ff;
    --accent: #ff6b9d;
    --accent2: #4ce8b5;
    --accent3: #ffb74d;
    --dark: #0a0a14;
    --darker: #05050a;
    --dark-card: #111122;
    --light: #f0f0ff;
    --gray: #8899aa;
    --success: #4ce8b5;
    --warning: #ffb74d;
    --danger: #ff6b9d;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Crimson Text', 'Georgia', serif;
    background: 
        radial-gradient(circle at 20% 30%, rgba(106, 76, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 107, 157, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, var(--darker) 0%, var(--dark) 100%);
    color: var(--light);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.8;
    letter-spacing: 0.3px;
    overflow-x: hidden;
}

/* ============================================================================
   CONTAINER PRINCIPAL
   ============================================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(17, 17, 34, 0.92);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent2));
    z-index: 1;
}

/* ============================================================================
   HEADER
   ============================================================================ */
header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

header::after {
    content: '✦';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-card);
    padding: 0 20px;
    color: var(--primary);
    font-size: 24px;
}

h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--light) 0%, var(--secondary) 50%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    font-weight: 800;
    font-family: 'Playfair Display', serif;
    letter-spacing: 1px;
    text-shadow: 0 10px 30px rgba(106, 76, 255, 0.3);
}

.subtitle {
    color: var(--gray);
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto;
    font-style: italic;
    line-height: 1.6;
}

/* ============================================================================
   FORMULARIO
   ============================================================================ */
.form-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 50px;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 10px var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--secondary);
    font-weight: 600;
    font-size: 1.1rem;
    font-family: 'Playfair Display', serif;
}

.form-hint {
    display: block;
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 8px;
    font-style: italic;
}

input, select, textarea {
    width: 100%;
    padding: 18px 24px;
    background: rgba(10, 10, 20, 0.6);
    border: 2px solid rgba(107, 76, 255, 0.2);
    border-radius: 12px;
    color: var(--light);
    font-size: 1.1rem;
    transition: var(--transition);
    font-family: 'Crimson Text', serif;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 
        0 0 0 4px rgba(107, 76, 255, 0.15),
        0 10px 30px var(--shadow);
    background: rgba(10, 10, 20, 0.8);
}

/* ============================================================================
   OPCIONES DE ANÁLISIS
   ============================================================================ */
.form-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 30px 0;
    justify-content: center;
}

.option-btn {
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.option-btn:hover {
    background: rgba(107, 76, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.option-btn.active {
    background: rgba(107, 76, 255, 0.2);
    border-color: var(--primary);
    color: var(--secondary);
    box-shadow: 0 5px 20px rgba(107, 76, 255, 0.2);
}

.option-btn i {
    font-size: 1.2rem;
}

/* ============================================================================
   BOTÓN CALCULAR
   ============================================================================ */
.calculate-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 22px 50px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 40px auto;
    width: 100%;
    max-width: 400px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'Playfair Display', serif;
    position: relative;
    overflow: hidden;
}

.calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

.calculate-btn:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(107, 76, 255, 0.4),
        0 0 60px rgba(107, 76, 255, 0.2);
}

.calculate-btn:hover::before {
    left: 100%;
}

.calculate-btn i {
    font-size: 1.5rem;
}

.form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--gray);
    font-size: 0.9rem;
}

.form-footer i {
    color: var(--accent2);
    margin-right: 8px;
}

/* ============================================================================
   LOADING
   ============================================================================ */
.loading {
    text-align: center;
    padding: 60px;
    display: none;
}

.loading-content {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    position: relative;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.loading-spinner::before {
    width: 100%;
    height: 100%;
    border: 8px solid transparent;
    border-top: 8px solid var(--primary);
    border-right: 8px solid var(--primary);
}

.loading-spinner::after {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border: 6px solid transparent;
    border-bottom: 6px solid var(--accent);
    border-left: 6px solid var(--accent);
    animation-direction: reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading h3 {
    color: var(--secondary);
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
}

.loading p {
    color: var(--gray);
    margin-bottom: 30px;
}

.loading-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    animation: progress 2s infinite linear;
}

@keyframes progress {
    0% { width: 0%; margin-left: 0; }
    50% { width: 100%; margin-left: 0; }
    100% { width: 0%; margin-left: 100%; }
}

/* ============================================================================
   RESULTADOS
   ============================================================================ */
.result-container {
    margin-top: 50px;
    display: none;
    animation: slideUp 1s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(50px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.result-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(107, 76, 255, 0.1), rgba(76, 232, 181, 0.05));
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.result-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
}

.result-header h2 {
    font-size: 2.5rem;
    color: var(--light);
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
}

.result-header p {
    color: var(--gray);
    font-size: 1.2rem;
    margin: 5px 0;
}

/* ============================================================================
   GRID DE NÚMEROS PRINCIPALES
   ============================================================================ */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.number-card {
    background: linear-gradient(145deg, rgba(17, 17, 34, 0.8), rgba(10, 10, 20, 0.9));
    border-radius: 20px;
    padding: 35px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.number-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.number-card:hover {
    transform: translateY(-10px);
    border-color: rgba(107, 76, 255, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(107, 76, 255, 0.1);
}

.number-card:hover::before {
    transform: scaleX(1);
}

.number-value {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    text-shadow: 
        0 0 30px rgba(107, 76, 255, 0.5),
        0 0 60px rgba(107, 76, 255, 0.2);
    font-family: 'Playfair Display', serif;
    line-height: 1;
}

.number-title {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-bottom: 15px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    letter-spacing: 1px;
}

.number-desc {
    font-size: 1.05rem;
    color: #ccd6ff;
    line-height: 1.7;
}

/* ============================================================================
   ANÁLISIS DETALLADO
   ============================================================================ */
.detailed-analysis {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    padding: 50px;
    margin-top: 40px;
    border: 1px solid var(--border);
}

.analysis-section {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.analysis-section:nth-child(1) { animation-delay: 0.1s; }
.analysis-section:nth-child(2) { animation-delay: 0.2s; }
.analysis-section:nth-child(3) { animation-delay: 0.3s; }
.analysis-section:nth-child(4) { animation-delay: 0.4s; }
.analysis-section:nth-child(5) { animation-delay: 0.5s; }

.analysis-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.section-number {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Playfair Display', serif;
    flex-shrink: 0;
}

.section-title {
    font-size: 2.2rem;
    color: var(--light);
    font-family: 'Playfair Display', serif;
    line-height: 1.2;
}

.section-subtitle {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-top: 10px;
    font-style: italic;
}

.content-block {
    margin-bottom: 35px;
}

.content-title {
    color: var(--accent2);
    font-size: 1.4rem;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-title i {
    color: var(--primary);
    font-size: 1.2rem;
}

.content-text {
    font-size: 1.2rem;
    color: #e6e9ff;
    line-height: 1.9;
    margin-bottom: 25px;
    text-align: justify;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(107, 76, 255, 0.1), rgba(76, 232, 181, 0.05));
    border-left: 4px solid var(--accent2);
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
}

.highlight-text {
    font-size: 1.3rem;
    color: var(--light);
    font-style: italic;
    line-height: 1.8;
    quotes: "«" "»";
}

.highlight-text::before {
    content: open-quote;
    color: var(--accent2);
    font-size: 2rem;
    margin-right: 10px;
}

.highlight-text::after {
    content: close-quote;
    color: var(--accent2);
    font-size: 2rem;
    margin-left: 10px;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.insight-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.insight-card:hover {
    background: rgba(107, 76, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.insight-title {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.insight-title i {
    color: var(--accent);
}

.insight-content {
    color: #ccd6ff;
    line-height: 1.7;
}

/* ============================================================================
   ANÁLISIS DEL AÑO
   ============================================================================ */
.year-analysis {
    background: linear-gradient(135deg, rgba(107, 76, 255, 0.15), rgba(255, 107, 157, 0.1));
    border-radius: 20px;
    padding: 40px;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}

.year-analysis::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(107, 76, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 157, 0.15) 0%, transparent 50%);
    z-index: 0;
}

.year-analysis > * {
    position: relative;
    z-index: 1;
}

.year-number {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 
        0 0 40px rgba(107, 76, 255, 0.5),
        0 0 80px rgba(107, 76, 255, 0.2);
    text-align: center;
    margin-bottom: 30px;
    font-family: 'Playfair Display', serif;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
footer {
    text-align: center;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    color: var(--gray);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.disclaimer {
    background: rgba(0, 0, 0, 0.2);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.disclaimer p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.disclaimer i {
    color: var(--warning);
    margin-right: 10px;
}

.quote {
    font-style: italic;
    color: var(--secondary);
    font-size: 1.1rem;
    margin-top: 20px;
    border-left: 3px solid var(--primary);
    padding-left: 20px;
}

.social-section {
    margin: 40px 0;
}

.social-section h4 {
    color: var(--secondary);
    margin-bottom: 25px;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-decoration: none;
    color: var(--light);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border);
    min-width: 180px;
    justify-content: center;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.social-link.facebook:hover {
    background: rgba(59, 89, 152, 0.2);
    border-color: #3b5998;
}

.social-link.youtube:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
}

.social-link.instagram:hover {
    background: rgba(225, 48, 108, 0.2);
    border-color: #e1306c;
}

.social-link i {
    font-size: 1.2rem;
}

.visit-counter {
    margin: 40px 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(107, 76, 255, 0.1), transparent);
    border-radius: 15px;
    border: 1px solid var(--border);
}

.counter-box {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 30px;
    border-radius: 50px;
    margin-bottom: 15px;
}

.counter-box i {
    color: var(--accent);
    font-size: 1.5rem;
}

.counter-box span {
    font-size: 1.2rem;
}

#visitCount {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
}

.counter-sub {
    font-style: italic;
    color: var(--gray);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.footer-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--gray);
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
}

.footer-btn:hover {
    background: rgba(107, 76, 255, 0.2);
    border-color: var(--primary);
    color: var(--secondary);
    transform: translateY(-3px);
}

.footer-btn i {
    font-size: 1.1rem;
}

.copyright {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--gray);
}

.tech-info {
    font-size: 0.8rem;
    margin-top: 10px;
    opacity: 0.7;
}

/* ============================================================================
   BOTÓN IMPRIMIR FLOTANTE
   ============================================================================ */
.print-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(107, 76, 255, 0.3);
    transition: var(--transition);
    z-index: 100;
    border: none;
    font-size: 1.5rem;
}

.print-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(107, 76, 255, 0.4);
}

/* ============================================================================
   MEDIA QUERIES
   ============================================================================ */
@media (max-width: 1024px) {
    .container {
        padding: 30px;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .form-container {
        padding: 25px;
    }
    
    .detailed-analysis {
        padding: 25px;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .number-value {
        font-size: 3.5rem;
    }
    
    .year-number {
        font-size: 4rem;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-link {
        width: 100%;
        max-width: 300px;
    }
    
    .option-btn {
        min-width: 100%;
    }
    
    .print-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .calculate-btn {
        padding: 18px 30px;
        font-size: 1rem;
    }
    
    .number-value {
        font-size: 3rem;
    }
}

/* ============================================================================
   ESTILOS PARA IMPRESIÓN
   ============================================================================ */
@media print {
    .print-btn, 
    .calculate-btn,
    .form-container,
    .footer-btn,
    .social-links,
    .visit-counter {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    body {
        background: white !important;
        color: black !important;
        padding: 0;
    }
    
    .number-value {
        color: black !important;
        text-shadow: none !important;
    }
    
    .result-header {
        background: none !important;
        border: 1px solid #ccc;
    }
    
    .highlight-box {
        background: #f5f5f5 !important;
        border-left: 4px solid #333;
    }
    
    a {
        color: black !important;
        text-decoration: none;
    }
    
    .year-analysis {
        background: #f9f9f9 !important;
        border: 1px solid #ddd;
    }
}