/* CORE FONTS */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-cyan: #00ffff;
    --primary-green: #00ff00;
    --terminal-amber: #ffb000;
    --bg-dark: #0a0a0a;
    --glow-cyan: rgba(0, 255, 255, 0.5);
}

/* GLOBAL */
body {
    font-family: 'Share Tech Mono', monospace;
    background: var(--bg-dark);
    color: var(--primary-green);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

html {
    height: 100vh;
    width: 100vw;
}

/* MATRIX RAIN */
#matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.3;
}

/* GLITCH OVERLAY */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 19;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 0, 255, 0.1) 50%, transparent 70%);
    animation: glitch-flicker 0.15s infinite;
}

@keyframes glitch-flicker {
    0% { opacity: 0; }
    50% { opacity: 0.1; }
    100% { opacity: 0; }
}

/* TERMINAL WINDOW */
.cyber-terminal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95), rgba(5, 5, 5, 0.98));
    border: 2px solid var(--primary-cyan);
    border-radius: 10px;
    box-shadow: 
        0 0 30px var(--glow-cyan),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    z-index: 10;
    display: flex;
    flex-direction: column;
    animation: terminal-appear 1s ease-out;
    overflow: hidden;
}

@keyframes terminal-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0);
    }
}

/* TERMINAL HEADER */
.terminal-header {
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.1), rgba(0, 255, 0, 0.1));
    border-bottom: 1px solid var(--primary-cyan);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control.close { background: #ff5f56; }
.control.minimize { background: #ffbd2e; }
.control.maximize { background: #27c93f; }

.control:hover {
    transform: scale(1.2);
    filter: brightness(1.5);
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--glow-cyan);
    font-size: 16px;
}

.signal-indicator {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin-left: 1px;
}

.signal-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--glow-cyan);
    animation: signal-blink 1.2s infinite ease-in-out;
	
}

.signal-dot:nth-child(1) { animation-delay: 0s; }
.signal-dot:nth-child(2) { animation-delay: 0.2s; }
.signal-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes signal-blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* GLITCH TEXT */
.glitch-text {
    position: relative;
    animation: glitch-text 2s infinite;
}

@keyframes glitch-text {
    0%, 100% {
        text-shadow: 
            0.05em 0 0 #ff0040,
            -0.05em 0 0 var(--primary-cyan);
    }
    50% {
        text-shadow: 
            0.05em 0 0 #ff00ff,
            -0.05em 0 0 #ffff00;
    }
}

/* TERMINAL BODY */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}

/* BOOT SEQUENCE */
.boot-sequence {
    margin-bottom: 20px;
}

.boot-line {
    color: var(--terminal-amber);
    margin: 5px 0;
    opacity: 0;
    animation: boot-fade-in 0.5s ease-out forwards;
    font-size: 14px;
}

.boot-line:nth-child(1) { animation-delay: 1.5s; }
.boot-line:nth-child(2) { animation-delay: 2.5s; }
.boot-line:nth-child(3) { animation-delay: 4.0s; }
.boot-line:nth-child(4) { animation-delay: 5.0s; }
.boot-line:nth-child(5) { animation-delay: 7.0s; }
.boot-line:nth-child(6) { animation-delay: 8.5s; }

@keyframes boot-fade-in {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* PROJECTS OUTPUT */
.terminal-content {
    color: var(--primary-green);
    font-size: 14px;
    line-height: 1.6;
    white-space: normal;
}

.green {
    color: var(--primary-cyan);
    text-shadow: 0 0 8px var(--glow-cyan);
    font-weight: bold;
    transition: all 0.2s ease;
}

.terminal-content:hover .green {
    color: var(--primary-cyan);
}

.project-link {
    color: var(--primary-green);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(90deg, var(--primary-cyan) 0%, var(--primary-cyan) 0%, transparent 0%);
    background-repeat: no-repeat;
    background-size: 0% 2px;
    background-position: left bottom;
    transition: background-size 0.4s ease, color 0.2s ease;
}

.project-link:hover {
    color: var(--primary-cyan);
    text-shadow: 0 0 8px var(--glow-cyan);
    background-size: 100% 2px;
}

/* SCREENSHOT PREVIEW */
.screenshot-preview {
    position: absolute;
    top: 30px;
    right: 20px;
    width: 400px;
    height: 250px;
    background: rgba(5, 5, 5, 0.9);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

.screenshot-preview.show {
    opacity: 1;
    transform: translateX(0);
    animation: screenshot-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes screenshot-slide-in {
    from {
        transform: translateX(450px);
    }
    to {
        transform: translateX(0);
    }
}

#screenshot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.screenshot-img-empty {
    display: none;
}

.screenshot-glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    animation: screenshot-glitch 0.15s infinite;
}

.screenshot-preview.show .screenshot-glitch {
    opacity: 0.05;
}

@keyframes screenshot-glitch {
    0% { transform: translateX(0); opacity: 0.05; }
    25% { transform: translateX(-2px); opacity: 0.08; }
    50% { transform: translateX(2px); opacity: 0.05; }
    75% { transform: translateX(-1px); opacity: 0.08; }
    100% { transform: translateX(0); opacity: 0.05; }
}

.terminal-logo {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 100px;
    height: 100px;
    opacity: 0;
    transition: opacity 1s ease, transform 0.3s ease;
    cursor: pointer;
    z-index: 20;
}

.terminal-logo:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 12px var(--primary-cyan));
    animation: logo-glitch 0.25s steps(2, end);
}

@keyframes logo-glitch {
    0% { transform: scale(1.08) translate(0,0); }
    25% { transform: scale(1.08) translate(-2px, 1px); }
    50% { transform: scale(1.08) translate(2px, -1px); }
    75% { transform: scale(1.08) translate(-1px, -2px); }
    100% { transform: scale(1.08) translate(0,0); }
}

/* TABLET */
@media (max-width: 1200px) {
    .screenshot-preview {
        width: 320px;
        height: 200px;
    }
}

/* MOBILE - FULL WIDTH TERMINAL */
@media (max-width: 768px) {
    html, body {
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }

    .cyber-terminal {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 95%;
        max-width: none;
        height: 90vh;
        max-height: none;
    }

    .terminal-title {
        font-size: 14px;
        gap: 10px;
    }

    .terminal-body {
        padding: 15px;
        font-size: 16px;
        line-height: 1.8;
    }

    .boot-line {
        font-size: 16px;
        margin: 8px 0;
    }

    .terminal-content {
        font-size: 16px;
    }

    .screenshot-preview {
        display: none;
    }

    .terminal-logo {
        width: 70px;
        height: 70px;
        bottom: 10px;
        right: 10px;
    }
}

/* SMALL MOBILE */
@media (max-width: 480px) {
    html, body {
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }

    .cyber-terminal {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 98%;
        height: 95vh;
        max-height: none;
        max-width: none;
    }

    .terminal-header {
        padding: 8px 10px;
    }

    .terminal-title {
        font-size: 12px;
        gap: 8px;
    }

    .terminal-controls {
        gap: 6px;
    }

    .control {
        width: 10px;
        height: 10px;
    }

    .terminal-body {
        padding: 12px;
        font-size: 14px;
        line-height: 1.6;
    }

    .boot-line {
        font-size: 14px;
        margin: 6px 0;
    }

    .terminal-content {
        font-size: 14px;
    }

    .boot-sequence {
        margin-bottom: 15px;
    }

    .terminal-logo {
        width: 60px;
        height: 60px;
        bottom: 8px;
        right: 8px;
    }

    .signal-dot {
        width: 5px;
        height: 5px;
    }

    .signal-indicator {
        gap: 3px;
    }
}