/* CSS Variables for Dark Forest Tech Theme */
:root {
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --neon-blue: #00f2fe;
    --neon-purple: #ab47bc;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Theme-specific variables (Dark Mode Defaults) */
    --bg-body: #05080e;
    --bg-overlay: radial-gradient(circle at 15% 50%, rgba(0, 242, 254, 0.05), transparent 50%),
                  radial-gradient(circle at 85% 30%, rgba(171, 71, 188, 0.05), transparent 50%),
                  #05080e;
    --glass-bg: rgba(10, 15, 25, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --navbar-bg: rgba(5, 8, 14, 0.7);
    --navbar-scrolled: rgba(5, 8, 14, 0.9);
    --card-bg: rgba(15, 23, 42, 0.7);
    --card-hover-to: rgba(8, 145, 178, 0.5);
}

.light-theme {
    --bg-body: #f8fafc;
    --bg-overlay: radial-gradient(circle at 15% 50%, rgba(0, 242, 254, 0.08), transparent 50%),
                  radial-gradient(circle at 85% 30%, rgba(171, 71, 188, 0.08), transparent 50%),
                  #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 242, 254, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --navbar-bg: rgba(255, 255, 255, 0.7);
    --navbar-scrolled: rgba(255, 255, 255, 0.9);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-hover-to: rgba(0, 242, 254, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Image Overlay targeting the Forest Theme Requirement */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: var(--bg-overlay);
}

/* Typography Customizations */
h1, h2, h3, h4, .logo {
    font-family: var(--font-heading);
    font-weight: 800;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Utility Classes */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 242, 254, 0.4);
}

/* Base Components (Buttons & Navigation) */
.btn-primary, .btn-secondary, .btn-primary-small {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary-small {
    padding: 0.5rem 1.5rem;
    background: var(--primary-gradient);
    color: #000;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #05080e;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover, .btn-primary-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--neon-blue);
}

/* Sections Global */
.section-spacing {
    padding: 4rem 10% 2.5rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Hero Section */
/* Animations Triggered by Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hero h1 {
        font-size: 3rem;
    }
    .contact-links {
        flex-direction: column;
        gap: 1rem;
    }
    .btn-primary-small {
        display: none;
    }
}

/* ========================================
   Nav Dropdown Submenu
   ======================================== */
.nav-item-dropdown {
    position: relative;
}

.nav-chevron {
    font-size: 0.7rem;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-body);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem 0;
    padding-top: 14px;
    list-style: none;
    min-width: 220px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-dropdown li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav-dropdown li a i { color: var(--neon-blue); font-size: 0.85rem; }

.nav-dropdown li a:hover {
    color: var(--neon-blue);
    background: rgba(0, 242, 254, 0.06);
}

.nav-item-dropdown:hover .nav-dropdown { display: block; }
.nav-item-dropdown:hover .nav-chevron { transform: rotate(180deg); }

/* ========================================
   Portfolio Card CTA Row
   ======================================== */
.portfolio-card { cursor: pointer; user-select: none; }

.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-cta {
    color: var(--neon-blue);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-card:hover .card-cta {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   Modal System
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
    animation: modalBgIn 0.25s ease;
}

@keyframes modalBgIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    position: relative;
    max-width: 820px;
    width: 100%;
    margin: auto;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-body);
    border: 1px solid var(--glass-border);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 1;
}

.modal-close:hover { background: rgba(0,242,254,0.15); color: var(--neon-blue); }

.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 2rem 2rem 0;
}

.modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--neon-blue);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.modal-tags .tech-tag { font-size: 0.75rem; }

/* Media section: side-by-side screenshot + video */
.modal-media {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem 2rem;
}

.modal-screenshot {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    object-fit: cover;
    max-height: 200px;
}

.modal-video-placeholder {
    border-radius: 10px;
    border: 1px dashed rgba(0,242,254,0.25);
    background: rgba(0,242,254,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.video-placeholder-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
}

.video-placeholder-inner i {
    font-size: 2.5rem;
    color: var(--neon-blue);
    opacity: 0.5;
}

.video-placeholder-inner span { font-size: 0.9rem; font-weight: 500; }
.video-placeholder-inner small { font-size: 0.75rem; opacity: 0.6; }

.modal-media video {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    max-height: 200px;
    object-fit: cover;
}

/* Modal body text */
.modal-body {
    padding: 0 2rem 2rem;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

.modal-body h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--neon-blue);
    margin-bottom: 0.75rem;
    font-family: var(--font-heading);
}

.modal-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-features li i {
    color: var(--neon-blue);
    font-size: 0.85rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.modal-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Responsive modal */
@media (max-width: 600px) {
    .modal-media { grid-template-columns: 1fr; }
    .modal-header { flex-direction: column; }
    .modal-header h2 { font-size: 1.3rem; }
}

/* ========================================
   Theme Toggle Button
   ======================================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--neon-blue);
    transform: rotate(15deg);
}

.theme-toggle i {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme .theme-toggle i {
    transform: rotate(360deg);
}

/* Adjusting elements for Light mode */
.light-theme .nav-links a {
    color: #1e293b;
}
.light-theme .nav-links a:hover {
    color: var(--neon-blue);
}
.light-theme .logo {
    color: #0f172a;
}
.light-theme .btn-secondary {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.5);
}
.light-theme .tech-tag {
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.2);
    color: #0369a1;
}

.tech-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--neon-blue);
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}
