/*General and Global Section*/

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-y: auto; /* Allow smooth free scrolling */
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Theme Variables */
:root {
    --bg-primary: #f8f5ff;
    --bg-secondary: #f0ebff;
    --text-primary: #212529;
    --text-secondary: #495057;
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --header-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #ced4da;
    --accent: #66b3ff;
    --accent-hover: #3399ff;
    --card-bg: #2d2d2d;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --header-bg: rgba(26, 26, 26, 0.95);
}


/*Header and Navigation*/
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.navbar-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.navbar-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--accent);
}


/* Hero section */
.hero {
    padding: 8rem 2rem 4rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px; /* Adjust instead of margin */
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
}

.hero-text {
    text-align: center;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.hero-text .subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Skills Section */
#skills {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 100%;
    margin: 0 auto;
}

.skill-category {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.skill-category h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.skill-category ul {
    list-style: none;
    padding: 0;
}

.skill-category li {
    margin-bottom: 0.75rem;
    line-height: 1.4;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-category li i {
    width: 1.2rem;
    text-align: center;
    color: var(--accent);
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.skill-category li:hover i {
    transform: scale(1.2);
}

.skill-category h3 i {
    margin-right: 0.5rem;
    color: var(--accent);
}

/* Projects Section */
#projects {
    padding: 6rem 2rem;  /* Increased padding */
    margin-bottom: 4rem; /* Add margin at bottom */
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;  /* Increased gap between cards */
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;  /* Added padding */
}

.project-card {
    background: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.project-content h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

/*scroll and anim*/
/* Scroll Snap Adjustments */
@media screen and (max-width: 768px) {
    .hero, #skills, #projects {
        scroll-snap-align: none;
    }
}

/* Scroll-to-Top Button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Reduce scroll button threshold */
@media screen and (min-height: 600px) {
    .scroll-top {
        display: block;
    }
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .section {
        padding: 4rem 1rem;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .profile-image {
        width: 250px;
        height: 250px;
    }

    .navbar-toggle {
        display: block !important;
        order: 3;
        z-index: 1001;
    }

    .navbar-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .navbar-links.active {
        display: flex;
    }

    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
    }

    .navbar-brand {
        order: 1;
    }

    .navbar-links {
        order: 2;
        width: 100%;
    }

    .theme-toggle {
        margin-top: 0.5rem;
    }

    #projects {
        padding: 4rem 1rem;
        margin-bottom: 2rem;
    }

    .projects-grid {
        gap: 2rem;
        padding: 0.5rem;
    }
}

/*Footer Styling */
footer {
    background: var(--bg-secondary);
    padding: 2rem;
    margin-top: 2rem;  /* Added margin at top */
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    color: var(--accent);
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.social-links a:hover {
    color: var(--text-primary);
    transform: translateY(-3px) scale(1.1);
    background-color: var(--bg-secondary);
}

/* Section Title Centering*/
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--accent);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    transform: rotate(15deg);
}

/* Navbar Button (Mobile) */
.navbar-toggle {
    display: none;
    background: transparent !important;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto; /* Push to right if needed */
}

.navbar-toggle:hover {
    transform: scale(1.1);
    background-color: var(--bg-secondary);
}

/* Button & Link Hover Effects */
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 1rem;
    width: fit-content;
    font-size: 0.9rem;
}

.project-link i {
    font-size: 1rem;
}

.project-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dark theme adjustments */
[data-theme="dark"] .skill-category:hover,
[data-theme="dark"] .project-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
