/* SIMULADORES DE FÍSICA - DINÁMICA 2026 - Styles */

:root {
    /* Color Palette - Deep Dark & Educational Accents */
    --bg-main: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: #1e293b;
    --bg-header: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #38bdf8;   /* Normal */
    --accent-red: #ff4d6d;    /* Peso / Paralela */
    --accent-green: #4ade80;  /* Resultantes */
    --accent-amber: #fbbf24;  /* Rozamiento */
    --accent-purple: #a78bfa; /* Perpendicular */
    --accent-orange: #fb923c; /* Fnet */
    --accent-primary: #6366f1; /* Brand */
    
    --border-color: #334155;
    --border-hover: #475569;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.3);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Utilities */
.hidden { display: none !important; }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.accent { color: var(--accent-primary); font-weight: 700; }

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9375rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link.active {
    position: relative;
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero-section {
    padding: 4rem 2rem 3rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.hero-section .origin-note {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.simulator-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.simulator-card.próximamente {
    cursor: default;
    opacity: 0.8;
}

.card-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-available { background: rgba(74, 222, 128, 0.1); color: var(--accent-green); border: 1px solid rgba(74, 222, 128, 0.2); }
.status-soon { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid rgba(148, 163, 184, 0.2); }

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.plano-icon::before { content: '📐'; font-size: 1.5rem; }
.resorte-icon::before { content: '🌀'; font-size: 1.5rem; }
.pendulo-icon::before { content: '⏳'; font-size: 1.5rem; }
.poleas-icon::before { content: '⚙️'; font-size: 1.5rem; }

.simulator-card h3 { font-size: 1.25rem; }
.simulator-card p { color: var(--text-secondary); font-size: 0.9375rem; flex-grow: 1; }
.card-action { color: var(--accent-primary); font-weight: 600; font-size: 0.875rem; }

/* Simulator Layout */
.app-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeIn 0.4s ease;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.simulator-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Controls Panel */
.controls-panel h3 { margin-bottom: 1.5rem; font-size: 1.1rem; color: var(--text-primary); border-left: 3px solid var(--accent-primary); padding-left: 0.75rem; }

.control-group { margin-bottom: 1.5rem; }
.label-row { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; }
.unit { color: var(--text-muted); font-size: 0.75rem; }

.enhanced-input-row { display: flex; gap: 0.75rem; align-items: center; }
.stepper-controls { display: flex; flex-direction: column; gap: 2px; }
.step-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0 0.5rem;
    font-size: 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }

input[type="range"] {
    flex-grow: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-main);
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

input[type="number"] {
    width: 70px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    text-align: center;
}

.speed-selector {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.divider { border: 0; border-top: 1px solid var(--border-color); margin: 1.5rem 0; }

/* Visualization Panel */
.visualization-panel { display: flex; flex-direction: column; gap: 2rem; }

.diagram-card { padding: 1.5rem; position: relative; }
.diagram-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.badge { 
    padding: 0.4rem 1rem; 
    border-radius: 6px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
}
.badge.equilibrium { 
    background: rgba(16, 185, 129, 0.15); 
    color: #10b981; 
    border: 1px solid rgba(16, 185, 129, 0.3); 
}
.badge.sliding { 
    background: rgba(245, 158, 11, 0.15); 
    color: #f59e0b; 
    border: 1px solid rgba(245, 158, 11, 0.3); 
}

.diagram-container {
    width: 100%;
    height: 400px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.canvas-container {
    position: relative;
    overflow: hidden;
}

.graph-card {
    position: relative;
}

.graph-container {
    position: relative;
    overflow: hidden;
}

.watermark {
    position: absolute;
    right: 1.25rem;
    bottom: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.35;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
    letter-spacing: 0.05em;
    font-family: 'Inter', sans-serif;
}

.graph-card .watermark,
.graph-container .watermark {
    display: none !important;
}

.diagram-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.legend-item { 
    display: flex; 
    align-items: center; 
    gap: 0.65rem; 
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dot { 
    width: 12px; 
    height: 12px; 
    border-radius: 3px; 
    box-shadow: 0 0 8px rgba(255,255,255,0.1);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
}

@media (min-width: 1200px) {
    .results-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

.result-item {
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 95px;
    min-height: 95px;
    overflow: hidden;
}

.res-label { 
    font-size: 0.62rem; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    margin-bottom: 0.4rem; 
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 4px;
}
.res-value { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.res-unit { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }

.highlight-amber { border-left: 3px solid var(--accent-amber); background: rgba(251, 191, 36, 0.03); }
.highlight-amber .res-value { color: var(--accent-amber); }

.highlight-blue { border-left: 3px solid var(--accent-blue); background: rgba(56, 189, 248, 0.03); }
.highlight-blue .res-value { color: var(--accent-blue); }

.highlight-primary { border-left: 3px solid var(--accent-primary); background: rgba(99, 102, 241, 0.03); }

/* Math and Interpretation */
.math-steps {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    line-height: 1.6;
}

.math-formula { 
    color: var(--accent-blue); 
    font-weight: 600; 
    margin-bottom: 0.35rem; 
    display: inline-block;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.math-steps strong {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.interpretation-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Table */
.table-container { margin-top: 2rem; }
.table-container h3 { margin-bottom: 1.5rem; }
.table-scroll { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { background: var(--bg-main); color: var(--text-muted); text-align: left; padding: 0.75rem 1rem; font-weight: 600; border-bottom: 1px solid var(--border-color); }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); color: var(--text-primary); }

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.875rem;
}

.btn-primary { background: var(--accent-primary); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }

.btn-secondary { background: var(--bg-main); border-color: var(--border-color); color: var(--text-secondary); }
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text-primary); }

/* Footer */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem;
    background: var(--bg-surface);
    margin-top: 4rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-info a { color: var(--text-secondary); text-decoration: none; }
.footer-info a:hover { color: var(--text-primary); }
.footer-tag { font-weight: 700; color: var(--text-secondary); }

/* Responsive */
@media (max-width: 1024px) {
    .simulator-layout { grid-template-columns: 1fr; }
    .hero-section h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-menu.open { display: flex; }
    .nav-toggle { display: block; }
    .hero-section { padding: 2rem 1rem; }
    .projectile-info-row { grid-template-columns: 1fr; }
    .about-card { grid-template-columns: 1fr; }
    .logo-placeholder { display: none; }
}
