/* -----------------------------
   CSS Variables & Settings
-------------------------------- */
:root {
    --bg-color: #0d0e15;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --neon-blue: #00f3ff;
    --neon-purple: #9d4edd;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* -----------------------------
   Typography & Utilities
-------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.neon-text {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.3);
}

.section-padding {
    padding: 100px 5%;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Glassmorphism Classes */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.glass-nav.scrolled {
    padding: 15px 5%;
    background: rgba(13, 14, 21, 0.8);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 243, 255, 0.1);
    border-color: rgba(0, 243, 255, 0.3);
}

/* Buttons */
.neon-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: transparent;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--neon-blue);
    border-radius: 30px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.neon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--neon-blue);
    z-index: -1;
    transition: all 0.3s ease;
}

.neon-btn:hover {
    color: var(--bg-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6), 0 0 40px rgba(0, 243, 255, 0.2);
}

.neon-btn:hover::before {
    width: 100%;
}

/* Particles Background */
#particles-js {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--bg-color);
}

/* -----------------------------
   Navigation
-------------------------------- */
.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links li a {
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-purple);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--neon-purple);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger .line {
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

/* -----------------------------
   Hero Section
-------------------------------- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 0 5%;
}

.hero-content {
    z-index: 10;
    max-width: 800px;
}

.glitch-title {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #fff;
    position: relative;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    /* Simple dynamic text effect */
}

.subtitle {
    font-size: 2rem;
    color: var(--neon-purple);
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
}

.typing-container {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    min-height: 30px;
}

.typing-text {
    border-right: 2px solid transparent;
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--neon-blue);
    animation: blink 1s step-end infinite;
}

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

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.scroll-indicator:hover {
    opacity: 1;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-muted);
    border-radius: 15px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--neon-blue);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
    box-shadow: 0 0 5px var(--neon-blue);
}

@keyframes scroll {
    0% { top: 10px; opacity: 1; }
    100% { top: 30px; opacity: 0; }
}

/* -----------------------------
   About Section
-------------------------------- */
.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.about-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.glow-wrap {
    position: relative;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 20px rgba(0, 243, 255, 0.4), 0 0 40px rgba(157, 78, 221, 0.2); }
    100% { box-shadow: 0 0 40px rgba(0, 243, 255, 0.8), 0 0 60px rgba(157, 78, 221, 0.4); }
}

.about-img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--bg-color);
    transition: transform 0.5s ease;
}

.glow-wrap:hover .about-img {
    transform: scale(1.05) rotate(2deg);
}

.about-text {
    flex: 1.5;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.personal-info {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
}

.info-item i {
    color: var(--neon-purple);
    font-size: 1.2rem;
}

/* -----------------------------
   Skills Section
-------------------------------- */
.skills-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-box {
    padding: 25px;
}

.skill-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.skill-info i {
    font-size: 2rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.progress-wrap {
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    border-radius: 5px;
    width: 0; /* Animated in JS */
    transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1);
    box-shadow: 0 0 10px var(--neon-purple);
}

.progress-text {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 0.85rem;
    font-family: var(--font-heading);
    font-weight: bold;
    color: var(--neon-blue);
    opacity: 0;
    transition: opacity 1s 1.5s; /* Fade in after bar animation */
}

/* -----------------------------
   Projects Section
-------------------------------- */
.projects-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.project-card {
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 14, 21, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-img-wrapper img {
    transform: scale(1.1);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.neon-btn-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 2px solid var(--neon-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
    transition: all 0.3s;
    transform: translateY(20px);
}

.project-card:hover .neon-btn-icon {
    transform: translateY(0);
}

.neon-btn-icon:hover {
    background: var(--neon-blue);
    color: var(--bg-color);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.8);
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* -----------------------------
   Contact Form & Footer
-------------------------------- */
.contact-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 40px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 20px 20px 20px 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--neon-purple);
    box-shadow: inset 0 0 10px rgba(157, 78, 221, 0.2);
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s;
}

.input-group input:focus ~ .input-icon,
.input-group textarea:focus ~ .input-icon,
.input-group input:not(:placeholder-shown) ~ .input-icon,
.input-group textarea:not(:placeholder-shown) ~ .input-icon {
    color: var(--neon-purple);
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-group textarea ~ label {
    top: 20px;
    transform: none;
}

.input-group input:focus ~ label,
.input-group textarea:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -10px;
    left: 15px;
    font-size: 0.8rem;
    padding: 0 5px;
    background: var(--bg-color);
    color: var(--neon-purple);
    border-radius: 3px;
    transform: none;
}

.submit-btn {
    align-self: flex-start;
    margin-top: 10px;
}

.social-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.social-links h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--neon-blue);
}

.social-links p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--neon-purple);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(157, 78, 221, 0.4);
    border-color: var(--neon-purple);
}

.glass-footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

/* -----------------------------
   Project Modal
-------------------------------- */
.project-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 14, 21, 0.85); /* Dark semi-transparent background */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-modal.show {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Changed from center to allow scrolling long content */
    padding: 50px 0; /* Add padding so it doesn't touch the very top/bottom */
    opacity: 1;
}

.project-modal .modal-content {
    position: relative;
    max-width: 800px;
    width: 90%;
    margin: auto;
    /* Removed max-height so it can grow or scroll naturally in its flex container */
    padding: 40px;
    transform: scale(0.8) translateY(50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-modal .modal-content p#modalDesc {
    white-space: pre-line; /* Allows newlines from database (\n) to render correctly */
}

.project-modal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.close-modal {
    color: var(--text-muted);
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

/* Responsive Modal Adjustments */
@media screen and (max-width: 768px) {
    .project-modal .modal-content {
        padding: 25px;
        width: 95%;
    }
    .close-modal {
        top: 10px;
        right: 20px;
    }
}

/* -----------------------------
   Animations (Scroll Reveal)
-------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

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

/* -----------------------------
   Responsive Design
-------------------------------- */
@media screen and (max-width: 992px) {
    .about-container,
    .contact-container {
        flex-direction: column;
    }
    
    .about-image-wrapper {
        margin-bottom: 30px;
    }
    
    .contact-container {
        display: flex;
        flex-direction: column-reverse; /* Icons on top or bottom */
    }
    
    .glitch-title {
        font-size: 3.5rem;
    }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(13, 14, 21, 0.95);
        backdrop-filter: blur(15px);
        width: 100%;
        height: calc(100vh - 70px);
        text-align: center;
        padding-top: 50px;
        transition: 0.3s;
        border-top: 1px solid var(--glass-border);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        margin: 20px 0;
    }
    
    .nav-links li a {
        font-size: 1.5rem;
    }
    
    .hamburger {
        display: flex;
        z-index: 1001;
    }
    
    .hamburger.active .line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .line:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .glitch-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}
