/* Rust Vibe Theme for Slidev */
/* Extends default theme with Rust-inspired colors and styling */

/* ============================================ */
/* COLOR VARIABLES */
/* ============================================ */

:root {
    /* Rust brand colors */
    --rust-orange: #f74c00;
    --rust-dark: #8b2500;
    --rust-light: #ffa366;
    --rust-gray: #2d3748;
    --rust-dark-gray: #1a202c;
    --rust-accent: #48bb78;

    /* Override Slidev theme colors */
    --slidev-theme-primary: #f74c00;

    /* Background mode variables - Default: Very Dark (optimal for monitors) */
    --bg-primary: #1c1c1c;
    --bg-secondary: #2a2a2a;
    --bg-gradient-opacity: 0.08;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
}

/* Projection Mode - Better visibility for projectors */
/* To activate: add class="projection-mode" to <html> or use slidev class config */
.projection-mode {
    /* MUCH lighter backgrounds - optimal for projectors */
    --bg-primary: #3d4a5c;
    --bg-secondary: #4a5a70;
    --bg-gradient-opacity: 0.25;
    --text-primary: #ffffff;
    --text-secondary: #f0f0f0;
}

/* Brighter slide backgrounds in projection mode - exclude covers */
.projection-mode .slidev-layout.default,
.projection-mode .slidev-layout.center,
.projection-mode .slidev-layout.two-cols,
.projection-mode .slidev-layout.intro,
.projection-mode .slidev-layout.fact,
.projection-mode .slidev-layout.statement,
.projection-mode .slidev-layout.image-left,
.projection-mode .slidev-layout.image-right {
    background-color: #3d4a5c !important;
    background-image:
        radial-gradient(at 50% 0%, rgba(247, 76, 0, 0.25) 0%, transparent 50%),
        linear-gradient(135deg, #3d4a5c 0%, #4a5a70 50%, #3d4a5c 100%) !important;
}

/* Textos grises MUCHO más claros en projection mode */
.projection-mode .text-gray-500,
.projection-mode .text-gray-400,
.projection-mode [class*="text-gray-"] {
    color: #d1d5db !important;
    /* text-gray-300 equivalent */
}

.projection-mode .opacity-70,
.projection-mode .opacity-60,
.projection-mode .opacity-50 {
    opacity: 1 !important;
}

/* Better background similar to default theme - apply to all layouts EXCEPT covers */
.slidev-layout.default,
.slidev-layout.center,
.slidev-layout.two-cols,
.slidev-layout.intro,
.slidev-layout.fact,
.slidev-layout.statement,
.slidev-layout.image-left,
.slidev-layout.image-right {
    background-color: var(--bg-primary) !important;
    background-image:
        radial-gradient(
            at 50% 0%,
            rgba(247, 76, 0, var(--bg-gradient-opacity)) 0%,
            transparent 50%
        ),
        linear-gradient(
            135deg,
            var(--bg-primary) 0%,
            var(--bg-secondary) 50%,
            var(--bg-primary) 100%
        ) !important;
    color: var(--text-primary) !important;
}

/* ============================================ */
/* TYPOGRAPHY - Match default theme sizes */
/* ============================================ */

.slidev-layout h1 {
    font-size: 3.5rem !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
}

.slidev-layout h2 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
    font-weight: 500 !important;
}

.slidev-layout h3 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
}

.slidev-layout p {
    font-size: 1.25rem !important;
    line-height: 1.6 !important;
}

.slidev-layout {
    font-size: 1.25rem !important;
}

/* Ensure proper spacing */
.slidev-layout {
    padding: 2rem 3rem !important;
}

/* ============================================ */
/* CUSTOM TEXT CLASSES */
/* ============================================ */

.orange {
    color: #ce412b !important;
}

/* Years counter badge */
.years-badge {
    display: inline-block;
    background: linear-gradient(
        135deg,
        rgba(72, 187, 120, 0.2),
        rgba(72, 187, 120, 0.4)
    );
    border: 2px solid #48bb78;
    border-radius: 12px;
    padding: 0.5rem 1.5rem;
    font-weight: bold;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(72, 187, 120, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(72, 187, 120, 0.6);
    }
}

/* ============================================ */
/* CODE BLOCKS */
/* ============================================ */

/* Victor Mono font for code with italic style */
pre code,
.slidev-code,
.shiki,
code {
    font-family:
        "Victor Mono", "JetBrains Mono", "Fira Code", monospace !important;
    font-style: italic;
    font-variant-ligatures: normal;
}

/* Enhanced code block styling */
.slidev-code-wrapper {
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Borde sutil gris, no naranja */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Prevenir borde naranja en hover */
.slidev-code-wrapper:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Code line numbers - Only when .code-line-num class is applied */
.code-line-num .slidev-code-wrapper {
    border: 1px solid #ffffff20;
    border-radius: 12px;
}

.code-line-num pre.shiki {
    counter-reset: codeblock-line;
    padding-left: 0.5rem;
}

.code-line-num pre.shiki .line {
    counter-increment: codeblock-line;
    display: inline-block;
    padding-left: 0.5rem;
}

.code-line-num pre.shiki .line::before {
    content: counter(codeblock-line);
    display: inline-block;
    width: 2.5rem;
    margin-right: 1.5rem;
    margin-left: -3rem;
    text-align: right;
    color: #666;
    user-select: none;
    opacity: 0.6;
}

/* Rust syntax highlighting overrides */
.token.keyword {
    color: #ff6b6b !important;
}

.token.string {
    color: #4ecdc4 !important;
}

.token.function {
    color: #ffe66d !important;
}

.token.comment {
    color: #a8a8a8 !important;
    font-style: italic;
}

.token.type {
    color: var(--rust-orange) !important;
    font-weight: bold;
}

/* ============================================ */
/* PROJECTION MODE - CODE BLOCKS */
/* Enhanced visibility for code in projection mode */
/* ============================================ */

/* ============================================ */
/* MODO PROYECCIÓN: INVERTIR TODO             */
/* Fondo oscuro → claro, colores claros → oscuros */
/* ============================================ */

/* Invertir el bloque de código completo con ajustes mejorados */
.projection-mode .slidev-code-wrapper {
    filter: invert(1) hue-rotate(280deg) brightness(0.85) saturate(1.4)
        contrast(1.2) !important;
}

/* Aumentar peso de fuente para mejor visibilidad */
.projection-mode .shiki code span {
    font-weight: 800 !important;
}

/* Números de línea OSCUROS y visibles */
.projection-mode .shiki .line-number,
.projection-mode .slidev-code .line-number,
.projection-mode pre .line-number,
.projection-mode .shiki span.line-number,
.projection-mode pre span.line-number,
.projection-mode code .line-number {
    color: #6b7280 !important;
    /* Gris medio oscuro */
    opacity: 1 !important;
    font-weight: 600 !important;
}

/* Botón de copiar código - Solo cambiar color del icono para fondo claro */
.projection-mode .slidev-code-wrapper button,
.projection-mode .slidev-code button,
.projection-mode pre button {
    /* Mantener fondo oscuro igual que modo normal, solo cambiar icono */
}

/* Iconos en GRIS OSCURO para que se vean sobre fondo blanco */
.projection-mode .slidev-code-wrapper button svg,
.projection-mode .slidev-code button svg,
.projection-mode pre button svg {
    color: #1f2937 !important;
    /* Gris oscuro intenso */
    fill: #1f2937 !important;
    stroke: #1f2937 !important;
}

/* ============================================ */
/* CUSTOM COMPONENTS */
/* ============================================ */

/* Poll options */
.poll-option {
    background: linear-gradient(
        135deg,
        rgba(247, 76, 0, 0.1),
        rgba(247, 76, 0, 0.2)
    );
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.poll-option::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s;
}

.poll-option:hover {
    border-color: var(--rust-orange);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--rust-orange);
}

.poll-option:hover::before {
    left: 100%;
}

/* Performance cards */
.performance-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
    border: 1px solid rgba(247, 76, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Better visibility in projection mode */
.projection-mode .performance-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7));
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    /* Borde gris sutil */
}

/* Quitar borde naranja superior en projection mode */
.projection-mode .performance-card::before {
    display: none !important;
}

.performance-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--rust-orange), var(--rust-light));
}

/* Result badges */
.result-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    margin-top: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.result-badge.slow {
    background: linear-gradient(45deg, #ff4444, #cc1111);
    color: white;
}

.result-badge.medium {
    background: linear-gradient(45deg, #ffaa00, #cc7700);
    color: white;
}

.result-badge.fast {
    background: linear-gradient(45deg, #44ff44, #22cc22);
    color: black;
}

/* Company cards */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.company-card {
    background: linear-gradient(
        135deg,
        rgba(247, 76, 0, 0.1),
        rgba(247, 76, 0, 0.2)
    );
    border: 1px solid var(--rust-orange);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.company-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(247, 76, 0, 0.3);
}

/* Tool categories */
.tool-category {
    background: linear-gradient(
        135deg,
        rgba(247, 76, 0, 0.05),
        rgba(247, 76, 0, 0.15)
    );
    border: 1px solid rgba(247, 76, 0, 0.3);
    border-radius: 12px;
    padding: 24px;
    position: relative;
}

.tool-category h2 {
    color: var(--rust-orange);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-category li {
    font-size: 0.9em;
}

/* Terminal simulation */
.terminal-simulation {
    background: #000;
    border-radius: 8px;
    padding: 16px;
    font-family: "JetBrains Mono", monospace;
    color: #00ff00;
    position: relative;
}

.terminal-simulation::before {
    content: "● ● ●";
    position: absolute;
    top: 8px;
    left: 12px;
    color: #ff5f56;
    font-size: 12px;
}

/* Interactive demo badge */
.interactive-demo {
    border: 2px dashed var(--rust-orange);
    border-radius: 8px;
    padding: 20px;
    background: rgba(247, 76, 0, 0.05);
    position: relative;
}

.interactive-demo::before {
    content: "🔴 LIVE";
    position: absolute;
    top: -10px;
    right: 20px;
    background: #ff0000;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

/* Buttons */
.rust-button {
    background: linear-gradient(45deg, var(--rust-orange), var(--rust-light));
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(247, 76, 0, 0.3);
}

.rust-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 76, 0, 0.4);
}

/* QR Code */
.qr-code {
    background: white;
    padding: 16px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */

/* Ferris mascot animation */
@keyframes ferris-wave {
    0%,
    100% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

.ferris-animate {
    animation: ferris-wave 2s ease-in-out infinite;
}

/* ============================================ */
/* SCROLLBAR */
/* ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--rust-orange);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--rust-light);
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .poll-option {
        font-size: 14px;
        padding: 12px;
    }

    .company-grid {
        grid-template-columns: 1fr;
    }
}

.section-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.section-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
}

.text-container {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    font-family: "Victor Italic", "Georgia", serif;
    max-width: 90%;
}

.title-text {
    font-style: italic;
    font-weight: bold;
    line-height: 1.5;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.subtitle-text {
    font-style: italic;
    font-weight: normal;
    line-height: 1.4;
    margin: 20px 0;
    opacity: 0.95;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.author {
    font-style: normal;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

/* ============================================ */
/* PRINT STYLES */
/* ============================================ */

@media print {
    .performance-card,
    .tool-category,
    .company-card {
        border: 1px solid #ccc !important;
        background: white !important;
    }
}
