/* --- 1. CSS VARIABLES (THEME CONFIG) --- */
:root {
    /* Light Mode Colors */
    --bg-body: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --nav-border: rgba(226, 232, 240, 0.8);
    --accent: #06b6d4;
    /* Cyan-500 */
    --accent-hover: #0891b2;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --blob-color: rgba(6, 182, 212, 0.2);
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-body: #0f172a;
    /* Slate-950 */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --nav-bg: rgba(15, 23, 42, 0.8);
    --nav-border: rgba(30, 41, 59, 0.8);
    --accent: #22d3ee;
    /* Cyan-400 */
    --accent-hover: #67e8f9;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --blob-color: rgba(34, 211, 238, 0.15);
}

/* --- 2. GLOBAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

html {
    scroll-behavior: smooth;
}

/* --- 3. NAVBAR STYLES --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;

    /* Glassmorphism Effect */
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--shadow);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-main);
    cursor: pointer;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.theme-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
    transform: scale(1.1);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* --- 4. HERO SECTION STYLES --- */
.hero-section {
    min-height: 100vh;
    padding: 100px 2rem 50px;
    /* Top padding accounts for fixed navbar */
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, var(--blob-color), transparent 40%);
}

.hero-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

/* Left Content */
.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-subtitle {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: inline-block;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Typewriter Styles */
.hero-role {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2rem;
    min-height: 3rem;
    /* Prevent layout shift */
}

.hero-role span.text {
    color: var(--accent);
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--accent);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

/* Buttons & Icons */
.hero-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s, background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.39);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.23);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

/* Right Image */
.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-img {
    width: 400px;
    /* Fixed width */
    height: 400px;
    /* Fixed height to match width */
    object-fit: cover;
    /* Ensures image doesn't stretch */
    border-radius: 50%;
    /* Makes it a perfect circle */
    position: relative;
    z-index: 2;
    border: 4px solid var(--nav-bg);
    /* Optional: Adds a border around image */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    /* Soft shadow */
    transition: transform 0.3s ease;
}

.hero-img:hover {
    transform: scale(1.02);
    border-color: var(--accent);
}

/* Decorative Glow */
.glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    background: var(--blob-color);
    filter: blur(60px);
    border-radius: 50%;
    z-index: 1;
}

/* --- 5. ABOUT SECTION STYLES --- */
.about-section {
    padding: 80px 2rem;
    background-color: var(--bg-body);
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 4rem;
}

/* About Image (Left Side) */
.about-image-container {
    flex: 1;
    position: sticky;
    top: 100px;
    /* Stick while scrolling */
}

.about-img {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.about-img:hover {
    transform: translateY(-5px);
}

/* About Content (Right Side) */
.about-content {
    flex: 1.2;
}

.section-subtitle {
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.about-text {
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* Skills Tags */
.skills-wrapper {
    margin-bottom: 2rem;
}

.skills-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    padding: 8px 16px;
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: var(--accent);
    color: black;
}

/* --- UPDATED: Education Box Design --- */
.education-wrapper h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.education-card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--nav-border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.education-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

/* Accent Line on Left of Card */
.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent);
    opacity: 0.7;
}

.edu-year {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: inline-block;
    background: rgba(6, 182, 212, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.edu-degree {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.edu-school {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.edu-grade {
    font-size: 0.9rem;
    color: var(--accent);
    margin-top: 0.5rem;
    font-weight: 600;
    display: inline-block;
}

/* --- Achievements Section Styles --- */
.achievements-wrapper {
    margin-top: 2rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.achievement-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--nav-border);
    overflow: hidden;
    /* Clips image corners */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow);
}

.achievement-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.achievement-img-container {
    width: 100%;
    height: 200px;
    /* Fixed height for uniform look */
    overflow: hidden;
    position: relative;
}

.achievement-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures image fills area without distortion */
    transition: transform 0.5s ease;
}

.achievement-card:hover .achievement-img {
    transform: scale(1.05);
    /* Zoom effect on hover */
}

.achievement-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.achievement-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.achievement-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* --- 6. PROJECTS SECTION STYLES (New) --- */
.projects-section {
    padding: 80px 2rem;
    background-color: var(--bg-body);
}

.projects-container {
    max-width: 1200px;
    margin: 0 auto;
}

.projects-header {
    text-align: center;
    margin-bottom: 1.6rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.project-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--nav-border);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
}

.project-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--nav-border);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* Tech Stack Pills */
.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.tech-pill {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    font-weight: 600;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Buttons */
.project-links {
    margin-top: auto;
    display: flex;
    gap: 1rem;
}

.link-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.demo-btn {
    background-color: var(--accent);
    color: white;
}

.demo-btn:hover {
    background-color: var(--accent-hover);
}

.github-btn {
    border: 1px solid var(--nav-border);
    color: var(--text-main);
    background-color: transparent;
}

.github-btn:hover {
    border-color: var(--text-main);
    background-color: var(--nav-border);
}

/* View All Button */
.view-all-container {
    text-align: center;
    margin-top: 1.3rem;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    border: 2px solid var(--accent);
    color: var(--accent);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background-color: var(--accent);
    color: black;
}

/* --- 7. CONTACT SECTION STYLES (New) --- */
.contact-section {
    padding: 80px 2rem 20px;
    background-color: var(--bg-body);
    border-top: 1px solid var(--nav-border);
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

.contact-info {
    flex: 1;
}

.contact-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
    background-color: var(--accent);
    color: white;
}

.contact-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.contact-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- REDESIGNED CONTACT FORM --- */
.contact-form-wrapper {
    flex: 1.2;
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--nav-border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

/* Decorative Accent Line */
.contact-form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--accent);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background-color: var(--bg-body);
    border: 1px solid var(--nav-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    /* Subtle inner depth */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
    /* Glow effect */
    background-color: var(--bg-card);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* --- 7. FOOTER --- */
footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    border-top: 1px solid var(--nav-border);
    margin-top: auto;
}

footer span {
    color: var(--accent);
}

/* --- 5. RESPONSIVE STYLES --- */
@media (max-width: 968px) {
    .hero-container {
        flex-direction: column-reverse;
        /* Image on top on mobile looks often better, or remove to keep standard */
        text-align: center;
        gap: 2rem;
    }

    /* On mobile, standard column order (Text top, image bottom) */
    .hero-container {
        flex-direction: column;
    }

    .hero-actions {
        justify-content: center;
        flex-direction: column;
        gap: 1.5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-image-wrapper {
        width: 100%;
    }

    .hero-img {
        width: 280px;
        height: 280px;
    }

    .hero-description {
        margin: 0 auto 2.5rem auto;
    }

    /* About Section Tablet Adjustments */
    .about-container {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1.5rem;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-body);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        border-left: 1px solid var(--nav-border);
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-role {
        font-size: 1.3rem;
        font-weight: 600;
        margin-bottom: 1rem;
    }


    /* About Section Mobile Logic */
    .about-container {
        flex-direction: column;
    }

    /* Hide Image on Mobile */
    .about-image-container {
        display: none;
    }

    .about-content {
        width: 100%;
    }

    .section-title {
        font-size: 2rem;
        font-weight: 700;
    }

    /* Contact Section Responsive */
    .contact-container {
        flex-direction: column;
        align-items: stretch;
        /* Ensure full width */
        gap: 3rem;
    }

    .contact-info {
        width: 100%;
        margin-bottom: 1rem;
    }

    .contact-form-wrapper {
        width: 100%;
        padding: 1.5rem;
    }
}

/* Placeholder Section Styles */
.placeholder-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--nav-border);
}