/* =========================================
   1. GENERAL STYLES & RESET
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Josefin Sans', sans-serif;
    background-color: #0b1a3d;
    color: #ffffff;
    overflow-x: hidden;
    cursor: auto; /* FIX: Restore default mouse */
}

section {
    padding: 100px 20px;
    position: relative;
    z-index: 5;
}

h1, h2, h3 {
    font-weight: 700;
}

h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: #ffffff;
}

a {
    text-decoration: none;
    color: inherit;
    cursor: pointer; /* FIX: Standard hand cursor */
}

/* Ensure buttons and interactives show the hand cursor */
button, .hamburger, .admin-btn, .noc-clock, .carousel-btn, .hop-line, .close-modal {
    cursor: pointer;
}

html {
    scroll-behavior: smooth;
}

/* Scroll offset fix for fixed navbar */
:target::before {
    content: "";
    display: block;
    height: 80px;
    margin-top: -80px;
}


/* =========================================
   2. SCROLL PROGRESS BAR
   ========================================= */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%; 
    height: 4px;
    background-color: #ffffff; 
    z-index: 99999;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}


/* =========================================
   3. NAVBAR STYLES
   ========================================= */
.navbar {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: transparent;
    z-index: 1000;
    transition: background-color 0.4s ease, padding 0.4s ease;
}

.navbar.scrolled {
    background-color: rgba(11, 26, 61, 0.95);
    padding: 15px 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar .logo a {
    color: #ffffff;
    font-weight: bold;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.navbar .logo a:hover {
    color: #00d9ff; 
}

.navbar .nav-links {
    display: flex;
    align-items: center;
}

.navbar .nav-links a {
    margin-left: 30px;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s;
}

.navbar .nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #00d9ff;
    transition: width 0.3s ease-out;
}

.navbar .nav-links a:hover::after,
.navbar .nav-links a.active::after {
    width: 100%;
}

.navbar .nav-links a.active {
    color: #00d9ff;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 5px 0;
    transition: 0.4s;
}


/* =========================================
   4. HERO SECTION & NOC CLOCK
   ========================================= */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
    padding-top: 80px; 
}

/* === UPDATED NOC CLOCK STYLES === */
.noc-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem; 
    color: #00d9ff;
    
    margin-top: -80px; 
    margin-bottom: 40px;
    
    padding: 15px 35px; 
    border: 2px solid rgba(0, 217, 255, 0.4); 
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

.noc-clock:hover {
    background: rgba(0, 217, 255, 0.15);
    border-color: #00d9ff;
    text-shadow: 0 0 15px rgba(0, 217, 255, 0.8);
    transform: scale(1.05);
}

.hero h1 {
    font-size: 4.5rem;
    margin: 0;
    font-weight: 700;
}

.hero h2.typing {
    font-size: 2.5rem;
    margin-top: 20px;
    min-height: 3rem;
    color: #00d9ff;
}

/* Background Fading Images */
.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.bg-image.active {
    opacity: 1;
}

/* --- IMAGE PATHS --- */
.image1 { background-image: linear-gradient(rgba(11,26,61,0.6), rgba(11,26,61,0.6)), url('../images/20241209_171209~2.jpg'); }
.image2 { background-image: linear-gradient(rgba(11,26,61,0.6), rgba(11,26,61,0.6)), url('../images/20240904_184201.jpg'); }
.image3 { background-image: linear-gradient(rgba(11,26,61,0.6), rgba(11,26,61,0.6)), url('../images/20241211_141332.jpg'); }
.image4 { background-image: linear-gradient(rgba(11,26,61,0.6), rgba(11,26,61,0.6)), url('../images/20241211_144437.jpg'); }
.image5 { background-image: linear-gradient(rgba(11,26,61,0.6), rgba(11,26,61,0.6)), url('../images/20250513_122740.jpg'); }
.image6 { background-image: linear-gradient(rgba(11,26,61,0.6), rgba(11,26,61,0.6)), url('../images/20250513_123056.jpg'); }
.image7 { background-image: linear-gradient(rgba(11,26,61,0.6), rgba(11,26,61,0.6)), url('../images/20250514_092645.jpg'); }
.image8 { background-image: linear-gradient(rgba(11,26,61,0.6), rgba(11,26,61,0.6)), url('../images/20250514_134216.jpg'); }


/* =========================================
   5. EXPERIENCE CARDS / BLOG CARDS
   ========================================= */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.card {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    flex: 1 1 300px;
    max-width: 350px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: #00d9ff;
}

.card h3 { color: #00d9ff; margin-bottom: 10px; }
.card h4 { color: #ccc; margin-bottom: 15px; font-weight: 400; }

/* === BLOG SECTION SPECIFIC STYLES === */
.blog-card h4 {
    color: #00d9ff;
    font-size: 0.9rem;
    margin-top: -5px;
    margin-bottom: 15px;
    opacity: 0.8;
}


/* =========================================
   6. PROJECTS CAROUSEL
   ========================================= */
.projects {
    overflow: hidden;
}

.carousel-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-container {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
}

.carousel-track {
    display: flex;
    gap: 30px;
    transition: transform 0.5s ease-in-out;
    padding-left: 15px; /* Slight offset for first item */
}

/* The Square Box */
.project-card {
    min-width: 280px; 
    height: 280px;    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer; /* FIX: Hand cursor */
}

.project-card:hover {
    transform: scale(1.05);
    border-color: #00d9ff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 5px 25px rgba(0, 217, 255, 0.15);
}

.project-content h3 {
    color: #00d9ff;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.project-content p {
    font-size: 0.9rem;
    color: #bbb;
    margin-bottom: 25px;
    line-height: 1.5;
}

.project-content a {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(0, 217, 255, 0.1);
    color: #fff;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.3s;
    cursor: pointer;
}

.project-content a:hover {
    background: #00d9ff;
    color: #0b1a3d;
}

/* Carousel Buttons */
.carousel-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 2rem;
    cursor: pointer;
    padding: 0 15px;
    z-index: 10;
    transition: color 0.3s;
}

.carousel-btn:hover {
    color: #00d9ff;
    transform: scale(1.2);
}


/* =========================================
   7. ADMIN DASHBOARD GRID
   ========================================= */
.admin-container { 
    max-width: 800px; 
    margin: 0 auto; 
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    padding: 20px;
}

.admin-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #00d9ff;
    padding: 30px;
    border-radius: 15px;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s;
    height: 160px;
    cursor: pointer;
}

.admin-btn i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #00d9ff;
    transition: color 0.3s;
}

.admin-btn span {
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-btn:hover {
    background: #00d9ff;
    color: #0b1a3d;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.3);
}

.admin-btn:hover i {
    color: #0b1a3d;
}

/* Secondary / Disabled Buttons */
.admin-btn.secondary {
    border-color: rgba(255,255,255,0.3);
}
.admin-btn.secondary i { color: rgba(255,255,255,0.7); }
.admin-btn.secondary:hover { background: white; color: #0b1a3d; }
.admin-btn.secondary:hover i { color: #0b1a3d; }

.admin-btn.disabled {
    opacity: 0.4;
    border-color: #555;
    pointer-events: none;
    filter: grayscale(100%);
    cursor: not-allowed;
}


/* =========================================
   8. SOCIALS & FOOTER
   ========================================= */
.socials {
    background-color: rgba(0, 0, 0, 0.2); 
}

.social-links-container {
    display: flex;
    justify-content: center;
    gap: 25px; 
}

.social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%; 
    transition: all 0.3s;
    cursor: pointer;
}

.social-link i {
    font-size: 24px; 
    color: #ffffff;
}

.social-link:hover {
    background-color: #00d9ff; 
    transform: translateY(-5px); 
}
.social-link:hover i { color: #0b1a3d; }

.footer {
    text-align: center;
    padding: 30px;
    background-color: rgba(11, 26, 61, 0.95);
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    margin-top: 50px;
}


/* =========================================
   9. RESPONSIVE DESIGN (MOBILE)
   ========================================= */
@media(max-width: 768px) {
    .navbar { padding: 15px 20px; }
    .navbar.scrolled { padding: 10px 20px; }

    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 60px; 
        height: calc(100vh - 60px);
        width: 70%;
        background-color: rgba(11, 26, 61, 0.98);
        flex-direction: column;
        justify-content: center;
        transition: right 0.4s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }
    .nav-links.active { right: 0; }
    .nav-links a { margin: 25px 0; font-size: 1.3rem; }

    .hero h1 { font-size: 3rem; }
    .hero h2.typing { font-size: 1.5rem; }
    
    .noc-clock { font-size: 1.5rem; margin-top: -40px; }

    /* === FIX CAROUSEL ON MOBILE === */
    .carousel-wrapper { width: 100%; padding: 0 10px; }
    .carousel-container { width: 100%; overflow: visible; }
    .carousel-track { 
        display: flex; gap: 20px; overflow-x: auto; 
        padding: 10px 0 30px 0; scroll-snap-type: x mandatory; 
        width: 100%; transform: none !important; 
    }
    .project-card { 
        min-width: 85vw; max-width: 85vw; 
        scroll-snap-align: center; margin-right: 0; flex-shrink: 0; 
    }
    .carousel-btn { display: none; }

    /* === TERMINAL MOBILE TWEAKS === */
    /* Hide the 2nd and 3rd latency numbers (ms) to save space */
    .hop-time:nth-child(5), .hop-time:nth-child(6) { display: none; }
    
    /* Ensure the Date (IP) is visible */
    .hop-ip { display: inline-block !important; font-size: 0.8rem; }
    
    .travel-preview { display: none !important; }

    /* Modal Tweaks */
    .modal-window { width: 95%; max-height: 85vh; }
    .modal-header { padding: 10px 15px; }
    .header-title { font-size: 1rem; }
    .close-modal { font-size: 2rem; }
}


/* =========================================
   10. TERMINAL TRAVELS SECTION
   ========================================= */
.travels {
    background: #0b1a3d;
    display: flex;
    flex-direction: column; /* Fixes layout */
    justify-content: center;
    align-items: center;
    padding-bottom: 100px;
}

.terminal-window {
    width: 90%;
    max-width: 900px;
    background-color: #0f0f0f; /* Pure black/grey terminal bg */
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    position: relative;
    border: 1px solid #333;
}

/* Mac-style Window Header */
.terminal-header {
    background-color: #2d2d2d;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #333;
}

.traffic-light { width: 12px; height: 12px; border-radius: 50%; }
.traffic-light.red { background-color: #ff5f56; }
.traffic-light.yellow { background-color: #ffbd2e; }
.traffic-light.green { background-color: #27c93f; }

.terminal-title {
    margin-left: 15px;
    color: #999;
    font-size: 0.8rem;
}

/* Terminal Body */
.terminal-body {
    padding: 20px;
    color: #00ff00; /* Classic Terminal Green */
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 400px;
}

.prompt { color: #00d9ff; margin-right: 10px; } /* Cyan User Prompt */
.cmd { color: #ffffff; }

.trace-output { margin-top: 15px; }
.trace-header { color: #ccc; margin-bottom: 10px; }

/* The Hop Lines */
.hop-line {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 2px 5px;
    cursor: crosshair; /* Adds to the tech feel */
    transition: background 0.1s;
    color: #00ff00;
}

.hop-line:hover {
    background-color: rgba(0, 255, 0, 0.1);
    color: #fff;
}

.hop-num { color: #666; width: 20px; text-align: right; }
.hop-host { color: #fff; font-weight: bold; }
.hop-ip { color: #888; }
.hop-time { color: #00ff00; }

/* Blinking Cursor */
.active-prompt { margin-top: 20px; }
.cursor {
    animation: blink 1s step-end infinite;
    color: #00d9ff;
    font-weight: bold;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* === HOVER IMAGE PREVIEW === */
.travel-preview {
    position: fixed;
    display: none; /* Hidden by default */
    pointer-events: none; /* Let mouse clicks pass through */
    z-index: 9999;
    padding: 5px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00d9ff;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.travel-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 3px;
    display: block;
}

/* === POP-OUT WINDOW MODAL === */
.travel-modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 100000; /* Above everything */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.8); /* Dim background */
    backdrop-filter: blur(3px);
    
    /* Flex Center to put window in middle of screen */
    align-items: center;
    justify-content: center;
}

/* Ensure flex applies when JS toggles it */
.travel-modal[style*="display: flex"] {
    display: flex !important;
}

.modal-window {
    background: #0b1a3d; /* Dark Navy Background */
    width: 90%;
    max-width: 800px;
    max-height: 90vh; /* Never taller than 90% of screen */
    border: 1px solid #00d9ff;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 217, 255, 0.2);
    display: flex;
    flex-direction: column; /* Stack Header and Body */
    position: relative;
    animation: popOut 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popOut {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- Window Header (Fixed at top of box) --- */
.modal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.header-title {
    color: #00d9ff;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
}

.close-modal:hover {
    color: #ff4757; /* Red on hover */
}

/* --- Window Body (Scrolls internally) --- */
.modal-body {
    padding: 20px;
    overflow-y: auto; /* SCROLL HERE, not the whole page */
    text-align: center;
}

#modal-img {
    width: 100%;
    height: auto;
    max-height: 50vh; /* Ensure image fits nicely */
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #333;
    background: #000;
}

#modal-desc {
    margin-top: 20px;
    color: #ccc;
    font-size: 1rem;
    line-height: 1.6;
    font-family: 'Josefin Sans', sans-serif;
    text-align: left; /* Easier to read */
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .modal-window {
        width: 95%;
        max-height: 85vh; /* slightly shorter on mobile */
    }
    
    .modal-header { padding: 10px 15px; }
    .header-title { font-size: 1rem; }
    .close-modal { font-size: 2rem; }
}