/* ==========================================================================
   TABLE OF CONTENTS
   1. Google Fonts & Root Variables
   2. Global Resets & Body Styles
   3. Reusable Components (Cards, Buttons, Tags)
   4. Header / Navbar
   5. Footer
   6. Resume Modal
   7. Video Modal
   8. Responsive Design
   9. Data Animation System
   10. Common Reusable Components
   ========================================================================== */

/* =============================================
   1. Google Fonts & Root Variables
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Poppins:wght@400;500;600;700&family=Rozha+One&display=swap');

:root {
    --heading-font: 'Abril Fatface', serif;
    --paragraph-font: 'Poppins', sans-serif;
    --special-heading-font: 'Rozha One', cursive;
    --code-font: 'Inconsolata', monospace;

    --bg-gradient-start: #000000;
    --bg-gradient-mid: #000713;
    --bg-gradient-end: #00050e;

    --accent-color: #00A9FF;
    --accent-color-hover: #0087cc;

    --title-color: #FFFFFF;
    --paragraph-color: #B3B3B3;

    --card-bg: #0A0A0A;
    --card-border: #232323;
    --card-border-hover: var(--accent-color);
    --card-shadow: rgba(0, 169, 255, 0.15);

    /* Subtle Modern Border Radius System */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 6px;
    --radius-btn: 4px;
    --radius-tag: 4px;
    --radius-card: 6px;
    --radius-modal: 6px;
    --radius-input: 4px;
}

/* Light Theme */
[data-theme="light"] {
    /* Light Theme Colors - Subtle Light Blues */
    --bg-gradient-start: #fafbff;
    --bg-gradient-mid: #e6ebff;
    --bg-gradient-end: #eff2ff;
    --accent-color: #0066cc;
    --accent-color-hover: #0052a3;
    --title-color: #1a202c;
    --paragraph-color: #4a5568;
    --card-bg: #ffffff;
    --card-border: #e6ebff;
    --card-border-hover: var(--accent-color);
    --card-shadow: rgba(0, 102, 204, 0.08);
}


/* ==========================================================================
   2. Global Resets & Body Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.6s ease,
        color 0.6s ease,
        border-color 0.6s ease,
        box-shadow 0.6s ease,
        opacity 0.4s ease;
}

html {
    scroll-behavior: smooth;
    /* Smooth transition for document theme changes */
    transition: all 0.6s ease;
}

body {
    font-family: var(--paragraph-font);
    line-height: 1.6;
    color: var(--paragraph-color);
    background: radial-gradient(ellipse at bottom, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    background-size: 200% 200%;
    animation: background-pan 25s linear infinite;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    transition: background 0.8s ease, color 0.6s ease;
}

@keyframes background-pan {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    /* Placed behind all content */
}

.main-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0px 10px 0 10px;
    gap: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 160px;
    /* Space for sticky header */
}

/* ==========================================================================
   Typography - Consistent across all pages
   ========================================================================== */

/* Headings */
h1 {
    font-family: var(--heading-font);
    font-size: 50px;
    color: var(--title-color);
    line-height: 1.2;
    letter-spacing: 2px;
    margin: 0;
}

h2 {
    font-family: var(--heading-font);
    font-size: 40px;
    color: var(--title-color);
    line-height: 1.2;
    margin: 0;
}

h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--title-color);
    line-height: 1.3;
    margin: 0;
}

h4 {
    font-size: 20px;
    font-weight: 500;
    color: var(--title-color);
    line-height: 1.4;
    margin: 0;
}

h5 {
    font-size: 18px;
    font-weight: 500;
    color: var(--title-color);
    line-height: 1.4;
    margin: 0;
}

h6 {
    font-size: 16px;
    font-weight: 500;
    color: var(--title-color);
    line-height: 1.4;
    margin: 0;
}

/* Paragraphs */
p {
    font-size: 16px;
    color: var(--paragraph-color);
    line-height: 1.6;
    margin: 0;
}

/* Section Titles - Reusable component */
.section-title {
    text-align: center;
    margin-bottom: 20px;
}

.section-title h2 {
    font-family: var(--heading-font);
    font-size: 40px;
    color: var(--title-color);
    line-height: 1.2;
}

.section-title h2 span {
    color: var(--accent-color);
}

.section-title p {
    font-size: 18px;
    color: var(--paragraph-color);
    max-width: 600px;
    margin: 0 auto;
}

/* Portfolio Headers - Reusable component */
.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    width: 100%;
}

.portfolio-header .head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.portfolio-header .head .awesome {
    margin-left: auto;
}

.portfolio-header .head h2 {
    flex: 1;
    font-family: var(--heading-font);
    font-size: 40px;
    color: var(--title-color);
    line-height: 1.2;
}

.portfolio-header .head h2 span {
    color: var(--accent-color);
}

.portfolio-header p {
    font-size: 18px;
    color: var(--paragraph-color);
    max-width: 100%;
}

/* Typography Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-accent {
    color: var(--accent-color);
}

.text-title {
    color: var(--title-color);
}

.text-paragraph {
    color: var(--paragraph-color);
}

.font-heading {
    font-family: var(--heading-font);
}

.font-paragraph {
    font-family: var(--paragraph-font);
}

.font-code {
    font-family: var(--code-font);
}

/* Base element styles */
a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ==========================================================================
   3. Reusable Components (Cards, Buttons, Tags)
   ========================================================================== */

/* --- Card --- */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card, 6px);
    padding: 25px;
    transition: all 0.3s ease-in-out;
    width: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px var(--card-shadow);
    border-color: var(--card-border-hover);
}

/* --- Buttons --- */
.filled-btn,
.outline-btn,
.awesome {
    transition: all 0.3s ease;
    border-radius: var(--radius-btn, 4px);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 18px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.filled-btn {
    background: var(--accent-color);
    color: #fff;
    border: 2px solid var(--accent-color);
}

.filled-btn:hover {
    border-color: var(--accent-color-hover);
    color: #fff;
}

.outline-btn {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--title-color);
    gap: 6px;
}

.outline-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.awesome {
    gap: 10px;
    font-size: 18px;
    font-weight: 500;
    color: var(--title-color);
    padding: 0;
    background: none;
    border: none;
}

.awesome:hover {
    color: var(--accent-color);
}

/* --- Tags --- */
.teg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-tag, 4px);
    background-color: rgba(0, 169, 255, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 500;
}

/* Light theme tags */
[data-theme="light"] .teg {
    background-color: rgba(0, 169, 255, 0.15);
}

.teg.more-tech {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    font-weight: 400;
}

/* Light theme more-tech tags */
[data-theme="light"] .teg.more-tech {
    background-color: rgba(71, 85, 105, 0.1);
    border: 1px solid rgba(71, 85, 105, 0.3);
    color: rgba(71, 85, 105, 0.8);
}


/* ==========================================================================
   4. Header / Navbar
   ========================================================================== */
.site-header {
    position: sticky;
    top: 20px;
    z-index: 100;
    width: 100%;
    padding: 0 10px;
    margin-bottom: -100px;
    /* Pulls the main content up */
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(22, 27, 34, 0.7);
    /* Dark theme background */
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card, 6px);
    padding: 10px 15px;
}

/* Light theme navbar background */
[data-theme="light"] .header-container {
    background: rgba(255, 255, 255, 0.8);
    /* Light semi-transparent background */
}

.nav-left ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-left a {
    color: var(--paragraph-color);
    font-weight: 500;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.nav-left a .nav-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nav-left a:hover {
    color: var(--title-color);
}

.nav-left a:hover .nav-dot {
    background: var(--title-color);
}

.nav-center-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 50px;
}

.nav-center-logo img {
    height: 50px;
    width: auto;
    max-width: none;
    flex-shrink: 0;
    transition: opacity 0.5s ease;
}

/* Theme-aware logo visibility with smooth transitions */
.logo-light {
    display: block;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.logo-dark {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Light theme logo switching with dissolve effect */
[data-theme="light"] .logo-light {
    display: none;
    opacity: 0;
}

[data-theme="light"] .logo-dark {
    display: block;
    opacity: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease, transform 0.2s ease;
    color: var(--paragraph-color);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 169, 255, 0.3);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    font-size: 18px;
    transition: all 0.4s ease, transform 0.3s ease;
    z-index: 2;
}

.theme-toggle.transitioning i {
    transform: rotate(180deg) scale(0.8);
    opacity: 0.6;
}

.mobile-nav-toggle {
    display: none;
}

/* Hidden on desktop */

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

@media (max-width: 992px) {

    /* Show mobile navigation elements */
    .mobile-nav-menu {
        display: block !important;
        position: absolute;
        top: calc(100% + 10px);
        left: 20px;
        right: 20px;
        background: var(--card-bg);
        backdrop-filter: blur(15px);
        border-radius: var(--radius-card, 6px);
        border: 1px solid var(--card-border);
        padding: 20px;
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }


}


/* ==========================================================================
   5. Footer
   ========================================================================== */
.site-footer {
    width: 100%;
    background-color: var(--bg-gradient-mid);
    padding: 60px 20px 30px;
    margin-top: 100px;
    border-top: 1px solid var(--card-border);
}

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

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col-about .footer-logo {
    margin-bottom: 15px;
}

.footer-col-about .footer-logo img {
    height: 50px;
    transition: opacity 0.3s ease;
}

.footer-col-about p {
    font-size: 15px;
    margin-bottom: 20px;
}

.social-icons {
    list-style: none;
    display: flex;
    gap: 15px;
    margin: 0;
    padding: 0;
}

.social-icons li {
    margin: 0;
    padding: 0;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    color: var(--accent-color);
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.1);
}

.social-icons a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.footer-col-links h4 {
    font-size: 18px;
    color: var(--title-color);
    margin-bottom: 20px;
    font-weight: 500;
}

.footer-col-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col-links a {
    color: var(--paragraph-color);
}

.footer-col-links a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 15px;
}

.copyright {
    font-size: 14px;
}

.footer-bottom-links {
    display: flex;
    gap: 25px;
}

.footer-bottom-links a {
    font-size: 14px;
    color: var(--paragraph-color);
}


/* ==========================================================================
   6. Resume Modal
   ========================================================================== */
.resume-modal {
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(1, 4, 9, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.resume-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 25px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-modal, 6px);
    width: 90%;
    max-width: 850px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.resume-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: var(--heading-font);
    font-size: 24px;
    color: var(--title-color);
}

.close-btn {
    background: none;
    border: none;
    color: var(--title-color);
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.close-btn:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.modal-body {
    overflow-y: auto;
    /* Make the resume preview scrollable */
    flex-grow: 1;
    border-radius: var(--radius-sm, 4px);
    border: 1px solid var(--card-border);
}

.modal-body img {
    width: 100%;
    height: auto;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.modal-footer .filled-btn i {
    margin-right: 8px;
}

/* ==========================================================================
   7. Video Modal
   ========================================================================== */
.video-modal {
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(1, 4, 9, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Light theme video modal background */
[data-theme="light"] .video-modal {
    background-color: rgba(71, 85, 105, 0.8);
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-modal .modal-content {
    background-color: var(--card-bg);
    padding: 25px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-modal, 6px);
    width: 90%;
    max-width: 850px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.video-modal.active .modal-content {
    transform: scale(1);
}

.video-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.video-modal .modal-header h3 {
    font-family: var(--heading-font);
    font-size: 24px;
    color: var(--title-color);
}

.video-modal .close-btn {
    background: none;
    border: none;
    color: var(--title-color);
    font-size: 40px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.video-modal .close-btn:hover {
    color: var(--accent-color);
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-card, 6px);
    background-color: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.no-video-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-color);
    padding: 2rem;
}

.no-video-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.no-video-message h4 {
    margin: 1rem 0 0.5rem;
    font-size: 1.5rem;
}

.no-video-message p {
    opacity: 0.8;
    margin: 0;
}


/* ==========================================================================
   8. Responsive Design
   ========================================================================== */
/* Mobile header theme toggle - only visible on mobile */
.mobile-header-theme-toggle {
    display: none;
    transition: all 0.4s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.mobile-header-theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 169, 255, 0.3);
}

.mobile-header-theme-toggle:active {
    transform: scale(0.95);
}

.mobile-header-theme-toggle i {
    transition: all 0.4s ease, transform 0.3s ease;
}

.mobile-header-theme-toggle.transitioning i {
    transform: rotate(180deg) scale(0.8);
    opacity: 0.6;
}

@media (max-width: 992px) {
    .main-container {
        gap: 100px;
    }

    .nav-left,
    .nav-right {
        display: none;
    }

    .mobile-nav-toggle,
    .mobile-header-theme-toggle {
        display: block;
    }

    /* Header Container Mobile Layout */
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        min-width: 100%;
        padding: 12px 20px;
    }

    /* Mobile hamburger - left side */
    .mobile-nav-toggle {
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
        width: 30px;
        height: 22px;
        position: relative;
        order: 1;
    }

    /* Center logo */
    .nav-center-logo {
        order: 2;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        flex-shrink: 0;
        /* Prevent shrinking */
    }

    .nav-center-logo img {
        height: 40px;
        /* Slightly smaller for mobile but maintains aspect ratio */
        width: auto;
        /* Preserve aspect ratio */
        max-width: none;
        flex-shrink: 0;
    }

    /* Mobile theme toggle - right side */
    .mobile-header-theme-toggle {
        order: 3;
        width: 40px;
        height: 40px;
    }

    .mobile-nav-toggle .line {
        position: absolute;
        width: 100%;
        height: 3px;
        background-color: var(--title-color);
        border-radius: 3px;
        transition: transform 0.3s ease, opacity 0.3s ease;
        left: 0;
    }

    .mobile-nav-toggle .top {
        top: 0;
    }

    .mobile-nav-toggle .middle {
        top: 50%;
        transform: translateY(-50%);
    }

    .mobile-nav-toggle .bottom {
        bottom: 0;
    }

    .site-header.mobile-menu-active .mobile-nav-menu {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
        width: 100%;
    }

    .mobile-nav-links a {
        color: var(--title-color);
        font-size: 15px;
        font-weight: 500;
        padding: 8px 15px;
        border-radius: 10px;
        transition: all 0.3s ease;
        width: 100%;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .mobile-nav-links a .nav-dot {
        width: 8px;
        height: 8px;
        background: var(--accent-color);
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .mobile-nav-links a:hover {
        color: var(--accent-color);
    }

    .mobile-nav-links a:hover .nav-dot {
        background: var(--title-color);
        transform: scale(1.3);
    }

    .mobile-nav-buttons {
        display: flex;
        gap: 15px;
        width: 100%;
        align-items: center;
    }

    .mobile-nav-buttons .outline-btn,
    .mobile-nav-buttons .filled-btn {
        flex: 1;
        text-align: center;
        padding: 8px 15px;
        font-size: 13px;
    }

    .mobile-theme-toggle {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
        transition: all 0.4s ease, transform 0.2s ease;
        position: relative;
        overflow: hidden;
    }

    .mobile-theme-toggle:hover {
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(0, 169, 255, 0.3);
    }

    .mobile-theme-toggle:active {
        transform: scale(0.95);
    }

    .mobile-theme-toggle i {
        transition: all 0.4s ease, transform 0.3s ease;
    }

    .mobile-theme-toggle.transitioning i {
        transform: rotate(180deg) scale(0.8);
        opacity: 0.6;
    }

    /* Active (X) state for hamburger */
    .site-header.mobile-menu-active .mobile-nav-toggle .top {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .site-header.mobile-menu-active .mobile-nav-toggle .middle {
        opacity: 0;
    }

    .site-header.mobile-menu-active .mobile-nav-toggle .bottom {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Footer Responsive */
    .footer-top {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 768px) {

    body {
        padding: 20px 0;
    }

    .main-container {
        gap: 100px;
        padding: 0 15px;
        margin-top: 140px;
    }

    /* Reduced margin */

    /* Responsive Typography */
    h1 {
        font-size: 45px;
    }

    h2 {
        font-size: 35px;
    }

    h3 {
        font-size: 22px;
    }

    h4 {
        font-size: 19px;
    }

    .section-title h2,
    .portfolio-header .head h2 {
        font-size: 35px;
    }

    .section-title p,
    .portfolio-header p {
        font-size: 16px;
    }

    /* Footer 2x2 Grid Layout */
    .footer-top {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px 20px;
    }

    .footer-col-about {
        grid-column: 1 / -1;
        text-align: center;
        align-items: center;
        margin-bottom: 10px;
    }

    .footer-col-about .footer-logo {
        display: flex;
        justify-content: center;
        margin-bottom: 15px;
    }

    .footer-col-about .footer-logo img {
        margin: 0 auto;
    }

    .footer-col-links {
        grid-column: auto;
        grid-row: auto;
        text-align: left;
    }

    .footer-bottom {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding-top: 24px;
    }

    .copyright {
        text-align: center;
        width: 100%;
        margin: 0;
        font-size: 13px;
        color: var(--paragraph-color);
    }

    .footer-bottom-links {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 20px;
        width: 100%;
        flex-wrap: wrap;
    }

    .footer-bottom-links a {
        font-size: 13px;
        text-align: center;
    }

    /* Common Grid Responsive */
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 576px) {
    .main-container {
        gap: 75px;
    }

    /* Reduced margin */

    /* Responsive Typography */
    h1 {
        font-size: 40px;
    }

    h2 {
        font-size: 30px;
    }

    h3 {
        font-size: 20px;
    }

    h4 {
        font-size: 18px;
    }

    h5 {
        font-size: 16px;
    }

    h6 {
        font-size: 14px;
    }

    p {
        font-size: 15px;
    }

    .section-title h2,
    .portfolio-header .head h2 {
        font-size: 30px;
        line-height: 1.2;
    }

    .section-title p,
    .portfolio-header p {
        font-size: 16px;
    }

    .portfolio-header .head {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 15px;
    }

    .portfolio-header .head h2 {
        flex: none;
    }

    .card {
        padding: 20px;
    }

    .filled-btn,
    .outline-btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .mobile-nav-buttons {
        gap: 10px;
    }

    .mobile-nav-buttons .outline-btn,
    .mobile-nav-buttons .filled-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .footer-top {
        gap: 20px;
    }

    .footer-col-about {
        margin-bottom: 5px;
    }

    .footer-col-about .footer-logo {
        display: flex;
        justify-content: center;
        margin-bottom: 15px;
    }

    .footer-col-about .footer-logo img {
        margin: 0 auto;
    }

    .footer-col-about .footer-logo img {
        height: 50px;
        width: auto;
    }

    .footer-col-links h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .footer-col-links ul li {
        margin-bottom: 5px;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    /* Reduce Navbar Icons Size */
    .mobile-nav-toggle {
        width: 24px;
        height: 18px;
    }

    .mobile-header-theme-toggle {
        width: 32px;
        height: 32px;
    }

    .mobile-header-theme-toggle i {
        font-size: 14px;
    }

    .site-header.mobile-menu-active .mobile-nav-toggle .top {
        transform: rotate(45deg) translate(4px, 4px);
    }

    .site-header.mobile-menu-active .mobile-nav-toggle .bottom {
        transform: rotate(-45deg) translate(5px, -4px);
    }

    .footer-col-links ul li a {
        font-size: 14px;
    }

    /* Common Grid Responsive */
    .cards-container {
        grid-template-columns: 1fr;
    }

    .grid-2-cols {
        grid-template-columns: 1fr;
    }

    .grid-auto-fit {
        grid-template-columns: 1fr;
    }
}

/* Very Small Screens (400px and below, down to 320px) */
@media (max-width: 400px) {

    .main-container {
        padding: 0 8px;
        margin-top: 120px;
        gap: 40px;
    }

    .site-header {
        top: 10px;
        padding: 0 6px;
    }

    .header-container {
        padding: 8px 12px;
    }

    .nav-center-logo img {
        height: 32px;
        max-width: 130px;
        object-fit: contain;
    }

    .mobile-nav-toggle {
        width: 22px;
        height: 16px;
    }

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

    .mobile-header-theme-toggle i {
        font-size: 13px;
    }

    .mobile-nav-menu {
        left: 8px !important;
        right: 8px !important;
        padding: 15px 12px !important;
    }

    /* Responsive Typography for small screens down to 320px */
    h1 {
        font-size: 28px !important;
        line-height: 1.2 !important;
        letter-spacing: 0.5px !important;
        word-break: break-word;
    }

    h2 {
        font-size: 24px !important;
        line-height: 1.2 !important;
        word-break: break-word;
    }

    h3 {
        font-size: 18px !important;
        line-height: 1.3 !important;
    }

    h4 {
        font-size: 16px !important;
        line-height: 1.3 !important;
    }

    p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    .section-title h2,
    .portfolio-header .head h2 {
        font-size: 24px !important;
    }

    .section-title p,
    .portfolio-header p {
        font-size: 14px !important;
    }

    .mobile-nav-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .mobile-nav-buttons .outline-btn,
    .mobile-nav-buttons .filled-btn {
        flex: none;
        width: 100%;
        font-size: 12px;
        padding: 8px 10px;
        white-space: nowrap;
        text-align: center;
        justify-content: center;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .modal-content,
    .video-modal .modal-content {
        width: 95%;
        padding: 16px 12px;
        border-radius: 12px;
    }

    .modal-header h3,
    .video-modal .modal-header h3 {
        font-size: 18px;
    }

    .modal-footer .filled-btn {
        width: 100%;
        font-size: 13px;
        padding: 10px;
        justify-content: center;
    }

    /* Footer Responsive for 320px-400px */
    .site-footer {
        padding: 35px 12px 20px;
        margin-top: 50px;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 24px 12px;
    }

    .footer-col-about {
        grid-column: 1 / -1;
        text-align: center;
    }

    .footer-col-links {
        grid-column: auto;
        grid-row: auto;
        text-align: left;
    }

    .footer-col-links h4 {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .footer-col-links ul {
        gap: 6px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding-top: 20px;
    }

    .copyright {
        text-align: center;
        font-size: 12px;
        line-height: 1.5;
    }

    .footer-bottom-links {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .footer-bottom-links a {
        font-size: 12px;
        text-align: center;
    }

    .social-icons {
        gap: 10px;
    }

    .social-icons a {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* Extra Small Devices (320px to 360px) */
@media (max-width: 360px) {
    .main-container {
        padding: 0 6px;
        margin-top: 110px;
    }

    h1 {
        font-size: 24px !important;
    }

    h2 {
        font-size: 20px !important;
    }

    .section-title h2,
    .portfolio-header .head h2 {
        font-size: 20px !important;
    }

    .nav-center-logo img {
        height: 28px;
        max-width: 110px;
    }

    .card {
        padding: 12px;
    }
}

/* ==========================================================================
   9. Clickable Cards Enhancement
   ========================================================================== */
.clickable-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 169, 255, 0.15);
}

.clickable-card:active {
    transform: scale(0.98);
}

/* Prevent text selection on clickable cards for better UX */
.clickable-card {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure links inside clickable cards are still selectable */
.clickable-card a,
.clickable-card button {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

/* ==========================================================================
   10. Common Pagination Styles
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.pagination-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--paragraph-color);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.page-numbers {
    display: flex;
    gap: 10px;
}

.page-number {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--paragraph-color);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
}

.pagination-btn:hover:not(:disabled),
.page-number:hover,
.page-number.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 169, 255, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Responsive pagination */
@media (max-width: 576px) {
    .pagination {
        gap: 8px;
        margin-top: 30px;
    }

    .pagination-btn,
    .page-number {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* ==========================================================================
   GLOBAL READING PROGRESS INDICATOR
   ========================================================================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-color);
    z-index: 1001;
    transition: width 0.1s ease;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    animation: progress-reveal 0.3s ease forwards;
}

.reading-progress.active {
    opacity: 1;
    transform: scaleX(1);
}

@keyframes progress-reveal {
    from {
        opacity: 0;
        transform: scaleX(0);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* =============================================
   9. Data Animation System (see animations.css)
   ========================================================================== */

/* =============================================
   10. Common Reusable Components
   ========================================================================== */

/* Breadcrumb Navigation */
.breadcrumb {
    width: 100%;
    margin-bottom: 15px;
}

.breadcrumb ul {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0;
}

.breadcrumb ul li {
    font-size: 14px;
    color: var(--paragraph-color);
}

.breadcrumb ul li:not(:last-child)::after {
    content: "›";
    margin-left: 10px;
}

.breadcrumb ul li.active {
    font-weight: 600;
    color: var(--title-color);
}

.breadcrumb ul li a {
    color: var(--paragraph-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb ul li a:hover {
    color: var(--accent-color);
}

/* Common Grid Layouts */
.cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    width: 100%;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

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

/* Page Header Component */
.page-header {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.page-header h1 {
    line-height: 1.1;
}

.page-header h1 span {
    color: var(--accent-color);
}

.page-header p {
    font-size: 18px;
    color: var(--paragraph-color);
    max-width: 800px;
    margin: 0 auto;
}