/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

:root {
    --primary: #6c63ff;
    --secondary: #4a44c6;
    --accent: #ff6584;
    --dark: #2a2d3e;
    --light: #f7f9fc;
    --text: #333;
    --gradient: linear-gradient(135deg,
            var(--primary) 0%,
            var(--secondary) 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--light);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== FIXED HEADER & NAVIGATION ===== */
header {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    color: var(--dark);
    padding: 1.2rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

header.scrolled {
    padding: 0.8rem 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* OLD LOGO STYLE - FIXED */
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1001;
}

.logo:hover {
    transform: scale(1.05);
}

/* Desktop Navigation - FIXED HOVER UNDERLINE */
.nav-links {
    display: flex;
    list-style: none;
    transition: all 0.3s ease;
}

.nav-links li {
    margin-left: 2.5rem;
    position: relative;
}

.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    padding: 5px 0;
    display: block;
}

/* FIXED: NAV LINK UNDERLINE ANIMATION - WORKING NOW */
.nav-links a:after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
    display: block;
}

.nav-links a:hover:after,
.nav-links a.active:after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--primary);
}

/* OLD MAGNETIC BUTTON EFFECT */
.magnetic-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.magnetic-btn:hover {
    transform: translateY(-5px) scale(1.05);
}

.magnetic-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.magnetic-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Hamburger Menu - FIXED */
.hamburger {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 25px;
    position: relative;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ===== FIXED HERO SECTION ===== */
.hero {
    padding: 150px 0 100px;
    background: var(--gradient);
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    margin-top: 0;
}

#webgl-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
    padding-top: 0;
}

/* FIXED PROFILE IMAGE */
.profile-img-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 2rem;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: all 0.5s ease;
    display: block;
}

.profile-img:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #fff 30%, #f0f0f0 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: textShine 3s ease-in-out infinite alternate;
}

@keyframes textShine {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.hero h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
    line-height: 1.6;
}

/* OLD BUTTON STYLES - FIXED */
.btn-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 14px 35px;
    background-color: white;
    color: var(--primary);
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background-color: var(--light);
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary);
}

/* OLD RIPPLE EFFECT */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ===== IMPROVED ABOUT SECTION ===== */
.section {
    padding: 100px 0;
    position: relative;
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.about-text {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    position: relative;
    overflow: hidden;
}

.about-text::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--gradient);
}

.about-text h3 {
    font-size: 2.2rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.about-text h3::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #555;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* ===== FIXED SKILLS SECTION - SMOOTH SCROLLING ===== */
.skills-section {
    background-color: var(--light);
    position: relative;
}

.skills-container {
    position: relative;
    height: 400px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 40px;
}

.skills-track {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    height: 50%;
    align-items: center;
    width: max-content;
    animation: autoScroll 45s linear infinite;
    will-change: transform;
}

.skills-track-2 {
    top: 50%;
    animation: autoScrollReverse 40s linear infinite;
}

/* FIXED: Smooth linear scrolling */
@keyframes autoScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes autoScrollReverse {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

.skills-track:hover,
.skills-track-2:hover {
    animation-play-state: paused;
}

.skill-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    width: 180px;
    margin: 0 15px;
    flex-shrink: 0;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transition: left 0.5s;
}

.skill-card:hover::before {
    left: 100%;
}

.skill-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.skill-card:hover .skill-icon {
    transform: scale(1.2) rotate(10deg);
}

/* ===== NEW TOOLS SECTION WITH SAME SCROLLING ANIMATION ===== */
.tools-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.tools-container {
    position: relative;
    height: 400px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 40px;
}

.tools-track {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    height: 50%;
    align-items: center;
    width: max-content;
    animation: autoScrollTools 40s linear infinite;
    will-change: transform;
}

.tools-track-2 {
    top: 50%;
    animation: autoScrollToolsReverse 35s linear infinite;
}

@keyframes autoScrollTools {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes autoScrollToolsReverse {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

.tools-track:hover,
.tools-track-2:hover {
    animation-play-state: paused;
}

.tool-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    width: 200px;
    margin: 0 15px;
    flex-shrink: 0;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(108, 99, 255, 0.1),
            transparent);
    transition: left 0.5s;
}

.tool-card:hover::before {
    left: 100%;
}

.tool-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.tool-icon {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--secondary);
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.2) rotate(-10deg);
}

.tool-card h4 {
    font-size: 1rem;
    color: var(--dark);
    font-weight: 600;
}

/* ===== FIXED PROJECTS SECTION - SMOOTH SCROLLING ===== */
.projects {
    background-color: var(--light);
    position: relative;
    overflow: hidden;
}

.projects-container {
    position: relative;
    height: 500px;
    width: 100%;
    overflow: hidden;
}

.projects-track {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    align-items: center;
    width: max-content;
    animation: autoScrollProjects 35s linear infinite;
    will-change: transform;
}

/* FIXED: Smooth project scrolling */
@keyframes autoScrollProjects {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.projects-track:hover {
    animation-play-state: paused;
}

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: 350px;
    margin: 0 20px;
    flex-shrink: 0;
    height: 470px;
}

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

.project-content {
    padding: 1rem;
}

.project-desc {
    font-size: 0.9rem;
}

/* OLD PROJECT LINK STYLES - FIXED */
.project-links {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
    font-size: 0.9rem;
    position: relative;
}

.project-link::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.project-link:hover::after {
    width: 100%;
}

.project-link:hover {
    color: var(--secondary);
}

/* Section Titles */
.section-title {
    margin-top: 20px;
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.8rem;
    color: var(--dark);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

/* ===== CONTACT SECTION ===== */
.contact {
    background: var(--dark);
    color: white;
    padding: 100px 0;
}

.contact .section-title h2 {
    color: white;
}

.contact-content {
    text-align: center;
}

.contact-info {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-link {
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

/* ===== FOOTER ===== */
footer {
    background-color: #1a1a2e;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2.5rem 0;
}

.heart {
    color: var(--accent);
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    5% {
        transform: scale(1.1);
    }

    10% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.1);
    }

    20% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== RESPONSIVE DESIGN - FIXED ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

    .skill-card {
        width: 160px;
        margin: 0 12px;
    }

    .tool-card {
        width: 180px;
        margin: 0 12px;
    }

    .project-card {
        width: 320px;
        margin: 0 15px;
    }
}

@media (max-width: 768px) {

    /* FIXED: Mobile Navigation */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 80px 20px;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 15px 0;
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        font-size: 1.2rem;
        padding: 12px 0;
        display: block;
        width: 100%;
    }

    .hamburger {
        display: block;
    }

    /* FIXED: Hero Section for Mobile */
    .hero {
        padding: 120px 0 80px;
        min-height: auto;
    }

    .profile-img-container {
        width: 180px;
        height: 180px;
    }

    .hero h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero h2 {
        font-size: 1.3rem;
    }

    .hero p {
        font-size: 1.1rem;
        padding: 0 10px;
    }

    .btn-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    /* FIXED: About Section */
    .about-text {
        padding: 2rem;
    }

    .about-text h3 {
        font-size: 1.8rem;
    }

    /* FIXED: Section Titles */
    .section-title h2 {
        font-size: 2.2rem;
    }

    /* FIXED: Skills Section for Mobile */
    .skills-container {
        height: 350px;
    }

    .skill-card {
        width: 140px;
        height: 130px;
        padding: 1rem;
        margin: 0 10px;
    }

    .skill-icon {
        font-size: 2rem;
    }

    /* FIXED: Tools Section for Mobile */
    .tools-container {
        height: 350px;
    }

    .tool-card {
        width: 150px;
        height: 130px;
        padding: 1rem;
        margin: 0 10px;
    }

    .tool-icon {
        font-size: 1.8rem;
    }

    /* FIXED: Projects Section for Mobile */
    .projects-container {
        height: 520px;
    }

    .project-card {
        width: 300px;
        height: 420px;
        margin: 0 15px;
    }

    .project-content {
        padding: 1.5rem;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .project-desc {
        font-size: 0.85rem;
    }

    .project-link {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .profile-img-container {
        width: 150px;
        height: 150px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero h2 {
        font-size: 1.2rem;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .about-text {
        padding: 1.5rem;
    }

    .about-text h3 {
        font-size: 1.5rem;
    }

    .skill-card {
        width: 120px;
        height: 120px;
        padding: 0.8rem;
    }

    .skill-icon {
        font-size: 1.8rem;
    }

    .tool-card {
        width: 130px;
        height: 120px;
        padding: 0.8rem;
    }

    .tool-icon {
        font-size: 1.6rem;
    }

    .project-card {
        width: 260px;
        height: 440px;
        margin: 0 10px;
    }

    .project-title {
        font-size: 0.85rem;
    }

    .project-desc {
        font-size: 0.76rem;
    }

    .project-link {
        margin-bottom: 10px;
        font-size: 0.78rem;
    }
}

/* Overlay for mobile menu */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}