/* ================================================
   CURVAS DE NIVEL - ESTILOS FUTURISTAS ELEGANTES
   Elaborado por John Leonardo Cabrera Espíndola
   ================================================ */

:root {
    --primary: #00d4aa;
    --primary-dark: #00a88a;
    --secondary: #6366f1;
    --accent: #f472b6;
    --neon-blue: #00f5ff;
    --neon-purple: #bf5af2;
    --bg-dark: #0a0e1a;
    --bg-card: rgba(15, 23, 42, 0.85);
    --bg-glass: rgba(30, 41, 59, 0.6);
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --border-glow: rgba(0, 212, 170, 0.3);
    --gold: #fbbf24;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    
    --shadow-glow: 0 0 40px rgba(0, 212, 170, 0.15);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-elevated: 0 35px 60px -15px rgba(0, 0, 0, 0.6);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0, 212, 170, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 50%, rgba(244, 114, 182, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 170, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 170, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* Header */
header {
    text-align: center;
    padding: 4rem 2rem 3rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.2) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 212, 170, 0.3);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--neon-blue) 30%, var(--secondary) 60%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    letter-spacing: -1px;
    position: relative;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 6px;
    text-transform: uppercase;
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    flex-wrap: wrap;
}

nav button {
    padding: 1rem 2.5rem;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-lg);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

nav button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

nav button:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 212, 170, 0.25);
}

nav button:hover::before {
    opacity: 0.15;
}

nav button.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    box-shadow: 0 15px 40px rgba(0, 212, 170, 0.35);
}

nav button.active:hover {
    transform: translateY(-3px);
}

/* Main Content */
main {
    max-width: 1700px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    display: none;
    animation: fadeSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

section.active {
    display: block;
}

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

/* Glass Card Style */
.glass-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.glass-card:hover {
    border-color: rgba(0, 212, 170, 0.2);
    box-shadow: var(--shadow-elevated), var(--shadow-glow);
    transform: translateY(-2px);
}

/* Visualization Container */
.viz-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1100px) {
    .viz-container {
        grid-template-columns: 1fr;
    }
}

.viz-panel {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    transition: all 0.4s ease;
}

.viz-panel:hover {
    border-color: rgba(0, 212, 170, 0.2);
    box-shadow: var(--shadow-elevated), 0 0 60px rgba(0, 212, 170, 0.1);
}

.viz-panel h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.viz-panel h3 .icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Canvas Styles */
.canvas-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#canvas3d {
    width: 100%;
    height: 550px;
    border-radius: var(--radius-md);
    cursor: grab;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#canvas3d:active {
    cursor: grabbing;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 1.75rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
}

.control-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.control-group label span {
    color: var(--primary);
    font-weight: 600;
}

select {
    padding: 0.85rem 1.25rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 45px;
}

select:hover {
    border-color: var(--primary);
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

/* Info & Instructions Box */
.info-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(0, 212, 170, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-left: 4px solid var(--secondary);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-sm);
    margin: 1.25rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.instructions {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(0, 245, 255, 0.05));
    border: 1px dashed rgba(0, 212, 170, 0.4);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.instructions strong {
    color: var(--primary);
    font-weight: 600;
}

/* Profile Indicator */
.profile-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.line-sample {
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #ffa500);
    border-radius: 2px;
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-color {
    width: 24px;
    height: 6px;
    border-radius: 3px;
}

/* Statistics */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-item {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(99, 102, 241, 0.1));
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 212, 170, 0.3);
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 0.35rem;
}

/* 3D Container */
.viz-3d-container {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
}

.viz-3d-container h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theory Section */
.theory-content {
    max-width: 950px;
    margin: 0 auto;
}

.theory-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.theory-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary), var(--accent));
}

.theory-section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.theory-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--gold);
    margin: 2rem 0 1rem;
}

.theory-section p {
    line-height: 1.9;
    margin-bottom: 1.25rem;
    text-align: justify;
    color: var(--text-light);
}

.theory-section ul, .theory-section ol {
    margin: 1.25rem 0 1.25rem 1.5rem;
    line-height: 1.9;
}

.theory-section li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.theory-section li::marker {
    color: var(--primary);
}

/* Formula Box */
.formula {
    background: rgba(0, 0, 0, 0.4);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--gold);
    color: var(--neon-blue);
    overflow-x: auto;
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 1.75rem;
    border-radius: var(--radius-md);
    margin: 1.75rem 0;
}

.highlight-box h4 {
    color: var(--gold);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlight-box p {
    margin-bottom: 0;
}

.highlight-box table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
}

.highlight-box td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.highlight-box tr:last-child td {
    border-bottom: none;
}

/* Diagram */
.diagram {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.diagram svg {
    max-width: 100%;
    height: auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    margin-top: 4rem;
    position: relative;
    background: linear-gradient(0deg, rgba(0, 212, 170, 0.1) 0%, transparent 100%);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.author {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--gold), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.author-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 3rem 1.5rem 2rem;
    }
    
    main {
        padding: 1.5rem;
    }
    
    .controls {
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .control-group {
        min-width: 100%;
    }
    
    .theory-section {
        padding: 1.75rem;
    }
    
    nav button {
        padding: 0.85rem 1.75rem;
        font-size: 0.9rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--secondary));
}

/* Selection */
::selection {
    background: rgba(0, 212, 170, 0.3);
    color: var(--text-light);
}
