/* ================================
   ISSAENGINEERED - Main Styles
   Retro Mac Computer Interface
   ================================ */

/* CSS Variables */
:root {
    /* Mac Classic Colors */
    --mac-beige: #c0b49a;
    --mac-dark-beige: #a89a80;
    --mac-light-beige: #d4c8ae;
    --mac-cream: #f5f1e6;

    /* Screen Colors */
    --screen-bg: #1a1a2e;
    --screen-text: #00ff41;
    --screen-accent: #00d4aa;
    --screen-highlight: #ff6b6b;

    /* Window Colors */
    --window-bg: #ffffff;
    --window-title: #000000;
    --window-border: #000000;
    --window-stripe: linear-gradient(90deg,
            #ffffff 0%, #ffffff 8%,
            #000000 8%, #000000 16%,
            #ffffff 16%, #ffffff 24%,
            #000000 24%, #000000 32%,
            #ffffff 32%, #ffffff 40%,
            #000000 40%, #000000 48%,
            #ffffff 48%, #ffffff 56%,
            #000000 56%, #000000 64%,
            #ffffff 64%, #ffffff 72%,
            #000000 72%, #000000 80%,
            #ffffff 80%, #ffffff 88%,
            #000000 88%, #000000 100%);

    /* Desk Colors */
    --desk-wood: #8b7355;
    --desk-dark: #6b5344;

    /* Typography */
    --font-system: 'VT323', 'Chicago', monospace;
    --font-pixel: 'Press Start 2P', cursive;

    /* Shadows */
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-hard: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

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

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

body {
    font-family: var(--font-system);
    background: linear-gradient(180deg,
            #2c3e50 0%,
            #34495e 50%,
            #2c3e50 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: var(--screen-text);
}

.loading-content .mac-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: float 2s ease-in-out infinite;
}

.loading-content h1 {
    font-family: var(--font-pixel);
    font-size: 18px;
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.loading-content p {
    font-size: 16px;
    margin-top: 15px;
    animation: blink 1s infinite;
}

.loading-bar {
    width: 250px;
    height: 16px;
    border: 2px solid var(--screen-text);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: var(--screen-text);
    width: 0%;
    animation: loadProgress 2s ease-out forwards;
}

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

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

/* Desktop Container - FULLSCREEN FIT */
.desktop-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Desk Surface - Scale to fit viewport */
.desk-surface {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.65);
    transform-origin: center center;
}

/* Responsive scaling based on viewport height */
@media (min-height: 800px) {
    .desk-surface {
        transform: scale(0.75);
    }
}

@media (min-height: 900px) {
    .desk-surface {
        transform: scale(0.85);
    }
}

@media (min-height: 1000px) {
    .desk-surface {
        transform: scale(0.95);
    }
}

@media (max-height: 700px) {
    .desk-surface {
        transform: scale(0.55);
    }
}

@media (max-height: 600px) {
    .desk-surface {
        transform: scale(0.45);
    }
}

/* Hint Text */
.hint-text {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-left: 1px solid #000;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fff 0%, #ccc 100%);
    border: 1px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
}

/* Selection */
::selection {
    background: var(--screen-text);
    color: #000;
}

/* Computer Wrapper */
.computer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Key Legend - hide on small screens */
.key-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    max-width: 650px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 10px;
    opacity: 0.8;
}

.legend-key {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

@media (max-height: 700px) {
    .key-legend {
        display: none;
    }
}