/* Base Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --bg-dark: #0f111a;
    --panel-bg: rgba(25, 27, 42, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --accent: #00e5ff;
    --accent-hover: #00b3cc;
    --text-main: #f0f0f5;
    --text-muted: #9aa0a6;
    --safe: #00d084;
    --danger: #ff3366;
    --danger-hover: #cc0044;
    --glass-blur: blur(16px);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    background: radial-gradient(circle at top left, #1a1c29, #0f111a);
}

/* App Container */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    z-index: 10;
    overflow-y: auto;
}

.logo {
    margin-bottom: 2rem;
    text-align: center;
}

.logo h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo .accent {
    color: var(--accent);
}

.logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 2px;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-align: left;
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn .icon {
    font-size: 1.2rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(5px);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.15) 0%, transparent 100%);
    color: var(--accent);
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    overflow-y: auto;
}

.sim-section {
    display: none;
    padding: 4rem;
    animation: fadeIn 0.5s ease forwards;
}

.sim-section.active {
    display: block;
}

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

.sim-header {
    margin-bottom: 3rem;
}

.sim-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sim-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 800px;
    line-height: 1.6;
}

.text-accent {
    color: var(--accent);
}

/* Common Panels */
.sim-body {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

/* Módulo 1: Flujos */
.flow-types-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.flow-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--panel-border);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
}

.flow-visual {
    height: 100px;
    background: #1a1c29;
    border: 2px solid #3a3f58;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.f-bubble {
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    margin: 0 10px;
    animation: moveRight 3s linear infinite;
}

.f-slug-gas {
    width: 80px;
    height: 40px;
    background: rgba(255,255,255,0.8);
    border-radius: 20px;
    animation: moveRight 2s linear infinite;
}
.f-slug-liq {
    width: 40px;
    height: 60px;
    background: var(--accent);
    animation: moveRight 2s linear infinite;
}

.f-annular-core {
    width: 100%;
    height: 40px;
    background: rgba(255,255,255,0.8);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes moveRight {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

.flow-card h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.flow-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Módulo 2: Tecnologías */
.tech-card {
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
}

.tech-card h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.skidm-tech {
    background: rgba(0, 208, 132, 0.05);
    border-color: rgba(0, 208, 132, 0.3);
}

.skidm-tech h3 {
    color: var(--safe);
}

.rad-tech {
    background: rgba(255, 51, 102, 0.05);
    border-color: rgba(255, 51, 102, 0.3);
}

.rad-tech h3 {
    color: var(--danger);
}

.coriolis-anim {
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.u-tube {
    width: 60px;
    height: 100px;
    border: 10px solid var(--safe);
    border-top: none;
    border-radius: 0 0 50px 50px;
    animation: vibrate 0.1s linear infinite alternate;
}

@keyframes vibrate {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

.rad-anim {
    height: 150px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 2rem;
}

.gamma-ray {
    width: 80px;
    height: 5px;
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0% { opacity: 0.2; }
    100% { opacity: 1; }
}

.rad-source {
    font-size: 4rem;
}

.tech-features {
    list-style: none;
}

.tech-features li {
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 1.05rem;
}


/* Simulator 1: Manifold */
.manifold-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.pipe {
    background: #2a2d3e;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 1px;
    border: 1px solid #3a3f58;
}

.valves-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
    align-items: center;
}

.valve-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.valve-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 150px;
}

.valve-btn.open {
    background: var(--safe);
    color: #000;
}

.valve-btn.open:hover {
    background: #00e691;
    transform: scale(1.05);
}

.valve-btn.closed {
    background: var(--danger);
    color: #fff;
}

.valve-btn.closed:hover {
    background: var(--danger-hover);
    transform: scale(1.05);
}

.status-panel {
    text-align: center;
    padding: 2rem;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
}

.status-indicator {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.status-indicator.safe {
    color: var(--safe);
    border: 1px solid var(--safe);
    background: rgba(0, 208, 132, 0.1);
}

.status-indicator.warning {
    color: #fcb900;
    border: 1px solid #fcb900;
    background: rgba(252, 185, 0, 0.1);
}

.status-indicator.danger {
    color: var(--danger);
    border: 1px solid var(--danger);
    background: rgba(255, 51, 102, 0.1);
    animation: pulseBorder 1s infinite;
}

.warning-msg {
    color: var(--danger);
    margin-top: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.hidden {
    display: none !important;
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(255, 51, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); }
}

/* Simulator 2 & 3 Controls */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input[type="range"] {
    width: 100%;
    margin-right: 1rem;
    accent-color: var(--accent);
}

.input-group input[type="number"] {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #3a3f58;
    background: #1a1c29;
    color: #fff;
    font-size: 1.1rem;
}

.input-group span {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 700;
    color: var(--accent);
    font-size: 1.2rem;
}

.error-input {
    border-color: rgba(255, 51, 102, 0.3);
    background: rgba(255, 51, 102, 0.05);
}

.error-input span {
    color: var(--danger);
}

.display-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.result-box {
    background: #1a1c29;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #3a3f58;
}

.result-box.error-box {
    border-color: var(--danger);
}

.result-box h4 {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 400;
}

.bsw-value {
    font-size: 3.5rem;
    font-weight: 800;
}

.bsw-value.real {
    color: var(--safe);
}

.bsw-value.calc {
    color: var(--danger);
}

.delta-box {
    text-align: center;
    font-size: 1.2rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

#bsw-delta {
    color: var(--accent);
    font-size: 1.5rem;
}

/* Simulator 3: Gas Mass */
.mass-chart-panel {
    align-items: center;
}

.mass-chart {
    width: 100%;
    height: 60px;
    background: #1a1c29;
    border-radius: 30px;
    display: flex;
    overflow: hidden;
    border: 2px solid #3a3f58;
}

.mass-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    transition: width 0.3s ease;
}

.mass-bar.liq {
    background: linear-gradient(90deg, #00d084, #00e5ff);
}

.mass-bar.gas {
    background: var(--danger);
    color: #fff;
    min-width: 50px; /* To keep text visible */
}

.mass-details {
    margin-top: 2rem;
    width: 100%;
    background: rgba(0,0,0,0.2);
    padding: 2rem;
    border-radius: 16px;
}

.mass-details p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.mass-details span {
    font-weight: 700;
    color: var(--accent);
}

.conclusion {
    margin-top: 2rem !important;
    font-size: 1.1rem !important;
    color: var(--safe);
    border-left: 4px solid var(--safe);
    padding-left: 1rem;
}

/* Simulator 4: FT1/FT2 Selection */
.dual-panel {
    display: flex;
    gap: 3rem;
}

.physical-skid, .digital-hmi {
    flex: 1;
    background: rgba(0,0,0,0.2);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.physical-skid h3 {
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.pipe-lines {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1c29;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #3a3f58;
}

.line span {
    font-weight: 600;
    font-size: 1.2rem;
}

.hmi-screen {
    background: #111;
    border: 8px solid #333;
    border-radius: 12px;
    height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 20px rgba(0,0,0,1);
}

.hmi-header {
    background: #222;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #888;
    text-align: right;
    border-bottom: 1px solid #444;
}

.hmi-content {
    flex: 1;
    display: flex;
    padding: 1.5rem;
    gap: 1rem;
}

.hmi-selector {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-right: 1px solid #333;
    padding-right: 1rem;
}

.hmi-selector h4 {
    color: #fff;
    font-size: 0.9rem;
}

.hmi-btn {
    background: #333;
    color: #fff;
    border: 2px solid #555;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.hmi-btn:hover {
    background: #444;
}

.hmi-btn.active {
    background: var(--safe);
    color: #000;
    border-color: #00e691;
}

.hmi-readout {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.readout-box {
    text-align: center;
}

.readout-box span {
    color: #888;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.readout-box strong {
    font-size: 3rem;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(0,229,255,0.5);
    font-family: 'Courier New', Courier, monospace;
}

.match-status {
    margin-top: 1.5rem;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    background: rgba(255,255,255,0.05);
}

.match-status.success {
    background: rgba(0, 208, 132, 0.2);
    color: var(--safe);
}

.match-status.error {
    background: rgba(255, 51, 102, 0.2);
    color: var(--danger);
}

/* Modbus Diagnostics */
.troubleshoot-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.scenario-controls {
    display: flex;
    gap: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 12px;
    align-items: center;
}

.diagnostic-screen {
    background: #111;
    border: 4px solid #333;
    border-radius: 12px;
    padding: 2rem;
}

.diag-header {
    color: #888;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 2px;
}

.diag-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.diag-item {
    background: #222;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.diag-label {
    display: block;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.diag-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
}

.diag-value.safe { color: var(--safe); }
.diag-value.danger { color: var(--danger); animation: blink 1s infinite; }
.diag-value.warning { color: #fcb900; }

.diag-action-box {
    margin-top: 2rem;
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid var(--danger);
    padding: 1.5rem;
    border-radius: 8px;
}

/* Quiz Evaluation */
.quiz-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.quiz-question {
    background: rgba(0,0,0,0.2);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
}

.quiz-question h3 {
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-opt {
    background: #1a1c29;
    border: 1px solid #3a3f58;
    padding: 1rem;
    border-radius: 8px;
    color: var(--text-main);
    text-align: left;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-opt:hover {
    background: #2a2d3e;
}

.quiz-opt.correct {
    background: var(--safe);
    color: #000;
}

.quiz-opt.incorrect {
    background: var(--danger);
    color: #fff;
}

.mt-4 {
    margin-top: 2rem;
}

/* ==========================================================================
   GEO / AEO COMPONENTS (Generative & Answer Engine Optimization)
   ========================================================================== */

/* Direct Answer Callout for RAG Extraction */
.geo-callout {
    background: rgba(0, 229, 255, 0.08);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    border-radius: 0 10px 10px 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.geo-callout h4 {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.geo-callout p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #e2e8f0;
}

/* Factual Comparison Table for LLM Digest */
.geo-table-wrap {
    overflow-x: auto;
    margin-top: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.25);
}

.geo-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.geo-table th, 
.geo-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--panel-border);
}

.geo-table th {
    background: rgba(15, 17, 26, 0.9);
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.geo-table tr:last-child td {
    border-bottom: none;
}

.geo-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.geo-badge-win {
    color: var(--safe);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.geo-badge-lose {
    color: var(--danger);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* FAQ Cards Section for AEO */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.75rem;
    transition: all 0.25s ease;
}

.faq-card:hover {
    border-color: rgba(0, 229, 255, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.08);
}

.faq-card h3 {
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.faq-card p {
    color: #e2e8f0;
    line-height: 1.65;
    font-size: 0.95rem;
}

.faq-card .faq-meta {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Sidebar Corporate Badge & Provenance */
.sidebar-corp-badge {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.sidebar-corp-badge strong {
    color: var(--accent);
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.sidebar-corp-badge a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 600;
}

.sidebar-corp-badge a:hover {
    color: var(--accent);
}

/* Application Corporate Footer */
.app-footer {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.app-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.app-footer a:hover {
    text-decoration: underline;
}

.app-footer-links {
    display: flex;
    gap: 1.2rem;
}

