/* ==========================================================================
   ALTANAY-9000 DESIGN SYSTEM (90s CRT TERMINAL)
   ========================================================================== */

:root {
    /* Color Palette variables - defaults to Green Phosphor */
    --theme-color: #00ff66;
    --theme-color-dim: rgba(0, 255, 102, 0.25);
    --theme-glow: rgba(0, 255, 102, 0.6);
    --bg-color: #0c0e0c;
    --bezel-color: #2b2d2f;
    --bezel-border: #1c1d1e;
    --bezel-highlight: #3c3e40;
    --led-color: #ff3b30;
    --led-glow: rgba(255, 59, 48, 0.8);
    
    --font-terminal: 'VT323', monospace;
    --font-ui: 'Share Tech Mono', monospace;
}

/* Theme Mappings */
html[data-theme="green"] {
    --theme-color: #00ff66;
    --theme-color-dim: rgba(0, 255, 102, 0.25);
    --theme-glow: rgba(0, 255, 102, 0.6);
}

html[data-theme="amber"] {
    --theme-color: #ffb000;
    --theme-color-dim: rgba(255, 176, 0, 0.25);
    --theme-glow: rgba(255, 176, 0, 0.6);
}

html[data-theme="cyan"] {
    --theme-color: #00f0ff;
    --theme-color-dim: rgba(0, 240, 255, 0.25);
    --theme-glow: rgba(0, 240, 255, 0.6);
}

html[data-theme="mono"] {
    --theme-color: #e0e0e0;
    --theme-color-dim: rgba(224, 224, 224, 0.2);
    --theme-glow: rgba(224, 224, 224, 0.5);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    background-color: #121314;
    color: var(--theme-color);
    font-family: var(--font-terminal);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
}

/* ==========================================================================
   RETRO MONITOR CHASSIS & BEZEL
   ========================================================================== */

.crt-monitor {
    background-color: var(--bezel-color);
    border: 15px solid var(--bezel-border);
    border-radius: 35px;
    box-shadow: 
        inset 0 10px 15px var(--bezel-highlight),
        0 15px 35px rgba(0, 0, 0, 0.9),
        0 0 0 1px var(--bezel-border);
    display: flex;
    flex-direction: column;
    width: 900px;
    max-width: 100%;
    height: 680px;
    max-height: 100%;
    position: relative;
    padding: 10px;
    user-select: none;
}

/* Bezel Header Controls Panel */
.bezel-top-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1b1c;
    border: 3px solid #101112;
    border-radius: 8px;
    padding: 6px 15px;
    margin-bottom: 8px;
    font-family: var(--font-ui);
    font-size: 11px;
    color: #8a8b8c;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.brand-logo {
    font-weight: bold;
    letter-spacing: 2px;
    color: #c5c6c7;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.8);
}

.bezel-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #0f1011;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #2a2b2c;
}

.control-label {
    margin-right: 4px;
    font-size: 9px;
    color: #5a5b5c;
}

.btn-bezel {
    background: #3a3b3c;
    border: 1px solid #1a1b1c;
    border-radius: 3px;
    color: #aaa;
    font-family: var(--font-ui);
    font-size: 8px;
    font-weight: bold;
    padding: 3px 6px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.btn-bezel:hover {
    color: #fff;
    background: #4a4b4c;
}

.btn-bezel.active {
    color: #fff;
    background: var(--theme-color);
    border-color: var(--theme-color);
    box-shadow: 0 0 6px var(--theme-glow);
    text-shadow: 0 0 2px #fff;
}

/* Physical Power Button */
.btn-power {
    background: #c93b2b;
    border: 2px solid #99281b;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: #fff;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.6);
    transition: all 0.15s ease;
}

.btn-power:hover {
    background: #e94b3b;
}

.btn-power.active {
    background: #4cd964;
    border-color: #38b549;
    box-shadow: 0 0 10px rgba(76, 217, 100, 0.8);
}

/* Bezel Bottom Detail & LED Indicator */
.bezel-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 0 10px;
}

.vent-slits {
    display: flex;
    gap: 4px;
}

.vent-slits span {
    width: 15px;
    height: 4px;
    background: #151617;
    border-radius: 1px;
}

.indicator-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3a0000;
    border: 1px solid #1a1b1c;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
}

html[data-power="on"] .indicator-led {
    background: var(--led-color);
    box-shadow: 0 0 8px var(--led-glow), inset 0 1px 1px rgba(255,255,255,0.6);
}

/* ==========================================================================
   THE CRT SCREEN (CONTAINER & SHADERS)
   ========================================================================== */

.crt-screen {
    background-color: var(--bg-color);
    border: 10px solid #1d1e1f;
    border-radius: 20px;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 
        inset 0 0 50px rgba(0,0,0,1),
        0 4px 8px rgba(0,0,0,0.5);
    transition: background-color 0.4s ease;
}

/* CRT Screen Curvature Distortion Toggle */
html[data-curve="on"] .crt-screen {
    transform: scale(1.002);
}

/* CRT Curve Shader Layer */
.crt-overlay-curve {
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.45) 85%, rgba(0, 0, 0, 0.8) 100%);
    display: none;
}
html[data-curve="on"] .crt-overlay-curve {
    display: block;
}

/* Scanlines overlay */
.crt-overlay-scanlines {
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9;
    background: repeating-linear-gradient(
        rgba(18, 16, 16, 0) 0,
        rgba(18, 16, 16, 0) 1px,
        rgba(0, 0, 0, 0.3) 2px,
        rgba(0, 0, 0, 0.3) 3px
    );
    display: none;
}
html[data-scanlines="on"] .crt-overlay-scanlines {
    display: block;
}

/* Screen Flicker Layer */
.crt-overlay-flicker {
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 8;
    background: rgba(18, 16, 16, 0.015);
    opacity: 0;
    display: none;
}
html[data-flicker="on"] .crt-overlay-flicker {
    display: block;
    animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
    0% { opacity: 0.15; }
    50% { opacity: 0.05; }
    100% { opacity: 0.18; }
}

/* Screen Glare reflection overlay */
.crt-overlay-glare {
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 11;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 20%, transparent 40%);
}

/* Screen Power off layer and collapse animation */
.crt-power-off-layer {
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 15;
    opacity: 0;
}

html[data-power="off"] .crt-power-off-layer {
    opacity: 1;
    animation: crt-shutdown 0.4s cubic-bezier(0.25, 1, 0.2, 1) forwards;
}

@keyframes crt-shutdown {
    0% {
        transform: scaleY(0.01) scaleX(1);
        background: #fff;
        box-shadow: 0 0 20px #fff;
    }
    40% {
        transform: scaleY(0.01) scaleX(0.01);
        background: #fff;
        box-shadow: 0 0 30px #fff;
    }
    100% {
        transform: scaleY(0) scaleX(0);
        background: #000;
        box-shadow: none;
    }
}

/* Power On Boot Animation Overlay */
html[data-power="on"] .crt-screen {
    animation: crt-boot-flash 0.5s ease-out forwards;
}

@keyframes crt-boot-flash {
    0% {
        filter: brightness(3) contrast(1.5);
        opacity: 0.5;
    }
    100% {
        filter: brightness(1) contrast(1);
        opacity: 1;
    }
}

/* ==========================================================================
   TERMINAL CONTAINER & CONTENT
   ========================================================================== */

.terminal-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 19px;
    line-height: 1.4;
    text-shadow: 0 0 4px var(--theme-glow);
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-color-dim) transparent;
}

.terminal-container::-webkit-scrollbar {
    width: 6px;
}

.terminal-container::-webkit-scrollbar-thumb {
    background: var(--theme-color-dim);
    border-radius: 3px;
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Boot Screen styles */
.boot-screen {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: var(--font-ui);
    font-size: 16px;
    color: var(--theme-color);
}

.boot-line {
    white-space: pre-wrap;
    opacity: 0.9;
}

.progress-line {
    font-weight: bold;
    color: var(--theme-color);
}

/* Terminal Main Workspace */
.terminal-main {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-ui);
    font-size: 14px;
    border-bottom: 1px dashed var(--theme-color-dim);
    padding-bottom: 6px;
    margin-bottom: 15px;
    opacity: 0.8;
}

.terminal-output {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Text elements styles */
h1, h2, h3, h4 {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--theme-color);
    letter-spacing: 0.5px;
}

h1 { font-size: 26px; }
h2 { font-size: 22px; border-bottom: 1px solid var(--theme-color-dim); padding-bottom: 2px; display: inline-block; }
h3 { font-size: 19px; }

pre {
    font-family: monospace;
    font-size: 11px;
    line-height: 1.1;
    white-space: pre;
    color: var(--theme-color);
    margin: 10px 0;
    overflow-x: auto;
}

a {
    color: var(--theme-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-weight: bold;
}

a:hover {
    background-color: var(--theme-color-dim);
    text-shadow: 0 0 8px var(--theme-color);
}

p {
    margin-bottom: 8px;
    text-align: justify;
    font-size: 18px;
}

ul {
    margin: 8px 0;
    padding-left: 20px;
}

li {
    list-style-type: square;
    margin-bottom: 6px;
}

/* Interactive Input Line */
.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--theme-color-dim);
}

.prompt-user {
    color: var(--theme-color);
    font-weight: bold;
}

.input-display {
    color: #fff;
    text-shadow: 0 0 5px var(--theme-glow);
    white-space: pre-wrap;
    word-break: break-all;
}

.cursor {
    display: inline-block;
    width: 10px;
    background-color: var(--theme-color);
    color: var(--theme-color);
    animation: step-blink 0.8s infinite;
}

@keyframes step-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Hidden input element off-screen */
#terminal-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* ==========================================================================
   TERMINAL QUICK NAV BAR
   ========================================================================== */

.terminal-navigation-bar {
    background: #141516;
    border-top: 2px solid #2a2b2c;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    font-family: var(--font-ui);
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-label {
    color: #6a6b6c;
    font-weight: bold;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--theme-color);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--theme-color-dim);
    box-shadow: 0 0 6px var(--theme-glow);
}

/* ==========================================================================
   COMPONENT STYLES (ls outputs, skills grid, games)
   ========================================================================== */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 10px 0;
}

.skill-card {
    border: 1px solid var(--theme-color-dim);
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.15);
}

.skill-card i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.blog-item {
    border-left: 3px solid var(--theme-color);
    padding-left: 12px;
    margin-bottom: 4px;
}

.blog-date {
    font-family: var(--font-ui);
    font-size: 12px;
    opacity: 0.65;
}

/* Custom interactive loader logs */
.composer-log {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.25;
    margin: 5px 0;
}

.composer-success {
    color: #4cd964;
}

.composer-info {
    color: #5ac8fa;
}

.composer-warning {
    color: #ffcc00;
}

/* Game Interface */
.game-panel {
    border: 2px dashed var(--theme-color);
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
    font-family: var(--font-ui);
    font-size: 16px;
}

.game-title {
    font-size: 20px;
    border-bottom: 2px double var(--theme-color-dim);
    margin-bottom: 10px;
    padding-bottom: 4px;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 6px var(--theme-glow);
}

/* ==========================================================================
   RESPONSIVENESS & MOBILE LAYOUTS
   ========================================================================== */

@media screen and (max-width: 900px) {
    body {
        padding: 5px;
    }
    
    .crt-monitor {
        border-width: 8px;
        border-radius: 18px;
        height: 100vh;
        width: 100vw;
        max-width: 100%;
        max-height: 100%;
        padding: 4px;
    }
    
    .bezel-top-panel {
        font-size: 9px;
        padding: 4px 8px;
    }
    
    .crt-screen {
        border-width: 5px;
        border-radius: 10px;
    }
    
    .terminal-container {
        padding: 12px;
        font-size: 17px;
    }
    
    pre {
        font-size: 8px;
        line-height: 1;
    }
    
    h1 { font-size: 22px; }
    h2 { font-size: 18px; }
    p { font-size: 16px; }
}

@media screen and (max-width: 550px) {
    .bezel-controls {
        gap: 6px;
    }
    
    .control-group {
        display: none; /* Hide advanced options on very small screens to fit layout */
    }
    
    .control-group:first-child {
        display: flex; /* Keep color selectors */
    }
    
    .brand-logo {
        letter-spacing: 0.5px;
    }
}