/* ---------- Global Styles ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; width: 100%; margin: 0; font-family: 'Roboto Mono', 'Courier New', monospace; }
body.dark { background: #0b0f13; color: #07aa0c; }
body.light { background: #fff; color: #222; }

.screen { height: 100vh; width: 100vw; display: flex; align-items: stretch; justify-content: stretch; }
.terminal { flex: 1; padding: 18px 20px; overflow-y: auto; scroll-behavior: smooth; box-shadow: inset 0 0 80px rgba(0,0,0,0.6); }
body.dark .terminal { background: #000; color: #07aa0c; }
body.light .terminal { background: #f9f9f9; color: #1a1a1a; box-shadow: 0 0 20px rgba(0,0,0,0.2); }

.line { white-space: pre-wrap; font-size: 14px; line-height: 1.4; margin: 6px 0; word-break: break-word; }
body.dark .line { color: #07aa0c; }
body.light .line { color: #1a1a1a; }

.prompt-row { display: flex; align-items: center; margin-top: 8px; }
.prompt-prefix { margin-right: 8px; }
body.dark .prompt-prefix { color: #7ee6ff; }
body.light .prompt-prefix { color: #ff4f79; font-weight: 700; }

.cmdline { flex: 1; background: transparent; border: none; color: inherit; font-family: inherit; font-size: 14px; outline: none; padding: 4px 6px; }
.user { font-weight: 600; }
.host { font-weight: 600; }
body.dark .user { color: #7ee6ff; } body.dark .host { color: #ffb86b; }
body.light .user { color: #ff7f50; } body.light .host { color: #1e90ff; }

.error { color: #ff6b6b; }
.output { margin-bottom: 6px; }

/* Blinking cursor */
.cmdline::after {
    content: ' ';
    display: inline-block;
    width: 8px; height: 16px;
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 1s steps(2, start) infinite;
}
body.dark .cmdline::after { background: #07aa0c; }
body.light .cmdline::after { background: #ff4f79; }
@keyframes blink { 50% { opacity: 0; } }

/* Terminal output style */
.terminal-output { font-family: "Courier New", monospace !important; white-space: pre; line-height: 1.2em; }

/* ---------- Boot Overlay ---------- */
#bootOverlay {
    position: fixed; inset: 0; padding: 30px;
    font-family: 'Courier New', monospace;
    z-index: 9999;
    overflow-y: auto;
}
body.dark #bootOverlay { background: #020204; color: #9ef08a; }
body.light #bootOverlay { background: #f9f9f9; color: #ff4f79; }
#bootOverlay .boot-lines { max-width: 900px; margin: auto; }
#bootOverlay pre { white-space: pre; font-family: monospace; margin: 0; line-height: 1.1em; }

/* ---------- Editor Modal ---------- */
#editorModal {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 90%; max-width: 900px; height: 80%; border: 1px solid #2b2b2b;
    padding: 12px; z-index: 10000; display: none; flex-direction: column;
}
body.light #editorModal { background: #fff; border: 1px solid #ccc; }
#editorModal header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6px; border-bottom: 1px solid #222; }
#editorModal textarea { flex: 1; padding: 10px; border: none; resize: none; font-family: inherit; font-size: 13px; outline: none; line-height: 1.2em; }
body.dark #editorModal textarea { background: #000; color: #07aa0c; }
body.light #editorModal textarea { background: #f9f9f9; color: #1a1a1a; }
#editorModal .controls { margin-top: 8px; text-align: right; }
.btn { background: #1e90ff; color: #fff; padding: 6px 10px; border-radius: 4px; border: none; cursor: pointer; font-family: inherit; font-weight: 600; }
.btn:hover { background: #1c86ee; }

/* ---------- Theme Switcher ---------- */
#themeSwitcher { position: fixed; top: 20px; right: 20px; z-index: 10001; }
#themeSwitcher .btn {
    font-size: 14px; padding: 10px 18px; border-radius: 30px; cursor: pointer; border: none;
    background: linear-gradient(135deg, #1e90ff, #00c6ff); color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}
#themeSwitcher .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #00c6ff, #1e90ff);
}

/* ---------- Modern Minimal Scrollbar (like ChatGPT) ---------- */
.terminal {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255,255,255,0.2) transparent; /* thumb | track */
}

/* Webkit browsers */
.terminal::-webkit-scrollbar { width: 6px; }
.terminal::-webkit-scrollbar-track { background: transparent; }
body.dark .terminal::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.2); border-radius: 999px; transition: background-color 0.3s; }
body.dark .terminal::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.4); }
body.light .terminal::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.2); border-radius: 999px; transition: background-color 0.3s; }
body.light .terminal::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, 0.4); }

/* Rocket container */
#rocket-container {
    position: fixed;
    bottom: -100px;
    left: -100px;
    width: 100px;
    height: 100px;
    pointer-events: none;
    z-index: 9999;
}

/* Rocket */
#rocket {
    width: 80px;
    height: 80px;
    animation: none;
}

/* Curved trajectory animation */
@keyframes rocketPath {
    0% {
        transform: translate(0, 0) rotate(45deg);
    }
    25% {
        transform: translate(200px, -150px) rotate(20deg);
    }
    50% {
        transform: translate(400px, -250px) rotate(0deg);
    }
    75% {
        transform: translate(650px, -350px) rotate(-20deg);
    }
    100% {
        transform: translate(900px, -500px) rotate(-45deg);
        opacity: 0;
    }
}

.rocket-launch {
    animation: rocketPath 2.5s ease-out forwards;
}
/* ========= ROCKET POPUP ========= */
/* Fullscreen transparent overlay */
#rocketPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* 🔥 FIX: Add a transparent dark backdrop */
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);

    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}


#rocketProjectInfo {
    margin-top: 25px;
    font-size: 18px;
    color: #0ff;
    text-align: center;
    max-width: 700px;
    opacity: 0;
    line-height: 1.5em;
    transition: opacity 1s ease;
}


/* Remove popup box completely */
#rocketPopupContent {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Rocket itself */
#popupRocket {
    width: 120px;
    transition: transform 1s ease;
}

/* Rocket status text */
#rocketStatus {
    margin-top: 20px;
    font-size: 22px;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* Close button */
.rocket-close {
    position: absolute;
    top: 165px;
    right: 400px;
    font-size: 40px;
    cursor: pointer;
    color: white;
    text-shadow: 0 0 5px black;
}



/* === LAUNCH ARC === */
@keyframes rocketLaunch {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(60px, -100px) rotate(20deg); }
    50%  { transform: translate(140px, -200px) rotate(40deg); }
    75%  { transform: translate(220px, -300px) rotate(60deg); }
    100% { transform: translate(300px, -380px) rotate(90deg); opacity: 0; }
}

/* === LANDING ARC === */
@keyframes rocketLand {
    0%   { transform: translate(-300px, -380px) rotate(90deg); opacity: 0; }
    25%  { transform: translate(-220px, -260px) rotate(40deg); opacity: 1; }
    50%  { transform: translate(-140px, -160px) rotate(10deg); }
    75%  { transform: translate(-60px, -80px) rotate(-10deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.launchAnim { animation: rocketLaunch 2.3s ease-out forwards; }
.landAnim   { animation: rocketLand 2.3s ease-out forwards; }

#rocketStatus {
    text-align: center;
    color: #0ff;
    margin-top: 10px;
    font-size: 16px;
}

/* Robot popup */
#robotPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

#robotPopup img {
    position: absolute;
    transition: all 1s ease-in-out;   /* removed width: 320px */
}

/* Robot size = 100px */
#robot {
    position: absolute;
    width: 100px;                     /* ← your preferred size */
    transition: all 2s ease;
    z-index: 2;
}

/* Doctor size = 220px */
#doctor {
    position: absolute;
    width: 220px;
    right: 50px;
    bottom: 550px;
    z-index: 1;
}

#robotProjectInfo {
    margin-top: 25px;
    font-size: 18px;
    color: #0ff;
    text-align: center;
    max-width: 700px;
    opacity: 0;
    line-height: 1.5em;
    transition: opacity 1s ease;
}

#robotStatus {
    margin-top: 20px;
    font-size: 22px;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* Spy popup */
#spyPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

#spyPopup img {
    position: absolute;
    transition: all 1.5s ease-in-out;
}

/* Spy and enemy initial sizes */
#spy { width: 120px; left: 50px; bottom: 50px; z-index: 2; }
#enemy { width: 150px; right: 50px; bottom: 50px; z-index: 1; }

/* Explosion / destroy effect */
@keyframes destroyEnemy {
    0%   { transform: scale(1) rotate(0deg); opacity: 1; }
    50%  { transform: scale(1.2) rotate(15deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(720deg); opacity: 0; }
}
.destroyAnim { animation: destroyEnemy 1s ease-out forwards; }

#spyProjectInfo {
    margin-top: 25px;
    font-size: 18px;
    color: #0ff;
    text-align: center;
    max-width: 700px;
    opacity: 0;
    line-height: 1.5em;
    transition: opacity 1s ease;
}

#spyStatus {
    margin-top: 20px;
    font-size: 22px;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* Spy curved path animation */
@keyframes spyPath {
    0%   { left: 50px; bottom: 50px; transform: rotate(0deg); }
    25%  { left: 30%; bottom: 40%; transform: rotate(15deg); }
    50%  { left: 60%; bottom: 60%; transform: rotate(-15deg); }
    75%  { left: 75%; bottom: 30%; transform: rotate(30deg); }
    100% { left: calc(100% - 200px); bottom: 50px; transform: rotate(0deg); }
}
.spyMove { animation: spyPath 2.5s ease-in-out forwards; }

/* Enemy shatter pieces */
.enemyPiece {
    position: absolute;
    width: 30px; height: 30px;
    background-image: url('assets/img/enemy.png');
    background-size: cover;
    opacity: 1;
}
#fireContainer {
    position: absolute;
    width: 150px;
    height: 150px;
    pointer-events: none;
    z-index: 5;
    display: none; /* will show during attack */
}

#fireContainer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


@keyframes scatterPiece {
    0%   { transform: translate(0,0) rotate(0deg); opacity:1; }
    100% { transform: translate(var(--x), var(--y)) rotate(var(--rot)); opacity:0; }
}






/* ---------- Experience Popup ---------- */
#experiencePopup {
    position: fixed;
    top:0; left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display:none;
    justify-content:center;
    align-items:center;
    flex-direction:column;
    z-index:9999;
}

#experiencePopup img {
    position:absolute;
    width: 260px;
    transition: all 1s ease;
}

#progImg { left: -150px; bottom: 200px; }
#iotDeviceImg { right: -150px; bottom: 200px; }
#robotImg { 
    width: 280px; 
    z-index:5; 
    position: absolute;
    transition: all 1.5s ease-in-out;
}

#experienceProjectInfo {
    margin-top: 25px;
    font-size: 18px;
    color: #0ff;
    text-align: center;
    max-width: 700px;
    opacity: 0;
    line-height: 1.5em;
    transition: opacity 1s ease;
}

@keyframes moveLeftToCenter {
    0% { left: -150px; }
    100% { left: calc(50% - 150px); }
}

@keyframes moveRightToCenter {
    0% { right: -150px; }
    100% { right: calc(50% - 150px); }
}

.collideLeft { animation: moveLeftToCenter 2s ease-in-out forwards; }
.collideRight { animation: moveRightToCenter 2s ease-in-out forwards; }
















/* Experience Detail 2 Popup */
#experiencePopup2 {
    position: fixed;
    top:0; left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display:none;
    justify-content:center;
    align-items:center;
    flex-direction:column;
    z-index:9999;
}

#experiencePopup2 img {
    position:absolute;
    transition: all 1.5s ease-in-out;
}

#personMain { 
    width: 200px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

#p1, #p2, #p3, #p4, #p5, #p6 {
    width: 120px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
}

/* Keyframes for moving to corners */
@keyframes moveToCorner {
    to {
        left: var(--left);
        top: var(--top);
        transform: translate(0,0);
        opacity: 1;
    }
}

/* Main person moves to top center */
@keyframes movePersonTop {
    from {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    to {
        top: -10px;       /* distance from top */
        left: 50%;
        transform: translateX(-50%);
    }
}

#personMain {
    position: absolute;
}


#experienceProjectInfo2 {
    margin-top: 25px;           /* same as experienceProjectInfo */
    font-size: 18px;            /* same size */
    color: #0ff;                /* cyan text */
    text-align: center;         /* center aligned */
    max-width: 900px;           /* same max width */
    line-height: 1.5em;         /* same line spacing */
    transition: opacity 1s ease;
}

#experienceProjectInfo2 strong {
    color: white;               /* heading color same as exp 1 */
    text-shadow: 0 0 10px rgba(255,255,255,0.8); /* same glow effect */
    font-size: 30px;            /* heading size same as exp 1 */
    display: block;
    margin-bottom: -50px;
}













/* ===============================
   EXPERIENCE POPUP (CSS)
   =============================== */

#expPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

#expPopup img {
    position: absolute;
    transition: all 600ms ease;
    pointer-events: none;
}

/* Scientist */
#expScientist {
    width: 140px;
    left: 40px;
    bottom: 40px;
    z-index: 20;
}

/* Jet */
#expJet {
    width: 220px;
    left: 10%;
    top: 10%;
    z-index: 15;
}

/* Terrorist bunker */
#expBunker {
    width: 240px;
    right: 8%;
    bottom: 40px;
    z-index: 10;
}

/* Target */
#expTarget {
    width: 100px;
    z-index: 30;
    transform-origin: center;
}

/* Missile */
/* Missile */
#expMissile {
    width: 120px;   /* increase from 80px to 120px */
    z-index: 25;
    position: absolute;
    pointer-events: none;
}


/* Fire blast */
#expBlastContainer {
    position: absolute;
    display: none;
    width: 220px;
    height: 220px;
    pointer-events: none;
    z-index: 100000;
}

/* Missile launch transition curve */
.exp-launch {
    transition: all 1200ms cubic-bezier(.2, .9, .2, 1);
}

/* Text */
#expStatus {
    margin-top: 18px;
    font-size: 22px;
    color: white;
    text-shadow: 0 0 6px rgba(0,0,0,0.7);
    z-index: 2000;
}

#expInfo {
    margin-top: 22px;
    font-size: 18px;
    color: #0ff;
    text-align: center;
    max-width: 700px;
    opacity: 0;
    z-index: 2000;
}



/* ---------- Awards Popup ---------- */
#awardsPopup {
    position: fixed;
    top:0; left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 20px;
    z-index: 9999;
    overflow-y: auto;
}

/* Title */
#awardsTitle {
    color: #0ff;
    text-align: center;
    font-size: 28px;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(0,255,255,0.7);
}

/* Awards container */
#awardsContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    max-width: 1200px;
}

/* Each award wrapper */
.awardItem {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.awardItem img {
    width: 180px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,255,255,0.5);
    transition: all 0.3s ease;
}

.awardItem span {
    margin-top: 8px;
    color: #0ff;
    text-align: center;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(0,255,255,0.6);
}

/* Modal */
#awardModal {
    position: fixed;
    top:0; left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10000;
    cursor: pointer;
}

#awardModal img {
    max-width: 70%;
    max-height: 70%;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,255,255,0.9);
}

#awardModal #modalTitle {
    color: #0ff;
    font-size: 22px;
    margin-top: 15px;
    text-align: center;
    text-shadow: 0 0 10px rgba(0,255,255,0.7);
}

/* Close buttons */
#closeAwardsPopup, #closeAwardModal {
    position: absolute;
    top: 100px;
    right: 60px;
    font-size: 30px;
    color: #0ff;
    cursor: pointer;
    z-index: 10001;
    text-shadow: 0 0 8px rgba(0,255,255,0.7);
}

#closeAwardsButton {
    margin-top: 30px;
    padding: 10px 25px;
    font-size: 18px;
    color: #0ff;
    background: transparent;
    border: 2px solid #0ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0,255,255,0.7);
}

#closeAwardsButton:hover {
    background: #0ff;
    color: #000;
    text-shadow: none;
}

/* Mobile-friendly close button styling */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9999;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .close-btn {
        font-size: 1.2rem;
        top: 5px;
        right: 5px;
    }
}

/* Ensure popups are positioned relatively */
.popup {
    position: relative;
}

.modal-content {
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-dialog {
    margin: 0; /* remove default margins */
}















/* ---------- Responsive ---------- */
@media(max-width:800px){
    .line{font-size:13px;}
    .cmdline{font-size:13px;}
    #editorModal textarea{font-size:12px;}
    #themeSwitcher .btn{padding:8px 14px; font-size:13px;}
}
@media(max-width:500px){
    .line{font-size:12px;}
    .cmdline{font-size:12px;}
    #editorModal textarea{font-size:11px;}
    #themeSwitcher .btn{padding:6px 12px; font-size:12px;}
}
