/* === GLOBAL THEME & SETUP === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700&display=swap');

:root {
    --bg-dark: #000000;
    --bg-light: #10001a;
    --primary: #a974ff;
    --primary-light: #c39bff;
    --primary-gradient: linear-gradient(90deg, #a974ff, #8b5bff);
    --text-light: #d8caff;
    --text-main: #eee;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(169, 116, 255, 0.3);
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: "Poppins", sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 0;
}

.section-title {
    font-size: 2.5em;
    color: var(--primary-light);
    text-align: center;
    margin-bottom: 50px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 25px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
    box-shadow: 0 0 10px 2px var(--primary);
}

.section-title .white-text {
    color: var(--text-main);
}

/* === LOADER === */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}
#loader h1 { font-size: 2.5em; color: var(--primary-light); }
#loader p { font-size: 1.2em; color: var(--text-light); margin-top: 10px; }
.loader-bar-container { width: 300px; height: 8px; background: var(--card-bg); border-radius: 4px; margin-top: 20px; border: 1px solid var(--border-color); }
#loader-bar { width: 0%; height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.1s linear; }

/* === HEADER / NAVBAR === */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}
.logo:hover {
    color: var(--primary);
    text-decoration: none;
}

header nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}
header nav a {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
    padding: 5px 0;
}
header nav a:hover,
header nav a.active {
    color: var(--primary);
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease-in-out;
}
header nav a.active::after {
    transform: scaleX(1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle-container {
    position: relative;
}
#theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5em;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
}
#theme-toggle:hover {
    color: var(--primary);
    transform: rotate(15deg);
}

#theme-error-popup {
    position: absolute;
    top: 120%;
    right: 0;
    width: 250px;
    background: #1e0033;
    border: 1px solid var(--primary);
    color: #ff3838;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9em;
    text-align: center;
    z-index: 1001;
    box-shadow: 0 0 10px var(--border-color);
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.6em;
    cursor: pointer;
    z-index: 1002;
}

/* === SECTION 1: HOME / HERO === */
.hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-light));
}
.hero-content { z-index: 2; padding: 20px; }
.hero h1 { font-size: 3.5em; margin-bottom: 20px; color: var(--text-main); }
.hero h1 span { color: var(--primary-light); display: block; font-weight: 500; font-size: 0.8em; }
.hero-buttons { display: flex; justify-content: center; gap: 20px; margin-top: 30px; }

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    font-size: 1.1em;
}
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
}
.btn-primary:hover {
    box-shadow: 0 0 15px var(--primary);
    transform: translateY(-3px);
}
.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-secondary:hover {
    background-color: var(--primary);
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: 0 0 15px var(--primary);
}

#hero-animation-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; overflow: hidden; }
.code-line { position: absolute; top: -50px; color: var(--primary); opacity: 0.3; font-size: 0.9em; writing-mode: vertical-rl; animation: fall 10s linear infinite; user-select: none; text-shadow: 0 0 5px var(--primary); }
@keyframes fall { to { transform: translateY(105vh); } }

/* === SECTION 2: ABOUT ME === */
.about-content { display: flex; align-items: center; gap: 50px; }
.about-image { flex-basis: 40%; }
.about-image img { width: 300px; height: 300px; border-radius: 50%; border: 3px solid var(--primary); object-fit: cover; margin: 0 auto; box-shadow: 0 0 20px var(--border-color); }
.about-text { flex-basis: 60%; }
.about-text h3 { font-size: 1.8em; font-weight: 500; color: var(--primary-light); margin-bottom: 20px; }
.about-text p { font-size: 1.1em; line-height: 1.6; color: var(--text-light); margin-bottom: 15px; }

/* === SECTION 3: MY SKILLS === */
.skills-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; }
.skill-box { position: relative; background: var(--card-bg); padding: 20px; border-radius: 10px; box-shadow: 0 0 10px var(--border-color); transition: transform 0.3s; }
.skill-box:hover { transform: translateY(-5px); box-shadow: 0 5px 15px var(--primary); }
.skill-box img { width: 60px; height: 60px; display: block; filter: grayscale(30%) brightness(1.5); }
.tooltip { visibility: hidden; width: 180px; background-color: var(--bg-dark); color: #fff; text-align: center; border-radius: 6px; padding: 8px; position: absolute; z-index: 1; bottom: 120%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; font-size: 0.9em; box-shadow: 0 0 10px var(--border-color); border: 1px solid var(--border-color); }
.skill-box:hover .tooltip { visibility: visible; opacity: 1; }

/* === SECTION 4: FEATURED PROJECTS === */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 15px var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px var(--primary);
}
.project-card img { width: 100%; height: 200px; object-fit: cover; border-bottom: 1px solid var(--border-color); }
.project-card h3 { font-size: 1.5em; color: var(--primary-light); padding: 20px 20px 10px; }
.project-card p { font-size: 1em; color: var(--text-light); line-height: 1.5; padding: 0 20px 20px; }
.project-skills { padding: 0 20px 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.project-skills span { background: var(--primary); color: var(--bg-dark); padding: 3px 10px; border-radius: 15px; font-size: 0.8em; font-weight: 500; }
.project-link {
    display: inline-block;
    padding: 0 20px 20px;
    font-weight: bold;
    color: var(--primary);
    transition: letter-spacing 0.3s ease, color 0.3s ease;
}
.project-link:hover {
    text-decoration: none;
    letter-spacing: 1px;
    color: var(--primary-light);
}

/* === SECTION 5: GET IN TOUCH === */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; background: var(--card-bg); padding: 40px; border-radius: 15px; border: 1px solid var(--border-color); box-shadow: 0 0 20px var(--border-color); }
#contact-form input,
#contact-form textarea { width: 100%; padding: 12px; margin-bottom: 15px; background-color: rgba(255,255,255,0.08); border: 1px solid var(--primary); border-radius: 8px; color: #fff; font-family: "Poppins", sans-serif; }
#contact-form input::placeholder,
#contact-form textarea::placeholder { color: var(--text-light); }
#contact-form input[type="submit"] {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
#contact-form input[type="submit"]:hover {
    box-shadow: 0 0 15px var(--primary);
    transform: translateY(-2px);
}

#form-status {
    margin-top: 15px;
    font-size: 1.1em;
    font-weight: 500;
    text-align: center;
    min-height: 1.5em;
    transition: opacity 0.3s ease;
}
.success-message {
    color: #00ff88;
    animation: fadeIn 0.5s ease;
}
.error-message {
    color: #ff3838;
    animation: fadeIn 0.5s ease;
}

.contact-connect h3 { font-size: 1.8em; color: var(--primary-light); margin-bottom: 20px; }
.contact-connect p { font-size: 1.1em; color: var(--text-light); line-height: 1.6; margin-bottom: 30px; }
.connect-link {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1em;
    color: var(--text-main);
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.connect-link:hover {
    background: var(--primary);
    color: var(--bg-dark);
    text-decoration: none;
    transform: translateX(5px);
}
.connect-link i { font-size: 1.5em; width: 30px; text-align: center; }

/* === SECTION 6: FOOTER === */
footer {
    background: #02000a;
    padding: 50px 0 20px;
    border-top: 1px solid var(--border-color);
}
.footer-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; width: 90%; max-width: 800px; margin: 0 auto 30px; text-align: center; }
footer h4 { font-size: 1.4em; color: var(--primary-light); margin-bottom: 20px; }
.footer-socials a {
    color: var(--text-light);
    font-size: 2em;
    margin: 0 15px;
    transition: color 0.3s ease, transform 0.3s ease;
}
.footer-socials a:hover {
    color: var(--primary);
    transform: translateY(-3px);
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: var(--text-light);
    font-size: 1.1em;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
    letter-spacing: 0.5px;
}
.footer-back-to-top {
    display: block;
    text-align: center;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 30px;
    text-decoration: none;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.footer-back-to-top:hover {
    color: var(--primary-light);
    text-decoration: underline;
    letter-spacing: 0.5px;
}
.footer-copy { text-align: center; color: #aaa; font-size: 0.9em; padding-top: 30px; border-top: 1px solid var(--border-color); width: 90%; max-width: 1200px; margin: 0 auto; }

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .header-container {
        width: 90%;
    }
    
    #menu-toggle {
        display: block;
    }
    header nav {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    header nav.active {
        transform: translateX(0);
    }
    
    header nav ul {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    
    header nav a {
        font-size: 2em;
    }
    header nav a::after {
        display: none;
    }

    .logo {
        font-size: 1.5em;
    }
    .hero h1 {
        font-size: 2.2em;
    }
    .hero h1 span {
        font-size: 0.7em;
    }
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    .btn {
        width: 80%;
        max-width: 300px;
    }

    .section-title {
        font-size: 2em;
        padding-bottom: 20px;
    }

    .section-title::after {
        width: 50px;
        height: 3px;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }
    .about-image img {
        width: 250px;
        height: 250px;
    }
    .skills-grid {
        gap: 20px;
    }
    .project-grid {
        grid-template-columns: 1fr;
    }
    .contact-layout {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-links {
        margin-top: 20px;
    }
}