/* ==================== Global Styles ==================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f5576c;
    --text-dark: #1a1a1a;
    --text-light: #f0f0f0;
    --bg-light: #f8f9fa;
    --bg-dark: #0f0f1e;
    --border-color: #e0e0e0;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --navbar-height: 70px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: #fff;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ==================== Navigation (Transparent Overlay) ==================== */
/* Replace the existing .navbar rule with this */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    transition: var(--transition);
    background: transparent;
    box-shadow: none;
    border-bottom: none;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* backdrop-filter removed */
}
.navbar,
.nav-container,
.navbar::before,
.navbar::after {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
}

.navbar.scrolled,
.navbar.scrolled .nav-container {
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* keep shadow if desired, but no line */
    background: rgba(255, 255, 255, 0.98);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    height: var(--navbar-height);
}

/* Logo - transparent state: white text with subtle gradient */
.nav-logo {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ffffff, #e0e0ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

/* Scrolled logo - original gradient */
.navbar.scrolled .nav-logo {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Scrolled toggle color */
.navbar.scrolled .mobile-toggle {
    color: var(--text-dark);
    text-shadow: none;
}

.nav-link {
    text-decoration: none;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* Scrolled nav links - dark */
.navbar.scrolled .nav-link {
    color: var(--text-dark);
    text-shadow: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

.navbar.scrolled .nav-link::after {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    font-weight: 600;
}

.navbar.scrolled .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Theme toggle button (preserve but keep minimal) */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 0.5rem;
    color: white;
    transition: var(--transition);
}

.navbar.scrolled .theme-toggle {
    color: var(--text-dark);
}

/* ==================== Hero Section ==================== */
.hero {
    position: relative;
    width: 100%;
    margin-top: 0;          /* Remove margin-top to allow navbar overlay */
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 90vh;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4));
    z-index: 1;
}

.hero-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 1rem;
    padding-top: var(--navbar-height);   /* Push content below navbar */
    animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.typed-text {
    color: white;
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: white;
    margin-left: 0.1rem;
    animation: blink 1s infinite;
}

.cursor.typing {
    animation: none;
}

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

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.cta-button {
    display: inline-block;
    padding: 12px 32px;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    background: transparent;
    color: white;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-indicator span {
    display: block;
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 15px;
    position: relative;
}

.scroll-indicator span::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: scrollDot 2s infinite;
}

@keyframes scrollDot {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }
}

/* ==================== Anchor Offset (fix jumping behind fixed navbar) ==================== */
section[id],
.about,
.skills,
.projects,
.achievements-section,
.certificates-section,
.contact {
    scroll-margin-top: 80px;
}

/* ==================== About Section ==================== */
.about {
    padding: 80px 0;
    background: var(--bg-light);
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.profile-image-container {
    display: flex;
    justify-content: center;
}

.profile-image {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    border: 4px solid var(--primary-color);
    transition: var(--transition);
}

.profile-image:hover {
    transform: scale(1.02) rotate(2deg);
}

.about-text p {
    font-size: 1rem;
    margin-bottom: 1.2rem;
    color: #555;
    line-height: 1.6;
}

/* ==================== Skills, Projects, etc (unchanged) ==================== */
.skills {
    padding: 80px 0;
    background: #f5f8ff;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.skill-card {
    flex: 0 1 240px;
    background: white;
    padding: 25px 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 18px 45px rgba(50, 78, 147, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-5px);
}

.skill-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.skill-card p {
    font-size: 0.9rem;
    color: #6d7385;
}

.skill-mastery {
    margin-top: 12px;
    text-align: left;
}

.skill-mastery-bar {
    width: 100%;
    height: 6px;
    background: #e0e6ed;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.skill-mastery-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 1.5s ease-in-out;
}

.skill-mastery-text {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

.achievements-section {
    padding: 80px 0;
    background: white;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.achievement-card {
    background: #f4f7ff;
    padding: 25px 20px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.12);
    box-shadow: 0 18px 40px rgba(50, 78, 147, 0.06);
    transition: var(--transition);
}

.achievement-card:hover {
    transform: translateY(-5px);
}

.achievement-image {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.achievement-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
    transition: transform 0.3s ease;
}

.achievement-card:hover .achievement-image img {
    transform: scale(1.02);
}

.achievement-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.achievement-card p {
    font-size: 0.9rem;
    color: #5f6775;
    line-height: 1.5;
    margin-bottom: 12px;
}

.achievement-year {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.certificates-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.certificate-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.certificate-card:hover {
    transform: translateY(-6px);
}

.certificate-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.certificate-card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.cert-issuer {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.cert-date {
    font-size: 0.8rem;
    color: #7a7f8e;
    margin-bottom: 15px;
}

.cert-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.cert-link:hover {
    transform: translateX(5px);
    color: var(--secondary-color);
}

.projects {
    padding: 80px 0;
    background: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    animation: scaleIn 0.6s ease-out backwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.project-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image {
    transform: scale(1.03);
}

.project-content {
    padding: 25px;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.project-card:hover .project-title {
    color: var(--primary-color);
}

.project-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.project-tech {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.project-tech span {
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition);
}

.project-card:hover .project-tech span {
    background: var(--primary-color);
    color: white;
}

.project-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    position: relative;
}

.project-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.project-link:hover::after {
    width: 100%;
}

.contact {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.contact-content {
    text-align: center;
}

.contact-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.contact-form {
    max-width: 550px;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 18px;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.submit-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: var(--bg-light);
}

.form-feedback {
    margin-top: 8px;
    font-size: 0.85rem;
}

.contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 25px;
    max-width: 750px;
    margin: 0 auto;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.contact-icon {
    font-size: 1.3rem;
}

.footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 25px 0;
    font-size: 0.85rem;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

/* ==================== Mobile Navigation Overlay Enhancements ==================== */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
        order: 3;
    }

    .nav-logo {
        order: 1;
    }

    .nav-menu {
        position: fixed;
        top: 0px;
        left: -100%;
        flex-direction: column;
        background: white;
        width: 80%;
        height: calc(100vh - var(--navbar-height));
        padding: 2rem;
        transition: left 0.3s ease;
        gap: 1.5rem;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 99;
    }

    .nav-menu.active {
        left: 0;
    }

    /* Mobile menu links always dark (solid background) */
    .nav-menu .nav-link {
        color: var(--text-dark) !important;
        text-shadow: none;
    }

    .navbar.scrolled .nav-menu .nav-link {
        color: var(--text-dark) !important;
    }

    .nav-menu .nav-link::after {
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-content {
        padding-top: calc(var(--navbar-height) + 10px);
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

    .section-title {
        font-size: 1.75rem;
    }

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

    .project-image {
        border-radius: 16px;
        width: 100%;
        height: 280px;
        background-size: cover;
        background-position: center;
    }

    .contact-links {
        grid-template-columns: 1fr;
    }

    .certificates-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .cta-button {
        padding: 8px 22px;
        font-size: 0.85rem;
    }

    .achievement-image img {
        height: 200px;
    }

    .about-text p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .cta-button {
        padding: 6px 18px;
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .project-title {
        font-size: 1.2rem;
    }

    .project-description {
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}