/* Mobile-First Responsive Design */

/* Base Mobile Styles (320px+) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Navbar Mobile */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

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

.logo {
    font-size: 1.25rem;
    z-index: 1001;
}

.nav-menu {
    position: fixed;
    left: -100%;
    top: 60px;
    flex-direction: column;
    width: 100%;
    text-align: center;
    transition: 0.3s;
    padding: 2rem 0;
    gap: 0;
}

.nav-menu li {
    margin: 0.5rem 0;
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-resume-nav {
    display: none;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    transition: 0.3s;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

/* Hero Section Mobile */
.hero {
    min-height: 100vh;
    padding: 80px 1rem 2rem;
    display: flex;
    align-items: center;
}

.hero-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.hero-content {
    order: 2;
}

.hero-image {
    order: 1;
    display: flex;
    justify-content: center;
}

.hero-title {
    font-size: 1.75rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.hero-typing {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    min-height: 2rem;
}

.hero-tagline {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.hero-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.btn {
    width: 100%;
    padding: 14px 24px;
    min-height: 48px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.tech-badge {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
}

.hero-profile-pic {
    width: 240px;
    height: 240px;
}

.hero-profile-pic img {
    width: 200px;
    height: 200px;
}

.hero-blob {
    width: 240px;
    height: 240px;
}

.open-to-work-badge {
    bottom: 10px;
    right: 5px;
    padding: 6px 12px;
    font-size: 0.7rem;
}

.scroll-indicator {
    display: none;
}

/* Sections Mobile */
section {
    padding: 3rem 0;
}

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

/* About Section Mobile */
.about-text p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.stat-item {
    padding: 1.5rem;
}

.stat-item h3 {
    font-size: 2rem;
}

/* Skills Section Mobile */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.skill-category {
    padding: 1.5rem;
}

.skill-icon {
    font-size: 2.5rem;
}

.skill-description {
    font-size: 0.9rem;
    min-height: auto;
}

.skill-tags {
    gap: 0.4rem;
}

.skill-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Projects Section Mobile */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.project-card {
    width: 100%;
}

.project-content {
    padding: 1.25rem;
}

.project-content h3 {
    font-size: 1.1rem;
}

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

.project-features li {
    font-size: 0.85rem;
    padding: 0.4rem 0;
}

.project-tech {
    gap: 0.4rem;
}

.project-tech span {
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
}

/* Courses Section Mobile */
.courses-subtitle {
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}

.courses-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.course-card {
    padding: 1rem;
}

.course-card h3 {
    font-size: 1rem;
}

.course-description {
    font-size: 0.88rem;
}

.service-points li {
    font-size: 0.82rem;
}

.course-meta {
    flex-direction: column;
    align-items: flex-start;
}

.btn-course-buy {
    width: 100%;
}

.course-nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}

.project-links {
    flex-direction: column;
    gap: 0.75rem;
}

.btn-icon {
    width: 100%;
    justify-content: center;
}

/* Timeline Mobile */
.timeline {
    padding-left: 30px;
}

.timeline::before {
    left: 10px;
}

.timeline-dot {
    left: -28px;
    width: 16px;
    height: 16px;
}

.timeline-content {
    padding: 1.25rem;
}

.timeline-description {
    font-size: 0.9rem;
}

/* Publications Mobile */
.publication-card {
    flex-direction: column;
    padding: 1.5rem;
    text-align: center;
}

.publication-icon {
    font-size: 2.5rem;
}

.publication-content h3 {
    font-size: 1.1rem;
}

/* Education Mobile */
.education-certifications-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.education-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.education-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
}

.education-icon {
    font-size: 3rem;
}

.certifications-sidebar {
    position: static;
    padding: 1.5rem;
}

.cert-item {
    padding: 0.75rem;
}

/* GitHub Section Mobile */
.github-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.github-stat-card {
    padding: 1.25rem;
    flex-direction: column;
    text-align: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.5rem;
}

.github-calendar-wrapper {
    padding: 0.5rem;
    overflow-x: auto;
}

/* Contact Section Mobile */
.contact-intro {
    text-align: left;
    margin-bottom: 2rem;
}

.contact-availability {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
}

.contact-message,
.contact-cta {
    font-size: 0.95rem;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.contact-link {
    padding: 0.9rem;
}

.contact-link span {
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.9rem;
    font-size: 0.95rem;
}

/* Footer Mobile */
.footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.social-links {
    justify-content: center;
}

/* Back to Top Mobile */
.back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
}

/* 480px - Small Mobile Landscape */
@media (min-width: 480px) {
    .container {
        padding: 0 1.5rem;
    }

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

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

    .hero-typing {
        font-size: 1.1rem;
    }

    .hero-profile-pic {
        width: 280px;
        height: 280px;
    }

    .hero-profile-pic img {
        width: 240px;
        height: 240px;
    }

    .hero-blob {
        width: 280px;
        height: 280px;
    }

    .open-to-work-badge {
        padding: 7px 14px;
        font-size: 0.75rem;
    }

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

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .btn {
        font-size: 1rem;
    }
}

/* 768px - Tablet */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }

    .nav-menu {
        position: static;
        flex-direction: row;
        width: auto;
        padding: 0;
        gap: 2rem;
    }

    .hamburger {
        display: none;
    }

    .btn-resume-nav {
        display: inline-flex;
    }

    .hero {
        padding: 100px 2rem 2rem;
    }

    .hero-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        text-align: left;
    }

    .hero-content {
        order: 1;
    }

    .hero-image {
        order: 2;
    }

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

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

    .hero-typing {
        font-size: 1.4rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

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

    .hero-buttons {
        flex-direction: row;
        width: auto;
    }

    .btn {
        width: auto;
        padding: 12px 28px;
    }

    .tech-stack {
        justify-content: flex-start;
    }

    .hero-profile-pic {
        width: 350px;
        height: 350px;
    }

    .hero-profile-pic img {
        width: 300px;
        height: 300px;
    }

    .hero-blob {
        width: 350px;
        height: 350px;
    }

    .open-to-work-badge {
        bottom: 15px;
        right: 10px;
        padding: 8px 18px;
        font-size: 0.8rem;
    }

    .scroll-indicator {
        display: block;
    }

    section {
        padding: 5rem 0;
    }

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

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .education-certifications-wrapper {
        grid-template-columns: 2fr 1fr;
        gap: 2.5rem;
    }

    .education-item {
        grid-template-columns: 120px 1fr;
        gap: 1.5rem;
    }

    .education-card {
        flex-direction: row;
        text-align: left;
        padding: 2rem;
    }

    .certifications-sidebar {
        position: sticky;
        top: 100px;
    }

    .github-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .github-stat-card {
        flex-direction: row;
        text-align: left;
        padding: 1.5rem;
    }

    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .publication-card {
        flex-direction: row;
        text-align: left;
        padding: 2rem;
    }
}

/* 992px - Laptop */
@media (min-width: 992px) {
    .container {
        padding: 0 2.5rem;
    }

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

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

    .hero-typing {
        font-size: 1.6rem;
    }

    .hero-profile-pic {
        width: 400px;
        height: 400px;
    }

    .hero-profile-pic img {
        width: 350px;
        height: 350px;
    }

    .hero-blob {
        width: 400px;
        height: 400px;
    }

    .open-to-work-badge {
        bottom: 20px;
        right: -10px;
        padding: 8px 20px;
        font-size: 0.85rem;
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .skill-description {
        min-height: 48px;
    }
}

/* 1200px - Large Desktop */
@media (min-width: 1200px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-container {
        gap: 4rem;
    }

    .projects-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    section {
        padding: 6rem 0;
    }
}

/* Prevent horizontal scroll */
body, html {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Touch-friendly buttons */
button, a.btn, .btn-icon, .contact-link {
    min-height: 44px;
    min-width: 44px;
}

/* Responsive tables */
@media (max-width: 767px) {
    .proof-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .proof-table {
        min-width: 600px;
    }
}

/* ================= FINAL CONSOLIDATED OVERRIDES ================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

.nav-container {
    padding: 0.45rem 1rem;
}

section {
    position: relative;
    scroll-margin-top: 88px;
    padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

.section-title {
    margin-bottom: clamp(1.6rem, 3.5vw, 2.6rem);
}

.projects-grid {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

.project-card {
    width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.skills .skills-grid {
    gap: 1.25rem;
}

.skills .skill-category {
    padding: 1.35rem;
}

.skills .skill-icon {
    font-size: 2.35rem;
    margin-bottom: 0.7rem;
}

.skills .skill-category h3 {
    margin-bottom: 0.65rem;
}

.skills .skill-description {
    margin-bottom: 0.85rem;
    min-height: auto;
}

@media (max-width: 768px) {
    .back-to-top {
        right: 16px;
        bottom: 152px;
    }

    .skills .skill-category {
        padding: 1.15rem;
    }
}

/* ================= ALTERNATIVE NAVBAR DESIGN ================= */
.navbar {
    background: transparent;
    box-shadow: none;
    padding-top: 8px;
}

.nav-container {
    min-height: 58px;
    padding: 0.32rem 0.72rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 10px 28px rgba(20, 24, 40, 0.11);
    gap: 0.45rem;
}

[data-theme="dark"] .nav-container {
    background: rgba(20, 20, 24, 0.9);
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.logo {
    min-width: 126px;
    width: 126px;
    font-size: 1.05rem;
}

.nav-menu {
    gap: 0.35rem;
}

.nav-menu li {
    margin: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.83rem;
    line-height: 1;
    padding: 0.5rem 0.64rem;
    border-radius: 999px;
}

.nav-link::after {
    display: none;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(102, 126, 234, 0.14);
}

.btn-resume-nav {
    padding: 6px 10px;
    font-size: 0.75rem;
}

.nav-social-icons a,
.theme-toggle {
    width: 30px;
    height: 30px;
}

.theme-toggle {
    min-width: 30px;
}

@media (min-width: 768px) and (max-width: 1180px) {
    .nav-social-icons,
    .btn-resume-nav {
        display: none;
    }
}

@media (max-width: 767px) {
    .navbar {
        padding-top: 6px;
    }

    .nav-container {
        min-height: 50px;
        padding: 0.18rem 0.58rem;
        border-radius: 14px;
    }

    .logo {
        min-width: 108px;
        width: 108px;
        font-size: 1rem;
    }

    .theme-toggle {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }

    .hamburger {
        padding: 5px;
        gap: 3px;
    }

    .hamburger span {
        width: 20px;
        height: 2px;
    }

    .nav-menu {
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        top: 58px;
        max-height: calc(100vh - 58px);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: transform 0.25s ease, opacity 0.25s ease;
        border-radius: 16px;
        padding: 0.6rem;
        background: rgba(255, 255, 255, 0.97);
        border: 1px solid rgba(0, 0, 0, 0.07);
        box-shadow: 0 16px 34px rgba(17, 24, 39, 0.18);
    }

    [data-theme="dark"] .nav-menu {
        background: rgba(18, 18, 22, 0.97);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .nav-menu.active {
        left: 0.75rem;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-menu li {
        margin: 0.15rem 0;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        font-size: 0.95rem;
        padding: 0.7rem 0.8rem;
    }
}
