:root {
    --bg-color: #1c263b;
    --card-bg: #25334e;
    --card-hover-bg: #2b3b5a;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --hero-bg: #1c263b;
    --stats-bg: radial-gradient(circle at center, #25334e 0%, #1c263b 100%);
    --footer-bg: #131a28;
    --modal-bg: #1c263b;
    --chart-wrapper-bg: #1c263b;
    --scrollbar-thumb: #475569;
    --transition-slow: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --overlay-bg: rgba(28, 38, 59, 0.9);
    --btn-icon-bg: rgba(255, 255, 255, 0.05);
    --icon-border: rgba(255, 255, 255, 0.1);
}

.dark {
    --bg-color: #1c263b;
    --card-bg: #25334e;
    --card-hover-bg: #2b3b5a;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --hero-bg: #1c263b;
    --stats-bg: radial-gradient(circle at center, #25334e 0%, #1c263b 100%);
    --footer-bg: #131a28;
    --modal-bg: #1c263b;
    --chart-wrapper-bg: #1c263b;
    --scrollbar-thumb: #475569;
    --overlay-bg: rgba(28, 38, 59, 0.9);
    --btn-icon-bg: rgba(255, 255, 255, 0.05);
    --icon-border: rgba(255, 255, 255, 0.1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

.library-body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* CORE SCROLLBAR ARCHITECTURE */
.library-body::-webkit-scrollbar {
    width: 8px;
}
.library-body::-webkit-scrollbar-track {
    background: var(--bg-color);
}
.library-body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}
.library-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* GLOBAL SCROLL PROGRESS INDICATOR */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 2000;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-color));
    width: 0%;
    box-shadow: 0 0 15px var(--accent-color);
}

/* LAYOUT: SCROLLABLE MAIN CONTAINER */
.library-main {
    overflow-x: hidden;
    position: relative;
    z-index: 20;
    margin-top: -38vh;
}

.library-section {
    position: relative;
    will-change: transform, opacity;
}

/* COMPONENT: PROJECT CARD ARCHITECTURE */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    cursor: default;
}

.dark .project-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at 50% 50%, rgba(99, 102, 241, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: none;
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.1);
}
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.loader-wrapper {
    display: none !important;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--accent-color);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* UI: NAVIGATION OVERRIDES & UNIFICATION */
.floating-nav-container {
    z-index: 3100 !important; /* Above loader */
}

.loader-wrapper.hidden {
    display: none !important;
}

/* STYLES: LEGACY NAVIGATION DISMISSAL */
.library-nav, .mobile-nav-overlay, .nav-container, .nav-links-wrapper, .nav-right, .mobile-menu-toggle {
    display: none !important;
}

.close-menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-links {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
}

.mobile-links .lib-nav-link {
    font-size: 1.5rem;
}

.lib-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    padding: 8px 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lib-nav-link::before {
    content: '<';
    position: absolute;
    left: -10px;
    opacity: 0;
    color: var(--accent-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 0 8px var(--accent-color);
}

.lib-nav-link::after {
    content: '/>';
    position: absolute;
    right: -15px;
    opacity: 0;
    color: var(--accent-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 0 8px var(--accent-color);
}

.lib-nav-link:hover {
    color: #fff;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 4px;
    animation: nav-glitch 0.3s infinite;
}

.lib-nav-link:hover::before {
    opacity: 1;
    left: 0px;
}

.lib-nav-link:hover::after {
    opacity: 1;
    right: -2px;
}

@keyframes nav-glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(-1px, -1px); }
    60% { transform: translate(1px, 1px); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

.library-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
    justify-self: start;
    font-family: monospace;
}

.logo-char {
    display: inline-block;
    transition: all 0.2s ease-out;
    min-width: 0.6em;
}

.logo-char.morphing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-char.final {
    color: inherit;
}

/* SECTION: PROJECT LIBRARY HERO DESIGN */
.library-hero {
    position: relative;
    height: 100vh;
    display: grid;
    place-items: center;
    background: var(--hero-bg);
    overflow: hidden;
}

.cyber-grid {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
    z-index: 1;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.6;
}

.hero-content {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    text-align: right;
    pointer-events: none;
}

.hero-content-left {
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    text-align: left;
    pointer-events: none;
}

.glitch-text {
    font-size: clamp(2.5rem, 8vw, 4.8rem);
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    color: var(--text-primary);
    margin: 0;
    line-height: 1;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.8;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    20% { clip: rect(62px, 9999px, 42px, 0); }
    40% { clip: rect(16px, 9999px, 78px, 0); }
    60% { clip: rect(87px, 9999px, 12px, 0); }
    80% { clip: rect(53px, 9999px, 95px, 0); }
    100% { clip: rect(2px, 9999px, 64px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    20% { clip: rect(25px, 9999px, 56px, 0); }
    40% { clip: rect(98px, 9999px, 12px, 0); }
    60% { clip: rect(4px, 9999px, 85px, 0); }
    80% { clip: rect(76px, 9999px, 34px, 0); }
    100% { clip: rect(12px, 9999px, 90px, 0); }
}

.floating-syntax-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
}

.syntax-element {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: rgba(99, 102, 241, 0.4);
    white-space: nowrap;
    user-select: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
}
.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    position: relative;
}
.mouse::before {
    content: '';
    width: 4px; height: 8px; background: var(--accent-color);
    position: absolute; left: 50%; transform: translateX(-50%); top: 8px;
    border-radius: 2px; animation: scroll 2s infinite;
}
@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 15px); opacity: 0; }
}

/* SECTION: DYNAMIC CONTENT FILTERING */
.filter-section {
    padding: 2rem 5% 0px;
    text-align: center;
}
.filter-chips {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.chip {
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-slow);
}
.chip.active, .chip:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* SECTION: PROJECT SHOWCASE GRID ARCHITECTURE */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 0 5% 5rem;
    margin-top: -18rem;
}

@media (max-width: 1100px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.project-logo-container {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--btn-icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--icon-border);
    transition: all 0.3s ease;
}

.project-card:hover .project-logo-container {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.project-card-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.project-card-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-color);
}

.card-tag {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.project-card-body {
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.project-card-body h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
    transition: color 0.3s ease;
}

.project-card:hover .project-card-body h3 {
    color: var(--accent-color);
}

.project-card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 2;
}

.footer-links {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--btn-icon-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-icon:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-icon svg, .btn-icon i {
    width: 18px;
    height: 18px;
}

.btn-main {
    border: 1px solid transparent;
    border-radius: 8px;
    background: 
        linear-gradient(#25334e, #25334e) padding-box,
        linear-gradient(90deg, rgba(99, 102, 241, 0.4), rgba(255, 255, 255, 0.15), rgba(99, 102, 241, 0.4)) border-box;
    background-size: 100% 100%, 200% 100%;
    background-position: 0% 0%, 0% 0%;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.4rem;
    transition: color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.dark .btn-main {
    background: 
        linear-gradient(#25334e, #25334e) padding-box,
        linear-gradient(90deg, rgba(99, 102, 241, 0.4), rgba(255, 255, 255, 0.15), rgba(99, 102, 241, 0.4)) border-box;
    background-size: 100% 100%, 200% 100%;
}

.btn-main:hover {
    background: 
        linear-gradient(#2b3b5a, #2b3b5a) padding-box,
        linear-gradient(90deg, #6366f1, #a855f7, #00f2fe, #6366f1) border-box;
    background-size: 100% 100%, 200% 100%;
    animation: border-sweep 3s linear infinite;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25);
}

@keyframes border-sweep {
    0% {
        background-position: 0% 0%, 0% 0%;
    }
    100% {
        background-position: 0% 0%, 200% 0%;
    }
}

.btn-main i,
.btn-main svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-main:hover i,
.btn-main:hover svg {
    transform: translateX(4px);
}

/* SECTION: ECOSYSTEM ANALYTICS & STATS */
.stats-section {
    padding: 8rem 5%;
    background: var(--stats-bg);
    position: relative;
    overflow: hidden;
}

.stats-container {
    position: relative;
    z-index: 1;
}

.chart-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: var(--chart-wrapper-bg);
    padding: 4rem;
    border-radius: 40px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(25px);
    position: relative;
    height: 500px;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 4rem;
    letter-spacing: -2px;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* SECTION: COMPONENT FOOTER ARCHITECTURE */
.library-footer {
    position: relative;
    padding: 6rem 0 2rem;
    background: var(--footer-bg);
    border-top: 1px solid var(--glass-border);
    overflow: hidden;
}

.library-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0.2;
}

.footer-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 2;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.library-logo {
    display: inline-flex;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tagline {
    color: var(--text-secondary);
    max-width: 380px;
    font-size: 1.05rem;
    line-height: 1.7;
}

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

.footer-links-group h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-links-group h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 20px;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
}

.footer-links-group ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

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

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

.social-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--btn-icon-bg);
    border: 1px solid var(--icon-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--accent-color);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 0;
}

.social-btn i, .social-btn svg {
    position: relative;
    z-index: 1;
    transition: color 0.4s ease;
    width: 22px !important;
    height: 22px !important;
    display: block;
}

.social-btn:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.social-btn:hover::before {
    transform: translateY(0);
}

.social-btn:hover i, .social-btn:hover svg {
    color: #ffffff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2.5rem;
    border-top: 1px solid var(--glass-border);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.back-to-top {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 0.8;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    opacity: 1;
    box-shadow: 0 8px 25px var(--accent-glow);
}

/* COMPONENT: PROJECT DETAILS MODAL SYSTEM */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(15px);
    overflow-y: auto;
    padding: 2rem 0;
    align-items: flex-start;
    justify-content: center;
}
.modal-content {
    background: var(--modal-bg);
    margin: auto;
    padding: 3rem;
    width: 90%;
    max-width: 800px;
    border-radius: 30px;
    border: 1px solid rgba(203, 213, 225, 0.8); /* Light color border */
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}
.close-modal {
    position: absolute;
    right: 2rem; top: 2rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 10;
}

.modal-header-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-icon-container {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: var(--btn-icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--icon-border);
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.modal-header-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

.modal-header-icon {
    width: 36px;
    height: 36px;
    color: var(--accent-color);
}

.modal-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    margin: 0;
}

.modal-tag {
    align-self: flex-start;
    margin: 0;
    font-size: 0.8rem;
}

.modal-body-section {
    margin-bottom: 2.5rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-chip {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    background: var(--btn-icon-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    pointer-events: none;
}

.modal-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.modal-actions .btn-main {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 12px;
}

.modal-btn-store {
    background: 
        linear-gradient(#1c263b, #1c263b) padding-box,
        linear-gradient(90deg, rgba(34, 197, 94, 0.35), rgba(255, 255, 255, 0.1), rgba(34, 197, 94, 0.35)) border-box;
    background-size: 100% 100%, 200% 100%;
    color: #22c55e;
    border: 1px solid transparent;
}
.modal-btn-store:hover {
    background: 
        linear-gradient(#1c263b, #1c263b) padding-box,
        linear-gradient(90deg, #22c55e, #4ade80, #22c55e) border-box;
    background-size: 100% 100%, 200% 100%;
    animation: border-sweep 3s linear infinite;
    color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.25);
}

.modal-btn-live {
    background: 
        linear-gradient(#1c263b, #1c263b) padding-box,
        linear-gradient(90deg, rgba(99, 102, 241, 0.35), rgba(255, 255, 255, 0.1), rgba(99, 102, 241, 0.35)) border-box;
    background-size: 100% 100%, 200% 100%;
    color: var(--accent-color);
    border: 1px solid transparent;
}
.modal-btn-live:hover {
    background: 
        linear-gradient(#1c263b, #1c263b) padding-box,
        linear-gradient(90deg, #6366f1, #a855f7, #6366f1) border-box;
    background-size: 100% 100%, 200% 100%;
    animation: border-sweep 3s linear infinite;
    color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

.modal-btn-github {
    background: 
        linear-gradient(#1c263b, #1c263b) padding-box,
        linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.15)) border-box;
    background-size: 100% 100%, 200% 100%;
    color: var(--text-primary);
    border: 1px solid transparent;
}
.dark .modal-btn-github {
    background: 
        linear-gradient(#1c263b, #1c263b) padding-box,
        linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.15)) border-box;
    background-size: 100% 100%, 200% 100%;
    border: 1px solid transparent;
}
.modal-btn-github:hover {
    background: 
        linear-gradient(#1c263b, #1c263b) padding-box,
        linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.4), #ffffff) border-box;
    background-size: 100% 100%, 200% 100%;
    animation: border-sweep 3s linear infinite;
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 2rem 1.5rem;
        margin: 1rem auto;
        border-radius: 20px;
        width: calc(100% - 2rem);
        max-width: none;
    }

    .close-modal {
        right: 1.5rem;
        top: 1rem;
        font-size: 1.8rem;
    }

    .modal-title {
        font-size: 1.8rem;
        padding-right: 2rem;
    }

    .modal-description {
        font-size: 1rem;
        line-height: 1.6;
    }

    .modal-actions {
        margin-top: 2rem;
        flex-direction: column;
    }

    .modal-actions .btn-main {
        width: 100%;
        text-align: center;
    }
    .nav-container {
        display: flex;
        justify-content: space-between;
        padding: 0 5%;
    }
    .nav-links-wrapper {
        display: none;
    }
    .desktop-only-search {
        display: none !important;
    }
    .mobile-menu-toggle {
        display: block;
    }
    
    /* MOBILE INTERFACE: SEARCH COMPONENT ADAPTATIONS */
    .mobile-search-section {
        margin-bottom: 4rem;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #mobileSearchContainer {
        width: 50px !important;
        height: 50px;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.5s, background 0.5s;
        background: rgba(255, 255, 255, 0.05);
        cursor: pointer;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    #mobileSearchContainer i, #mobileSearchContainer svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        color: var(--text-secondary);
    }

    #mobileSearchContainer input {
        width: 0;
        opacity: 0;
        padding: 0;
        margin: 0;
        border: none;
        outline: none;
        background: transparent;
        color: white;
        pointer-events: none;
        transition: opacity 0.3s;
        font-size: 1rem;
    }

    /* JS Driven Expanded State */
    #mobileSearchContainer.expanded {
        width: 85% !important;
        max-width: 300px;
        border-radius: 100px;
        padding: 0 1.2rem !important;
        justify-content: flex-start;
        background: rgba(99, 102, 241, 0.15);
        border-color: var(--accent-color);
        box-shadow: 0 0 20px var(--accent-glow);
    }

    #mobileSearchContainer.expanded input {
        width: 100%;
        opacity: 1;
        margin-left: 12px;
        pointer-events: auto;
    }

    #mobileSearchContainer.expanded i, 
    #mobileSearchContainer.expanded svg {
        color: var(--accent-color);
    }

    .library-hero { 
        padding-top: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
    }
    .hero-content-left, .hero-content {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 0 !important;
    }
    .hero-content {
        margin-top: 0.5rem !important;
    }
    .scroll-indicator {
        bottom: 4.5rem;
    }
    .glitch-text { 
        font-size: clamp(2.5rem, 12vw, 4rem); 
        text-align: center;
        margin: 0 !important;
        padding-top: 0 !important;
        line-height: 1.1;
    }
    .project-grid { 
        grid-template-columns: 1fr; 
        margin-top: -5rem !important;
    }
    .stats-section {
        padding: 5rem 0;
        width: 100vw;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }
    .stats-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .chart-wrapper { 
        padding: 1rem; 
        height: 320px; 
        border-radius: 20px;
        width: 85%;
        max-width: 360px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        position: relative;
    }
    #projectChart {
        width: 100% !important;
        height: 100% !important;
        display: block;
    }
    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .library-footer h4 {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    .library-footer h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .footer-links-group ul {
        align-items: center;
    }
    .social-icons {
        justify-content: center;
    }
    .brand-tagline { 
        margin: 0 auto;
        text-align: center;
    }
    .footer-brand {
        align-items: center;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* DECORATIVE CORNER ACCENTS FOR PROJECT CARDS */
.card-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 5;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.corner-tl {
    top: 0;
    left: 0;
    border-top: 3px solid var(--accent-color);
    border-left: 3px solid var(--accent-color);
    border-top-left-radius: 8px;
}

.corner-tr {
    top: 0;
    right: 0;
    border-top: 3px solid var(--accent-color);
    border-right: 3px solid var(--accent-color);
    border-top-right-radius: 8px;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-bottom: 3px solid var(--accent-color);
    border-left: 3px solid var(--accent-color);
    border-bottom-left-radius: 8px;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-bottom: 3px solid var(--accent-color);
    border-right: 3px solid var(--accent-color);
    border-bottom-right-radius: 8px;
}

/* Corner Hover Animation */
.project-card:hover .card-corner {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 6px var(--accent-color));
}




