/* ============================================
   GUÍA TEÓRICA - BiteCraft Kids
   Estilos compartidos para todas las páginas
   ============================================ */

:root {
    --primary: #a525a5;
    --primary-light: #d946ef;
    --primary-dark: #7c1d7c;
    --secondary: #06b6d4;
    --accent: #22d3ee;
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --gradient-primary: linear-gradient(135deg, #a525a5 0%, #06b6d4 100%);
    --gradient-hover: linear-gradient(135deg, #d946ef 0%, #22d3ee 100%);
    --glow-primary: 0 0 20px rgba(165, 37, 165, 0.5);
    --glow-secondary: 0 0 20px rgba(6, 182, 212, 0.5);
    --warning: #f59e0b;
    --danger: #ef4444;
    --success: #22c55e;
    --info: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.7;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ===== ANIMACIONES ===== */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: var(--glow-primary); }
    50% { box-shadow: 0 0 40px rgba(165, 37, 165, 0.8); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes particle-float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

@keyframes glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 5px currentColor); }
    50% { filter: drop-shadow(0 0 20px currentColor); }
}

@keyframes circuit-flow {
    0% { stroke-dashoffset: 20; }
    100% { stroke-dashoffset: 0; }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PARTÍCULAS ===== */
.particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--primary);
    border-radius: 50%;
    animation: particle-float 15s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; background: var(--secondary); }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; background: var(--secondary); }
.particle:nth-child(5) { left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { left: 60%; animation-delay: 10s; background: var(--secondary); }
.particle:nth-child(7) { left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { left: 80%; animation-delay: 14s; background: var(--secondary); }

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(165, 37, 165, 0.2);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.5rem 2rem;
    background: rgba(10, 10, 15, 0.95);
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo span {
    -webkit-text-fill-color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    border: 1px solid rgba(165, 37, 165, 0.3);
    background: transparent;
}

.nav-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: rgba(165, 37, 165, 0.15);
}

.nav-btn.active-link {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--text-primary);
}

/* ===== CONTENIDO PRINCIPAL ===== */
.page-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    padding: 7rem 2rem 4rem;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    animation: fadeIn 0.6s ease;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--primary-light);
}

.breadcrumb .separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

.breadcrumb .current {
    color: var(--primary-light);
    font-weight: 600;
}

/* ===== HERO DEL TEMA ===== */
.topic-hero {
    text-align: center;
    padding: 3rem 0 4rem;
    animation: slideInUp 0.8s ease;
}

.topic-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(165, 37, 165, 0.15);
    border: 2px solid rgba(165, 37, 165, 0.3);
    border-radius: 30px;
    font-size: 3rem;
    animation: float 3s ease infinite;
}

.topic-hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.topic-hero h1 .gradient-text {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

.topic-hero .topic-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SECCIONES DE CONTENIDO ===== */
.content-section {
    margin-bottom: 3rem;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(165, 37, 165, 0.15);
    border-radius: 24px;
    transition: border-color 0.3s;
}

.content-section:hover {
    border-color: rgba(165, 37, 165, 0.35);
}

.content-section h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-section h2 i {
    color: var(--primary-light);
    font-size: 1.3rem;
}

.content-section h2 .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.content-section h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin: 1.5rem 0 0.75rem;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.8;
}

.content-section strong {
    color: var(--text-primary);
}

.content-section ul, .content-section ol {
    color: var(--text-secondary);
    margin: 0.75rem 0 1rem 1.5rem;
    line-height: 2;
}

.content-section li {
    margin-bottom: 0.25rem;
}

.content-section li strong {
    color: var(--primary-light);
}

/* ===== SVG DIAGRAMA CONTAINER ===== */
.diagram-container {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(165, 37, 165, 0.2);
    border-radius: 16px;
    text-align: center;
    overflow-x: auto;
}

.diagram-container svg {
    max-width: 100%;
    height: auto;
}

.diagram-caption {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== CAJAS DE ALERTA ===== */
.alert-box {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    margin: 1.5rem 0;
    align-items: flex-start;
}

.alert-box .alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-box .alert-content {
    flex: 1;
}

.alert-box .alert-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.alert-box .alert-text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-warning .alert-icon,
.alert-warning .alert-title {
    color: var(--warning);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-danger .alert-icon,
.alert-danger .alert-title {
    color: var(--danger);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-success .alert-icon,
.alert-success .alert-title {
    color: var(--success);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-info .alert-icon,
.alert-info .alert-title {
    color: var(--info);
}

/* ===== TARJETAS DE DATO RÁPIDO ===== */
.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.fact-card {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(165, 37, 165, 0.2);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.fact-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.fact-card .fact-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.fact-card .fact-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.fact-card .fact-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== TABLA ESTILIZADA ===== */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
}

.styled-table thead {
    background: var(--gradient-primary);
}

.styled-table th {
    padding: 1rem;
    text-align: left;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.styled-table td {
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(165, 37, 165, 0.1);
    font-size: 0.95rem;
}

.styled-table tbody tr {
    transition: background 0.3s;
}

.styled-table tbody tr:hover {
    background: rgba(165, 37, 165, 0.08);
}

.styled-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== PASOS / INSTRUCCIONES ===== */
.steps-list {
    list-style: none;
    margin: 1.5rem 0;
    padding: 0;
    counter-reset: step-counter;
}

.steps-list li {
    counter-increment: step-counter;
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border-left: 3px solid var(--primary);
    align-items: flex-start;
    transition: all 0.3s;
}

.steps-list li:hover {
    background: rgba(165, 37, 165, 0.08);
    border-left-color: var(--primary-light);
}

.steps-list li::before {
    content: counter(step-counter);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.step-content span {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== NAVEGACIÓN ENTRE TEMAS ===== */
.topic-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(165, 37, 165, 0.2);
}

.topic-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(165, 37, 165, 0.2);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.3s ease;
    max-width: 45%;
}

.topic-nav a:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: rgba(165, 37, 165, 0.1);
    transform: translateY(-3px);
}

.topic-nav a i {
    color: var(--primary-light);
    font-size: 1.2rem;
}

.topic-nav .prev-topic {
    margin-right: auto;
}

.topic-nav .next-topic {
    margin-left: auto;
    text-align: right;
}

.topic-nav .nav-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.topic-nav .nav-title {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: inherit;
}

/* ===== FOOTER ===== */
.footer {
    padding: 3rem 2rem;
    background: rgba(10, 10, 15, 0.95);
    border-top: 1px solid rgba(165, 37, 165, 0.2);
    text-align: center;
    position: relative;
    z-index: 2;
}

.footer-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-text a {
    color: var(--primary-light);
    text-decoration: none;
}

/* ===== COMPONENTE INTERACTIVO ===== */
.interactive-demo {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(6, 182, 212, 0.4);
    border-radius: 16px;
    text-align: center;
}

.interactive-demo h4 {
    font-family: 'Rajdhani', sans-serif;
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ===== LED Demo ===== */
.led-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.led-bulb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: all 0.5s ease;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.led-bulb.red { background: #331111; }
.led-bulb.green { background: #113311; }
.led-bulb.blue { background: #111133; }
.led-bulb.yellow { background: #333311; }

.led-bulb.red.on { background: #ff3333; box-shadow: 0 0 30px #ff3333, 0 0 60px #ff333388; border-color: #ff6666; }
.led-bulb.green.on { background: #33ff33; box-shadow: 0 0 30px #33ff33, 0 0 60px #33ff3388; border-color: #66ff66; }
.led-bulb.blue.on { background: #3366ff; box-shadow: 0 0 30px #3366ff, 0 0 60px #3366ff88; border-color: #6699ff; }
.led-bulb.yellow.on { background: #ffcc00; box-shadow: 0 0 30px #ffcc00, 0 0 60px #ffcc0088; border-color: #ffdd44; }

.led-label {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== QUIZ / PREGUNTAS ===== */
.quiz-box {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 16px;
}

.quiz-box h4 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-question {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-option {
    padding: 0.8rem 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.quiz-option:hover {
    border-color: var(--secondary);
    background: rgba(6, 182, 212, 0.1);
    color: var(--text-primary);
}

.quiz-option.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.correct-feedback {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.quiz-feedback.incorrect-feedback {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .page-content {
        padding: 6rem 1rem 3rem;
    }

    .content-section {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .topic-nav {
        flex-direction: column;
    }

    .topic-nav a {
        max-width: 100%;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .nav-right {
        gap: 0.5rem;
    }

    .nav-btn span.btn-text {
        display: none;
    }

    .fact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps-list li {
        flex-direction: column;
        text-align: center;
    }

    .topic-hero h1 {
        font-size: 1.8rem;
    }

    .led-demo {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .fact-grid {
        grid-template-columns: 1fr;
    }

    .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
}
