/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Space+Grotesk:wght@300;400;600;700&display=swap');

:root {
    /* Light Mode (Default) */
    --bg: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent-blue: #007bff;
    --accent-purple: #6f42c1;
    --glass-border: rgba(0, 0, 0, 0.1);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --star-color: #1a1a1a;
    --header-bg: rgba(255, 255, 255, 0.9);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-color: #e0e0e0;
}

body.dark-mode {
    /* Dark Mode */
    --bg: #050510;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-blue: #00f3ff;
    --accent-purple: #bc13fe;
    --glass-border: rgba(255, 255, 255, 0.08);
    --star-color: #fff;
    --header-bg: rgba(5, 5, 16, 0.7);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --border-color: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Shooting Stars */
.shooting-star {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: var(--star-color);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 0 20px var(--star-color);
    animation: shooting-star-animation 3s linear infinite;
    z-index: 1;
    opacity: 0;
}

/* Update shadow for light mode visibility if needed, or use a variable for shadow opacity */
body:not(.dark-mode) .shooting-star {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05),
        0 0 0 2px rgba(0, 0, 0, 0.05),
        0 0 20px var(--star-color);
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, var(--star-color), transparent);
    animation: shooting-star-trail 3s linear infinite;
}

#moon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 600px;
    height: auto;
    z-index: 3;
    pointer-events: none;
    opacity: 1;
    max-width: none;
    min-width: 0;
    display: block;
    box-sizing: content-box;
    border: none;
    background: none;
    object-fit: contain;
    /* Invert moon color in light mode if needed, or keep as is if it's an image that works on both */
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

body:not(.dark-mode) #moon {
    filter: invert(1) drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
}

@keyframes shooting-star-animation {
    0% {
        transform: rotate(var(--star-angle, 45deg)) translateX(0);
        opacity: 1;
    }

    70% {
        opacity: 1;
    }

    100% {
        transform: rotate(var(--star-angle, 45deg)) translateX(1000px);
        opacity: 0;
    }
}

@keyframes shooting-star-trail {
    0% {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) translateX(-100px);
        opacity: 0;
    }
}

/* Navigation Bar */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

header .logo {
    font-family: var(--font-heading);
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

header ul {
    display: flex;
    list-style: none;
    margin-right: 50px;
}

header ul li {
    margin: 0 15px;
    display: flex;
    align-items: center;
}

header ul li:last-child {
    margin-right: 0;
}

header ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: transparent;
    font-family: var(--font-heading);
}

header ul li a.active,
header ul li a:hover {
    color: var(--text-primary);
    background: rgba(125, 125, 125, 0.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    border: 1px solid var(--accent-blue);
}

#darkmode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    padding: 5px;
    transition: transform 0.3s ease;
}

#darkmode-toggle:hover {
    transform: scale(1.1);
}

/* Hamburger Menu (hidden on desktop) */
.menu-toggle {
    display: none;
}

/* Scroll Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: transparent;
    z-index: 1000;
}

#progress-bar .progress {
    height: 100%;
    width: 0;
    background: var(--accent-blue);
    transition: width 0.1s ease-out;
}

/* Parallax Section */
section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding-bottom: 80px;
    /* background: var(--bg); Removed to allow body background (and stars) to show */
    color: var(--text-primary);
}

#mountain {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    min-height: 110vh;
    z-index: 2;
    pointer-events: none;
    /* Invert mountain in light mode if it's a dark silhouette, or adjust opacity */
}

body:not(.dark-mode) #mountain {
    /* Optional: adjustments for light mode mountain if needed */
    /* filter: invert(1); */
}

#mountain::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 20vh;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, var(--bg) 100%);
    display: block;
}

#mountain::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 16vh;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, var(--bg) 100%);
    display: block;
}

#text {
    position: relative;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 8em;
    z-index: 3;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    text-shadow: 0 0 40px rgba(0, 243, 255, 0.2);
    mix-blend-mode: normal;
    /* Changed from overlay for better visibility in light mode */
}

body.dark-mode #text {
    mix-blend-mode: overlay;
    color: #fff;
}

.hero-subtitle {
    font-size: 1.2em;
    color: var(--accent-blue);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 10px;
    opacity: 0.8;
    font-weight: 600;
}

/* Section Styling */
section#about,
section#projects,
section#contact {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    margin: 40px auto;
    width: 85%;
    max-width: 1200px;
}

section#about:hover,
section#projects:hover,
section#contact:hover {
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.05);
    border-color: var(--accent-blue);
}

h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

p {
    font-size: 1.2em;
    line-height: 1.8;
    font-weight: 300;
    color: var(--text-primary);
}

/* Projects Section */
#projects {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-primary);
}

#projects h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.projects-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    width: 320px;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.project-card:hover::before {
    transform: translateX(100%);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.15);
    border-color: var(--accent-blue);
}

.project-card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.project-card p {
    font-size: 1em;
    color: var(--text-secondary);
}

.project-link {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: transparent;
    color: var(--accent-blue);
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-link:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    border-color: var(--accent-blue);
}

/* Responsive Design */
@media (max-width: 768px) {

    /* Responsive Nav */
    header ul {
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 20px;
        background: var(--bg-card);
        border-radius: 10px;
        padding: 10px;
        display: none;
        border: 1px solid var(--glass-border);
    }

    header ul.show {
        display: flex;
    }

    header ul li {
        margin: 10px 0;
    }

    #darkmode-toggle {
        font-size: 1.2em;
        padding: 8px 12px;
        margin: 5px 0;
    }

    .menu-toggle {
        display: block;
        font-size: 1.8em;
        color: var(--text-primary);
        cursor: pointer;
    }

    #text {
        font-size: 5em;
    }

    section {
        height: auto;
        min-height: 80vh;
        justify-content: flex-start;
        padding-top: 100px;
        /* Ensure content clears the fixed header */
    }

    section {
        padding-bottom: 50px;
    }

    section#about,
    section#projects,
    section#contact {
        width: 90%;
        margin-top: 20px;
        padding: 30px 10px;
    }

    .projects-container {
        flex-direction: column;
        align-items: center;
    }

    .project-card {
        width: 90%;
        margin-bottom: 20px;
    }

    .project-link {
        font-size: 1em;
        padding: 12px 20px;
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        display: none;
    }

    .menu-toggle {
        margin-left: auto;
    }

    header ul {
        right: 10px;
        top: 50px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    #text {
        font-size: 3em;
    }

    section {
        height: auto;
        min-height: 70vh;
    }

    #projects h2 {
        font-size: 2em;
    }

    .project-card h3 {
        font-size: 1.2em;
    }

    .project-card p {
        font-size: 0.9em;
    }
}

html {
    scroll-behavior: smooth;
}

.about-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 20px;
    margin: 50px auto;
    width: 80%;
    background: var(--bg-card);
    border-radius: 15px;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    gap: 24px;
}

.about-card h2 {
    font-size: 2.2em;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.about-card p {
    font-size: 1.15em;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.about-card .email {
    color: var(--text-primary);
    font-size: 1.1em;
    word-break: break-all;
    text-align: center;
    margin-bottom: 12px;
}

.about-card .social-icons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-icons .fa {
    width: 50px;
    height: 50px;
    font-size: 24px;
    text-align: center;
    text-decoration: none;
    margin: 0 5px;
    border-radius: 50%;
    transition: background 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.social-icons .fa:hover {
    opacity: 0.7;
}

.fa-linkedin {
    background: #02abf9;
    color: #fff;
}

.fa-github {
    background: #333;
    color: #fff;
}

body.dark-mode .fa-linkedin {
    background: #fff;
    color: #111;
    border: 2px solid #111;
}

body.dark-mode .fa-github {
    background: #fff;
    color: #111;
    border: none;
}

.welcome-center {
    position: absolute;
    top: 18vh;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    z-index: 3;
}

.parallax-bg {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* Star styles for light/dark mode */
#starfield div {
    background: var(--star-color) !important;
    box-shadow: 0 0 2px var(--star-color) !important;
}

.project-card-3d {
    position: absolute;
    width: 340px;
    min-height: 240px;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    text-align: center;
    padding: 32px 24px;
    color: var(--text-primary);
    opacity: 0;
    transform: scale(0.7) translateX(0) rotateY(0deg);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.project-card-3d.active {
    opacity: 1;
    transform: scale(1) translateX(0) rotateY(0deg);
    z-index: 3;
    pointer-events: auto;
    box-shadow: 0 0 30px rgba(188, 19, 254, 0.15);
    border: 1px solid rgba(188, 19, 254, 0.3);
}

.project-card-3d.active:hover {
    transform: scale(1.04) translateY(-8px) rotateY(0deg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.project-card-3d.left,
.project-card-3d.right {
    opacity: 0.5;
    filter: blur(1.5px) grayscale(0.3);
}

.project-card-3d h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.project-card-3d p {
    font-size: 1em;
    color: var(--text-secondary);
    margin-bottom: 18px;
    opacity: 0.8;
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    margin: 0 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.carousel-btn:hover {
    background: var(--accent-purple);
    color: #fff;
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.4);
    transform: scale(1.1);
    border-color: var(--accent-purple);
}

/* Skills List */
.skills-list li {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 18px;
    border-radius: 16px;
    margin-bottom: 6px;
    border: 1px solid var(--glass-border);
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 18px 18px 12px 18px;
    border-radius: 16px;
    font-size: 1.1em;
    min-width: 120px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--glass-border);
}

.skill-item i {
    font-size: 2.2em;
    margin-bottom: 10px;
}

.skill-svg {
    width: 2.2em;
    height: 2.2em;
    margin-bottom: 10px;
    display: block;
    /* Invert icons in dark mode if they are black by default, or vice versa */
    /* Assuming SVGs are colored or handle themselves, but let's check invert */
    filter: none;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
    background: none;
    padding: 0;
    overflow: visible;
}

body.dark-mode .skill-svg {
    /* filter: brightness(0) invert(1); */
    /* Only if needed for monochrome icons */
}

/* Resume Button */
.resume-btn-large {
    display: inline-block;
    background: var(--text-primary);
    color: var(--bg);
    border: none;
    border-radius: 18px;
    padding: 16px 36px;
    font-size: 1.2em;
    text-decoration: none;
    margin: 0 auto;
    transition: background 0.2s;
}

.resume-btn-large:hover {
    background: var(--accent-purple);
    color: #fff;
}

.email-btn {
    display: inline-block;
    background: var(--text-primary);
    color: var(--bg);
    border: none;
    border-radius: 18px;
    padding: 12px 28px;
    font-size: 1.1em;
    text-decoration: none;
    margin: 18px 0 0 0;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.email-btn:hover {
    background: var(--accent-purple);
    color: #fff;
}

/* About Tabs */
.about-tab {
    background: var(--bg-card);
    color: var(--text-primary);
    border: none;
    padding: 8px 22px;
    border-radius: 18px 18px 0 0;
    font-size: 1em;
    cursor: pointer;
    outline: none;
    transition: background 0.2s, color 0.2s;
    border: 1px solid var(--glass-border);
    border-bottom: none;
}

.about-tab.active {
    background: var(--accent-blue);
    color: #fff;
    font-weight: bold;
}