/* CSS Variables for Theming */
:root {
    --primary-font: 'Inter', sans-serif;
    --heading-font: 'Outfit', sans-serif;
    
    /* Light Theme (Default, overwritten by data-theme="dark") */
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --card-bg: rgba(255, 255, 255, 0.7);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);
    --border-color: #e2e8f0;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #60a5fa;
    --card-bg: rgba(30, 41, 59, 0.7);
    --nav-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --border-color: #334155;
}

/* Base Styles & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--primary-font);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utlity Classes */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background-color: var(--accent-blue);
    border-radius: 2px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: var(--primary-font);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.icon-btn:hover {
    color: var(--accent-blue);
}

/* Base Layout Adjustments */
html {
    scroll-padding-top: 80px; /* Offset for sticky nav */
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    padding: 1rem 0;
    transition: background 0.3s ease, border 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-family: var(--heading-font);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo .accent {
    color: var(--accent-blue);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-blue);
    transition: width 0.3s ease;
}

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switcher {
    position: relative;
}

.lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-dropdown {
    position: absolute;
    top: 150%;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 0;
    width: 80px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown li a {
    display: block;
    padding: 0.5rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.lang-dropdown li a:hover {
    background: var(--accent-blue);
    color: #fff;
}

.mobile-menu-btn {
    display: none;
}

/* Animations */
@keyframes bgGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

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

@keyframes rotateOrb {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px; /* offset for nav */
    overflow: hidden;
}

.hero-bg-anim {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.15) 0%, transparent 50%);
    animation: rotateOrb 30s linear infinite;
    z-index: -1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    animation: slideUp 0.8s ease forwards;
}

.greeting {
    font-size: 1.25rem;
    color: var(--accent-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-content .name {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content .title {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    height: 2.5rem; /* prevent layout shift */
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent-blue);
}

.hero-content .description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 450px;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.social-links {
    display: flex;
    gap: 1.25rem;
}

.icon-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.icon-link:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: float 6s ease-in-out infinite;
}

.glass-orb {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4) 0%, rgba(37, 99, 235, 0.05) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1;
}

.profile-img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    border: 4px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* About Section */
.about-card {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-card p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.about-card p:last-child {
    margin-bottom: 0;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.15);
    border-color: var(--accent-blue);
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--accent-blue);
    transition: transform 0.3s ease;
}

.skill-card:hover i {
    transform: scale(1.1);
}

.skill-card span {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.project-card {
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: all 0.6s ease;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-blue);
}

.project-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--accent-blue);
}

.project-card p {
    color: var(--text-secondary);
}

/* Education Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--glass-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 50%;
    left: -2rem; /* offset the timeline padding */
    top: 1.5rem;
    transform: translateX(-50%);
    border: 4px solid var(--bg-color);
    box-shadow: 0 0 0 2px var(--accent-blue);
}

.timeline-date {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-item h3 {
    margin-bottom: 0.5rem;
}

.timeline-item p {
    color: var(--text-secondary);
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.contact-method i {
    color: var(--accent-blue);
    font-size: 1.5rem;
}

.contact-method:hover {
    color: var(--accent-blue);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05); /* very subtle light */
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--primary-font);
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

[data-theme="light"] .contact-form input,
[data-theme="light"] .contact-form textarea {
    background: rgba(0, 0, 0, 0.02);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.05);
}

.contact-form button {
    align-self: flex-start;
}

/* Footer */
footer {
    background: var(--nav-bg);
    border-top: 1px solid var(--glass-border);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: var(--accent-blue);
}

/* Media Queries for Responsiveness */
@media screen and (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-content .name {
        font-size: 3.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-content .description {
        margin: 0 auto 2rem auto;
    }

    .hero-image-wrapper {
        order: -1; /* Move image top on mobile */
    }

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

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: -100vh; /* Hidden nicely */
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: top 0.4s ease;
        z-index: 999; /* Below nav container */
    }

    .nav-links.active {
        top: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .mobile-menu-btn {
        display: block;
        z-index: 1000; /* Above nav links */
    }

    nav {
        position: relative; /* ensure z-index context */
        z-index: 1001;
    }

    .hero-content .name {
        font-size: 2.8rem;
    }

    .hero-content .title {
        font-size: 1.5rem;
    }
    
    .glass-orb {
        width: 250px;
        height: 250px;
    }
    
    .profile-img {
        width: 220px;
        height: 220px;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
