/* CodAlea Retro Console - Estilo 8-bits Pixel Art */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

/* Fuente pixel art personalizada */
@font-face {
    font-family: 'PixelFont';
    src: url('data:font/truetype;charset=utf-8;base64,') format('truetype');
    /* Fallback a fuentes monospace con apariencia pixelada */
}

.retro-console-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 480px;
    height: 360px;
    background: linear-gradient(145deg, #0a0a0a, #2a2a2a);
    border: 3px solid #00ff41;
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.5),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
    font-family: 'Orbitron', 'Courier New', monospace;
    z-index: 1000;
    transform: translateY(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.retro-console-container.active {
    transform: translateY(0);
    opacity: 1;
}

/* Header de la consola */
.console-header {
    background: linear-gradient(90deg, #00ff41, #00cc33);
    color: #000;
    padding: 8px 15px;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px 5px 0 0;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.console-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.console-controls {
    display: flex;
    gap: 5px;
}

.console-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.console-btn.minimize {
    background: #ffbd2e;
}

.console-btn.maximize {
    background: #28ca42;
}

.console-btn.close {
    background: #ff5f56;
}

.console-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Área de output */
.console-output {
    flex: 1;
    padding: 15px;
    background: #000;
    color: #00ff41;
    font-size: 11px;
    line-height: 1.4;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.console-output::-webkit-scrollbar {
    width: 8px;
}

.console-output::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.console-output::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 4px;
}

/* Líneas de la consola */
.console-line {
    margin-bottom: 5px;
    animation: typewriter 0.5s ease-in-out;
}

.console-line.system {
    color: #00ccff;
}

.console-line.error {
    color: #ff4444;
}

.console-line.success {
    color: #44ff44;
}

.console-line.warning {
    color: #ffaa00;
}

.console-line.hint {
    color: #ff00ff;
    animation: glow 2s ease-in-out infinite alternate;
}

/* Área de input */
.console-input-area {
    padding: 10px 15px;
    background: linear-gradient(180deg, #2a2a2a, #0a0a0a);
    border-top: 1px solid #00ff41;
    display: flex;
    align-items: center;
    gap: 10px;
}

.console-prompt {
    color: #00ff41;
    font-weight: bold;
    user-select: none;
}

.console-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff41;
    font-family: inherit;
    font-size: 11px;
    outline: none;
    caret-color: #00ff41;
}

.console-input::placeholder {
    color: #006622;
}

/* Cursor parpadeante */
.blinking-cursor::after {
    content: '█';
    animation: blink 1s infinite;
    color: #00ff41;
}

/* Toggle button */
.console-toggle {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #0a0a0a, #2a2a2a);
    border: 3px solid #00ff41;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: #00ff41;
    box-shadow: 
        0 6px 25px rgba(0, 255, 65, 0.7),
        inset 0 0 15px rgba(0, 255, 65, 0.1),
        0 0 0 3px rgba(0, 255, 65, 0.3);
    transition: all 0.3s ease;
    z-index: 9999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: consolePulse 3s ease-in-out infinite;
    font-weight: bold;
    overflow: hidden;
}

.console-toggle:hover {
    transform: scale(1.15);
    box-shadow: 
        0 8px 30px rgba(0, 255, 65, 0.9),
        inset 0 0 20px rgba(0, 255, 65, 0.2),
        0 0 0 5px rgba(0, 255, 65, 0.5);
    animation: consoleHover 0.5s ease-in-out;
}

.console-toggle:hover .tron-bike-mini {
    animation-duration: 1s;
    color: #ffffff;
}

.console-toggle:hover .zombie-chaser-mini {
    animation-duration: 0.8s;
    color: #ffffff;
}

.console-toggle.active {
    background: linear-gradient(145deg, #ff4444, #cc3333);
    border-color: #ffff00;
    transform: rotate(45deg) scale(1.1);
    box-shadow: 
        0 6px 25px rgba(255, 68, 68, 0.7),
        inset 0 0 15px rgba(255, 68, 68, 0.1),
        0 0 0 3px rgba(255, 68, 68, 0.4);
}

.console-toggle.active .console-icon {
    color: #ffff00;
    text-shadow: 0 0 15px #ffff00;
}

/* Efectos de animación */
@keyframes typewriter {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #ff00ff, 0 0 10px #ff00ff;
    }
    to {
        text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff;
    }
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 20px;
    }
}

/* Efecto de líneas de escaneo */
.console-output::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 50%, 
        rgba(0, 255, 65, 0.03) 50%
    );
    background-size: 100% 4px;
    animation: scanlines 0.1s linear infinite;
    pointer-events: none;
}

/* Efectos de CRT */
.retro-console-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at center, transparent 70%, rgba(0, 0, 0, 0.3) 100%);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}

/* Modal para juegos */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.game-modal.active {
    display: flex;
    animation: fadeIn 0.5s ease-in-out;
}

.game-container {
    width: 80%;
    max-width: 800px;
    height: 80%;
    background: linear-gradient(145deg, #2a2a2a, #0a0a0a);
    border: 3px solid #00ff41;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-header {
    background: linear-gradient(90deg, #ff00ff, #9900cc);
    color: #fff;
    padding: 15px;
    text-align: center;
    font-weight: 900;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.game-area {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #00ff41;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.game-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ff4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.game-close:hover {
    background: #ff6666;
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsividad */
@media (max-width: 768px) {
    .retro-console-container {
        width: calc(100% - 40px);
        height: 300px;
        bottom: 10px;
        right: 20px;
        left: 20px;
    }
    
    .console-toggle {
        bottom: 10px;
        right: 10px;
        width: 70px;
        height: 70px;
        font-size: 16px;
    }
    
    .console-toggle .tron-bike-mini {
        font-size: 12px;
        right: 15px;
    }
    
    .console-toggle .zombie-chaser-mini {
        font-size: 10px;
        right: 28px;
    }
    
    .console-toggle .console-icon {
        font-size: 18px;
    }
    
    .game-container {
        width: 95%;
        height: 90%;
    }
    
    .zombie-chase-animation {
        bottom: 80px;
        height: 50px;
    }
    
    .tron-bike {
        font-size: 20px;
        left: 120px;
    }
    
    .zombie-chaser {
        font-size: 16px;
        left: 40px;
    }
}

/* Efectos adicionales para el tema pixel art */
.pixel-art {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Animaciones de los juegos */
.thriller-dance {
    animation: thriller 2s ease-in-out infinite;
}

@keyframes thriller {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

.derezzed-grid {
    background: 
        linear-gradient(90deg, transparent 24%, rgba(0, 255, 255, 0.1) 25%, rgba(0, 255, 255, 0.1) 26%, transparent 27%, transparent 74%, rgba(0, 255, 255, 0.1) 75%, rgba(0, 255, 255, 0.1) 76%, transparent 77%, transparent),
        linear-gradient(transparent 24%, rgba(0, 255, 255, 0.1) 25%, rgba(0, 255, 255, 0.1) 26%, transparent 27%, transparent 74%, rgba(0, 255, 255, 0.1) 75%, rgba(0, 255, 255, 0.1) 76%, transparent 77%, transparent);
    background-size: 40px 40px;
    animation: gridMove 4s linear infinite;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* Animaciones adicionales para el botón de consola */
@keyframes consolePulse {
    0%, 100% { 
        box-shadow: 
            0 6px 25px rgba(0, 255, 65, 0.7),
            inset 0 2px 6px rgba(255, 255, 255, 0.3),
            0 0 0 3px rgba(0, 255, 65, 0.3);
    }
    50% { 
        box-shadow: 
            0 8px 35px rgba(0, 255, 65, 0.9),
            inset 0 2px 6px rgba(255, 255, 255, 0.4),
            0 0 0 6px rgba(0, 255, 65, 0.5);
        transform: scale(1.05);
    }
}

@keyframes consoleHover {
    0% { transform: scale(1.15) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-5deg); }
    75% { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1.15) rotate(0deg); }
}

/* Animación dentro del botón de consola */
.console-toggle-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
}

.console-toggle .tron-bike-mini {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #00ffff;
    animation: tronBikeMini 3s ease-in-out infinite;
    text-shadow: 0 0 8px #00ffff;
    z-index: 2;
}

.console-toggle .zombie-chaser-mini {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #88ff88;
    animation: zombieRunMini 2.5s ease-in-out infinite;
    text-shadow: 0 0 6px #88ff88;
    z-index: 1;
}

.console-toggle .console-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #00ff41;
    z-index: 3;
    text-shadow: 0 0 10px #00ff41;
    animation: iconGlow 4s ease-in-out infinite;
}

@keyframes tronBikeMini {
    0%, 100% { 
        right: 20px;
        transform: translateY(-50%) rotate(0deg);
        opacity: 1;
    }
    25% { 
        right: 15px;
        transform: translateY(-55%) rotate(-5deg);
        opacity: 0.8;
    }
    50% { 
        right: 25px;
        transform: translateY(-45%) rotate(3deg);
        opacity: 1;
    }
    75% { 
        right: 18px;
        transform: translateY(-50%) rotate(-2deg);
        opacity: 0.9;
    }
}

@keyframes zombieRunMini {
    0%, 100% {
        right: 35px;
        transform: translateY(-50%) scale(1);
        opacity: 0.8;
    }
    25% {
        right: 28px;
        transform: translateY(-60%) scale(1.2) rotate(-15deg);
        opacity: 1;
        filter: drop-shadow(0 0 5px #00ff41);
    }
    50% {
        right: 42px;
        transform: translateY(-45%) scale(0.9) rotate(10deg);
        opacity: 0.7;
    }
    75% {
        right: 30px;
        transform: translateY(-52%) scale(1.15) rotate(-8deg);
        opacity: 0.9;
        filter: drop-shadow(0 0 8px #ff00ff);
    }
}

@keyframes iconGlow {
    0%, 100% { 
        color: #00ff41;
        text-shadow: 0 0 10px #00ff41;
        transform: translate(-50%, -50%) scale(1);
    }
    25% { 
        color: #00ccff;
        text-shadow: 0 0 15px #00ccff;
        transform: translate(-50%, -50%) scale(1.05);
    }
    50% { 
        color: #ff00ff;
        text-shadow: 0 0 20px #ff00ff;
        transform: translate(-50%, -50%) scale(1.1);
    }
    75% { 
        color: #ffaa00;
        text-shadow: 0 0 15px #ffaa00;
        transform: translate(-50%, -50%) scale(1.05);
    }
}
