/* ========================================
   2D PLATFORMER PORTFOLIO - STYLES
   v3.0 - Game HUD Interface
   ======================================== */

/* CSS Custom Properties */
:root {
    /* Color Palette - Retro Arcade Theme */
    --bg-dark: #0f0f23;
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --accent-primary: #e94560;
    --accent-secondary: #00d9ff;
    --accent-tertiary: #7b2cbf;
    --accent-gold: #ffd93d;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* HUD Colors */
    --hud-bg: rgba(10, 20, 40, 0.85);
    --hud-border: rgba(0, 217, 255, 0.6);
    --hud-glow: rgba(0, 217, 255, 0.3);

    /* Shadows */
    --shadow-glow: 0 0 30px rgba(233, 69, 96, 0.3);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    /* Typography */
    --font-pixel: 'Press Start 2P', cursive;
    --font-modern: 'Inter', sans-serif;

    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-modern);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========================================
   ARCADE CONSOLE UI
   ======================================== */

#game-chassis {
    background: var(--bg-dark);
    padding: 10px;
    border-radius: 20px;
    box-shadow:
        0 0 0 2px var(--hud-border),
        0 0 20px rgba(0, 217, 255, 0.2),
        var(--shadow-card);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
}

#canvas-wrapper {
    width: 100%;
    position: relative;
    border: 2px solid var(--accent-secondary);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.1);
    background: #000;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    /* Disables browser zooming/scrolling */
}

#game-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 10px 10px;
    background: var(--bg-dark);
    border-radius: 15px 15px 0 0;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

#tech-strip {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    background: var(--bg-dark);
    /* Fallback */
    border-radius: 0 0 15px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    /* Ensure content doesn't spill */
}

/* Infinite Scrolling Carousel */
.tech-carousel {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 900px;
    /* Constrain to game width */
    max-width: 100%;
    margin: 0 auto;
    /* Center alignment */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 15px 15px;
    /* Match bottom corners */
}

.tech-track {
    display: flex;
    gap: 40px;
    width: max-content;
    animation: scroll 25s linear infinite;
    padding: 0 20px;
    /* Slight buffer */
    align-items: center;
    /* Vertically center icons */
}

.tech-track i {
    font-size: 30px;
    color: #888;
    transition: color 0.3s ease;
    cursor: default;
}

.tech-track i:hover {
    color: #ffffff;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Control Buttons (Redefined for toolbar) */
.control-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:hover {
    background: rgba(0, 217, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--hud-glow);
}

/* Specific visibility improvements for Utility Buttons */
/* Utility Buttons Container */
#respawn-btn,
#mute-btn {
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent dark bg */
    border: 1px solid #555;
    opacity: 1;
    cursor: pointer;
    /* Flex center to align icon perfectly */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Force Icon Color */
#respawn-btn i,
#mute-btn i {
    color: #ffffff !important;
    font-size: 1.2rem;
    /* Make them slightly bigger */
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* Hover Effects */
#respawn-btn:hover,
#mute-btn:hover {
    border-color: #00f3ff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

#respawn-btn:hover i,
#mute-btn:hover i {
    color: #00f3ff !important;
    text-shadow: 0 0 8px #00f3ff;
}

.lang-btn {
    width: 36px;
    height: 36px;
    background: var(--hud-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    opacity: 0.6;
}

.lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lang-btn.active {
    opacity: 1;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 10px var(--hud-glow);
}

/* Theme Toggle Switch */
.theme-switch {
    position: relative;
    width: 60px;
    height: 30px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #2d2d44, #1a1a2e);
    border-radius: 30px;
    border: 1px solid var(--hud-border);
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme-slider::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.theme-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    z-index: 1;
}

.theme-icon.moon {
    left: 8px;
}

.theme-icon.sun {
    right: 8px;
}

/* Unchecked = Day mode (knob on right, show sun) */
.theme-switch input:not(:checked)+.theme-slider {
    background: linear-gradient(135deg, #87CEEB, #B0E0E6);
}

.theme-switch input:not(:checked)+.theme-slider::before {
    transform: translateX(30px);
}

/* Checked = Night mode (knob on left, show moon) */
.theme-switch input:checked+.theme-slider::before {
    transform: translateX(0);
}

.theme-switch:hover .theme-slider {
    box-shadow: 0 0 12px var(--hud-glow);
}

/* Game Container */
#game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    max-width: 100vw;
}

/* Header */
#game-header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

#game-header h1 {
    font-family: var(--font-pixel);
    font-size: clamp(1rem, 3vw, 1.5rem);
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
    margin-bottom: 0.5rem;
}

.instructions {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.key {
    display: inline-block;
    background: linear-gradient(180deg, #f0f0f0 0%, #d4d4d4 100%);
    border: 1px solid #999;
    border-bottom: 3px solid #666;
    border-right: 2px solid #888;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: bold;
    color: #333;
    margin: 0 0.15rem;
    box-shadow:
        0 2px 0 #555,
        0 3px 3px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    min-width: 1.5em;
    text-align: center;
}

.hint {
    font-size: 0.8rem;
    color: var(--accent-gold);
    animation: pulse 2s ease-in-out infinite;
}

/* Canvas Wrapper - for HUD positioning */
#canvas-wrapper {
    position: relative;
    display: inline-block;
}

/* Canvas */
#gameCanvas {
    display: block;
    background: linear-gradient(180deg, #1a1a2e 0%, #2d2d44 60%, #3d3d5c 100%);
    border: 3px solid var(--accent-primary);
    border-radius: 8px;
    box-shadow:
        var(--shadow-glow),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Footer */
#game-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ========================================
   HUD PANEL STYLES - Game Interface
   ======================================== */

/* Overlay container - transparent, no blocking */
#modal-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Click through to game */
    z-index: 100;
    overflow: hidden;
}

/* Hidden state - panel slides out */

#modal-overlay.hidden #project-modal {
    transform: translateX(110%);
    opacity: 0;
}

/* HUD Panel - Holographic Glass Style */
#project-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    width: min(320px, 40%);
    max-height: calc(100% - 20px);
    overflow-y: auto;

    /* Holographic Glass Effect */
    background: var(--hud-bg);
    border: 1px solid var(--hud-border);
    border-radius: 12px;
    padding: 1.25rem;

    /* Neon glow effect */
    box-shadow:
        0 0 20px var(--hud-glow),
        0 0 40px rgba(0, 217, 255, 0.1),
        inset 0 0 30px rgba(0, 217, 255, 0.05);

    /* Scanline effect */
    background-image:
        linear-gradient(0deg,
            transparent 50%,
            rgba(0, 217, 255, 0.03) 50%);
    background-size: 100% 4px;

    /* Enable pointer events only on the panel */
    pointer-events: auto;

    /* Slide-in animation */
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease;
}

/* Corner decorations - holographic frame */
#project-modal::before,
#project-modal::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--accent-secondary);
    border-style: solid;
    border-width: 0;
}

#project-modal::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
    border-top-left-radius: 12px;
}

#project-modal::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
    border-bottom-right-radius: 12px;
}

/* HUD Label */
#project-modal .hud-label {
    position: absolute;
    top: -8px;
    left: 20px;
    background: var(--bg-dark);
    padding: 0 8px;
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Modal Close Button */
#modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(233, 69, 96, 0.2);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--accent-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: var(--transition-smooth);
}

#modal-close:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

/* Modal Content */
#modal-content {
    position: relative;
}

#project-title {
    font-family: var(--font-pixel);
    font-size: 0.75rem;
    color: var(--accent-secondary);
    margin-bottom: 0.75rem;
    padding-right: 30px;
    text-shadow: 0 0 15px rgba(0, 217, 255, 0.5);
    line-height: 1.4;
}

#project-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

#tech-stack h3 {
    font-size: 0.55rem;
    font-family: var(--font-pixel);
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tech-tag {
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.3), rgba(233, 69, 96, 0.3));
    border: 1px solid var(--accent-tertiary);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
    position: relative;
}

.tech-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 4px 12px rgba(123, 44, 191, 0.4),
        0 0 20px rgba(233, 69, 96, 0.3);
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.5), rgba(123, 44, 191, 0.5));
    border-color: var(--accent-primary);
}

/* Interaction hint */
.tech-tag:first-child::after {
    content: '← hover me!';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    font-size: 0.5rem;
    color: var(--accent-gold);
    white-space: nowrap;
    opacity: 0.8;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.3;
    }
}

/* Modal Buttons */
#project-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: transparent;
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.btn-secondary:hover {
    background: rgba(0, 217, 255, 0.2);
    transform: translateY(-2px);
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* HUD slide-in from right */
@keyframes hudSlideIn {
    from {
        transform: translateX(110%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* HUD slide-out to right */
@keyframes hudSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

/* Data stream effect for HUD */
@keyframes dataStream {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100px;
    }
}

#project-modal.active {
    animation: hudSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* Typewriter Cursor */
.blink-cursor {
    display: inline-block;
    animation: cursor-blink 1s step-end infinite;
    color: var(--accent-gold);
    margin-left: 2px;
}

@keyframes cursor-blink {
    50% {
        opacity: 0;
    }
}

@media (max-width: 768px) {
    #game-header h1 {
        font-size: 0.9rem;
    }

    .instructions,
    .hint {
        font-size: 0.7rem;
    }

    #project-modal {
        width: min(280px, 50%);
        padding: 1rem;
        top: 5px;
        right: 5px;
    }

    #project-title {
        font-size: 0.65rem;
    }

    #project-description {
        font-size: 0.7rem;
    }

    .tech-tag {
        font-size: 0.55rem;
        padding: 0.2rem 0.4rem;
    }

    .btn {
        font-size: 0.45rem;
        padding: 0.4rem 0.5rem;
        min-width: 80px;
    }

    #project-title {
        font-size: 0.7rem;
        /* Ensure title is smaller */
        margin-bottom: 0.5rem;
    }

    #project-modal {
        max-height: 80vh;
        /* Safety net prevents cutoff */
        overflow-y: auto;
        /* Enable scroll if text is too long */
        padding: 0.8rem;
        /* Use less space */
    }
}

@media (max-width: 500px) {
    #project-modal {
        width: calc(100% - 10px);
        max-width: none;
        top: auto;
        bottom: 5px;
        right: 5px;
        left: 5px;
        max-height: 45%;
    }
}

/* ========================================
   SCROLLBAR STYLING FOR HUD
   ======================================== */

#project-modal::-webkit-scrollbar {
    width: 4px;
}

#project-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

#project-modal::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 2px;
}

#project-modal::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ========================================
   MOBILE INFO PANEL (EXTERNAL - HARD RESET)
   ======================================== */
#mobile-project-panel {
    display: none;
    /* Hidden by default on PC */
    background: #111;
    border: 2px solid #00f3ff;
    border-top: none;
    /* Blend with game above */
    padding: 20px;
    margin: 0 auto;
    max-width: 900px;
    /* Match game width */
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

#mobile-title {
    color: var(--accent-gold);
    font-family: var(--font-pixel);
    font-size: 1rem;
    margin: 0;
}

#mobile-close-btn {
    background: transparent;
    border: none;
    color: #00f3ff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

#mobile-desc {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 15px;
}

#mobile-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.mobile-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.retro-btn {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(0, 243, 255, 0.1);
    color: #00f3ff;
    text-decoration: none;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    border: 1px solid #00f3ff;
    transition: all 0.3s;
}

.retro-btn:hover {
    background: #00f3ff;
    color: #111;
    box-shadow: 0 0 10px #00f3ff;
}

/* FORCE DISPLAY ON MOBILE WHEN ACTIVE */
@media (max-width: 768px) {
    #mobile-project-panel.active {
        display: block !important;
        animation: slideDown 0.3s ease-out;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}/* ========================================
   SCREENSHOT DESIGN MATCH 
   ======================================== */

.btn-pink {
    background: linear-gradient(135deg, #e94560, #d13a55);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.btn-pink:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.5);
    color: white;
    /* Ensure text stays white */
}

.btn-cyan {
    background: transparent;
    border: 1px solid #00d9ff;
    color: #00d9ff;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.1);
}

.btn-cyan:hover {
    background: rgba(0, 217, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
    color: #00d9ff;
}