/* ========================================
   GLOBAL DESIGN SYSTEM & VARIABLES
   ======================================== */
:root {
    /* Core Colors - Dark Theme */
    --color-bg: #0a0a0f;
    --color-bg-secondary: #111115;
    --color-card: #18181e;
    --color-text: #ededee;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;
    --color-border: #2a2a30;
    --color-accent: #e5484d;
    --color-accent-rgb: 229, 72, 77;
    --color-accent-hover: #ff6369;
    --color-filter-bg: #1f1f24;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-transparent: transparent;
    
    /* Shimmer - Dark Theme */
    --shimmer-mid: rgba(255, 255, 255, 0.25);
    --shimmer-bg-pulse: var(--color-bg-secondary);
    
    /* Layout */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);

    /* Hero Height */
    --hero-pad-top: 3rem;
    --hero-pad-bottom: 6rem;
    
    /* Animations */
    --shimmer-duration: 2s;
    --shimmer-pulse-duration: 1.5s;
    --shimmer-blur-amount: 6px;
}

/* ========================================
   LIGHT THEME
   ======================================== */
[data-theme="light"] {
    --color-bg: #f8f9fc;
    --color-bg-secondary: var(--color-white);
    --color-card: var(--color-white);
    --color-text: #1e1e2a;
    --color-text-secondary: #3a3a4a;
    --color-text-muted: #6c6c7a;
    --color-border: #e2e2e8;
    --color-accent: #d32f2f;
    --color-accent-rgb: 211, 47, 47;
    --color-accent-hover: #b71c1c;
    --color-filter-bg: #eef2f5;
    
    /* Shimmer - Light Theme */
    --shimmer-mid: rgba(0, 0, 0, 0.15);
    --shimmer-bg-pulse: var(--color-bg-secondary);
    
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: 80px;
}

html,
body {
    height: 100%;
    padding-top: 80px;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    padding: 0;
    min-height: 100vh;
    transition: background 0.2s ease, color 0.2s ease;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 33%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

/* ========================================
   HEADER - STICKY
   ======================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--color-bg);
    z-index: 100;
    padding: 1rem 2rem 0.75rem;
    transition: box-shadow 0.3s ease;
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 auto;
    max-width: 1400px;
}

.logo-zone {
    flex: 1;
}

.logo-zone .subtitle {
    display: block !important;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ========================================
   BUTTONS & CONTROLS
   ======================================== */
.contact-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-filter-bg);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    padding: 0 1.1rem;
    height: 42px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.contact-btn:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

.filter-btn {
    background: var(--color-filter-bg);
    border: 1px solid var(--color-border);
    padding: 0.55rem 1.3rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

.filter-btn:hover:not(.active) {
    background: var(--color-border);
    color: var(--color-text);
}

.filter-btn-games {
    border-color: var(--color-accent) !important;
    color: var(--color-accent) !important;
    background: var(--color-filter-bg) !important;
}

.filter-btn-games.active {
    background: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    color: var(--color-white) !important;
}

.filter-btn-games:hover:not(.active) {
    background: rgba(229, 72, 77, 0.08) !important;
}

.btn-small {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    background: var(--color-filter-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--color-border);
    color: var(--color-text);
}

#theme-toggle {
    background: var(--color-filter-bg);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text);
    transition: all 0.2s;
}

#theme-toggle:hover {
    background: var(--color-border);
}

/* Theme icons */
.sun-icon,
.moon-icon {
    transition: opacity 0.2s;
}

[data-theme="dark"] .sun-icon,
[data-theme="light"] .moon-icon {
    display: none;
}

[data-theme="dark"] .moon-icon,
[data-theme="light"] .sun-icon {
    display: block;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    padding: var(--hero-pad-top) 0 var(--hero-pad-bottom) 0;
    text-align: center;
    margin-bottom: 0;
    background: var(--color-bg);
}

.hero-section {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(229,72,77,.08),
            transparent 50%
        ),
        var(--color-bg);
}

.hero-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 40%, var(--color-text) 70%);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradientShift 8s ease-in-out infinite;
}

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

.hero-subtitle {
    font-size: clamp(1.1rem, 1.3vw, 1.35rem);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto 0.75rem auto;
}

.hero-description {
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* ========================================
   HERO BACKGROUND - FLOWING ENERGY
   ======================================== */
.hero-section {
    position: relative;
    overflow: hidden;
    padding: var(--hero-pad-top) 0 var(--hero-pad-bottom) 0;
    text-align: center;
    margin-bottom: 0;
    background: 
        radial-gradient(
            circle at 50% 20%,
            rgba(229,72,77,.08),
            transparent 50%
        ),
        var(--color-bg);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.hero-bg svg {
    width: 100%;
    height: 100%;
    display: block;
    /* This ensures the SVG maintains its aspect ratio while filling the container */
    object-fit: contain;
}

@media (max-width: 768px) {
    .hero-bg svg {
        object-fit: cover;
        /* object-fit: contain; */
    }
}

/* ========================================
   WAVES
   ======================================== */
.wave {
    fill: none;
    stroke-linecap: round;
    opacity: 0;
    animation: waveFlow 12s ease-in-out infinite alternate;
    transform-origin: center;
    animation-fill-mode: forwards;
}

.wave-1 {
    animation-duration: 14s;
    animation-delay: 0.3s;
}

.wave-2 {
    animation-duration: 16s;
    animation-delay: 1s;
}

.wave-3 {
    animation-duration: 18s;
    animation-delay: 1.8s;
}

@keyframes waveFlow {
    0% {
        transform: translateX(-10px) translateY(0px) scale(1);
        opacity: 0.05;
    }
    8% {
        opacity: 0.2;
    }
    25% {
        transform: translateX(10px) translateY(-8px) scale(1.01);
        opacity: 0.5;
    }
    50% {
        transform: translateX(-5px) translateY(6px) scale(0.99);
        opacity: 0.35;
    }
    75% {
        transform: translateX(15px) translateY(-3px) scale(1.005);
        opacity: 0.45;
    }
    100% {
        transform: translateX(-15px) translateY(10px) scale(0.995);
        opacity: 0.2;
    }
}

.wave-3 {
    animation: waveFlowSlow 20s ease-in-out infinite alternate;
    animation-delay: 2s;
}

@keyframes waveFlowSlow {
    0% {
        transform: translateX(-10px) translateY(0px) scale(1);
        opacity: 0.05;
    }
    10% {
        opacity: 0.15;
    }
    30% {
        transform: translateX(10px) translateY(-8px) scale(1.01);
        opacity: 0.4;
    }
    60% {
        transform: translateX(-5px) translateY(6px) scale(0.99);
        opacity: 0.3;
    }
    80% {
        transform: translateX(15px) translateY(-3px) scale(1.005);
        opacity: 0.35;
    }
    100% {
        transform: translateX(-15px) translateY(10px) scale(0.995);
        opacity: 0.15;
    }
}

/* ========================================
   ORBS
   ======================================== */
.orb {
    animation: orbFloat 10s ease-in-out infinite alternate;
    transform-origin: center;
    opacity: 0;
    animation-fill-mode: forwards;
}

.orb-1 {
    animation-duration: 12s;
    animation-delay: 0.3s;
}

.orb-2 {
    animation-duration: 14s;
    animation-delay: 0.8s;
}

.orb-3 {
    animation-duration: 13s;
    animation-delay: 1.3s;
}

.orb-4 {
    animation-duration: 15s;
    animation-delay: 1.8s;
}

@keyframes orbFloat {
    0% {
        transform: translate(0px, 0px) scale(1);
        opacity: 0.3;
    }
    33% {
        transform: translate(15px, -10px) scale(1.15);
        opacity: 0.7;
    }
    66% {
        transform: translate(-8px, 12px) scale(0.85);
        opacity: 0.25;
    }
    100% {
        transform: translate(10px, -5px) scale(1.05);
        opacity: 0.5;
    }
}

/* ========================================
   PARTICLES
   ======================================== */
.particle {
    animation: particleFloat 8s ease-in-out infinite alternate;
    opacity: 0;
    animation-fill-mode: forwards;
}

.particle-1 { animation-delay: 0.1s; }
.particle-2 { animation-delay: 0.7s; }
.particle-3 { animation-delay: 1.3s; }
.particle-4 { animation-delay: 1.9s; }
.particle-5 { animation-delay: 2.5s; }
.particle-6 { animation-delay: 3.1s; }
.particle-7 { animation-delay: 3.7s; }
.particle-8 { animation-delay: 4.3s; }
.particle-9 { animation-delay: 4.9s; }
.particle-10 { animation-delay: 5.5s; }
.particle-11 { animation-delay: 6.1s; }
.particle-12 { animation-delay: 6.7s; }

@keyframes particleFloat {
    0% {
        transform: translate(0px, 0px) scale(1);
        opacity: 0.1;
    }
    50% {
        transform: translate(8px, -10px) scale(1.5);
        opacity: 0.35;
    }
    100% {
        transform: translate(-5px, 5px) scale(0.8);
        opacity: 0.08;
    }
}

/* ========================================
   HERO CONTENT ABOVE BACKGROUND
   ======================================== */
.hero-container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========================================
   SCROLL BUTTON
   ======================================== */
.scroll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    background: transparent;
    color: var(--color-accent);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
}

.scroll-btn:hover {
    background: var(--color-accent);
    color: var(--color-white);
    transform: translateY(4px);
    animation: none;
}

.scroll-btn:active {
    transform: translateY(8px) scale(0.95);
}

.scroll-btn svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.scroll-btn:hover svg {
    transform: translateY(2px);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.4);
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
        box-shadow: 0 0 0 12px rgba(229, 72, 77, 0);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(229, 72, 77, 0);
    }
}

.scroll-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    opacity: 0;
    pointer-events: none;
}

.scroll-btn:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ========================================
   FILTER NAVIGATION
   ======================================== */
.filter-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 auto;
    /* max-width: 1200px; */
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    position: relative;
    z-index: 99;
}

.filter-divider {
    width: 1px;
    height: 30px;
    background: var(--color-border);
    display: inline-block;
    margin: 0 8px;
    flex-shrink: 0;
}

/* ========================================
   PORTFOLIO GRID & CARDS
   ======================================== */
.portfolio-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.portfolio-item {
    background: var(--color-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform 0.2s ease, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    height: 100%;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-sm);
}

/* Card images - forced crop with dynamic alignment */
.item-image {
    position: relative;
    height: 220px;
    min-height: 220px;
    max-height: 220px;
    overflow: hidden;
    background: var(--color-bg-secondary);
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

.item-image img,
.item-image video,
.card-swiper-container .swiper-slide img,
.card-swiper-container .swiper-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Card content */
.item-content {
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    position: relative;
}

/* Filter chips - clickable category tags */
.category-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--color-accent);
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-block;
    width: fit-content;
}

.category-tag:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.item-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0;
}

/* ========================================
   FILTER ANIMATIONS - FLYING CARDS
   ======================================== */
.portfolio-item {
    background: var(--color-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform 0.2s ease, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    height: 100%;
    opacity: 0;
    will-change: transform, opacity;
    grid-column: auto;
    grid-row: auto;
}

/* Initial load animation */
.portfolio-item.initial-load {
    animation: initialFlyIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--item-index, 0) * 0.04s);
    -webkit-animation: initialFlyIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    -webkit-animation-delay: calc(var(--item-index, 0) * 0.04s);
}

@keyframes initialFlyIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Fly in when filtering */
.portfolio-item.fly-in {
    animation: flyIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--item-index, 0) * 0.04s);
    -webkit-animation: flyIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    -webkit-animation-delay: calc(var(--item-index, 0) * 0.04s);
}

@keyframes flyIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Fly out when filtering out */
.portfolio-item.fly-out {
    animation: flyOut 0.3s ease-in forwards;
    pointer-events: none;
}

@keyframes flyOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
}

/* Hidden state */
.portfolio-item.hidden-item {
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    transform: scale(0.95) !important;
    animation: none !important;
    order: 9999; /* Push hidden items to the end */
}

/* When a grid item is hidden, it should not take up space */
.portfolio-grid:has(.hidden-item) {
    grid-auto-rows: 0;
}

/* ========================================
   CARD DESCRIPTION WITH CONSTRAINED HEIGHT
   ======================================== */
.item-content p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 165px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-border);
}

.item-content p::-webkit-scrollbar {
    width: 6px;
}

.item-content p::-webkit-scrollbar-track {
    background: var(--color-border);
    border-radius: 3px;
}

.item-content p::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 3px;
    transition: background 0.2s;
}

.item-content p::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

.item-content p a {
    color: var(--color-accent);
    text-decoration: none;
    display: inline-block;
    word-break: break-all;
    max-width: 100%;
}

.item-content p a:hover {
    text-decoration: underline;
}

/* ========================================
   SHARE HINT ON CARDS
   ======================================== */
.share-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, transform 0.2s;
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
}

.portfolio-item:hover .share-hint {
    opacity: 0.9;
}

.share-hint:hover {
    background: var(--color-accent-hover);
    transform: scale(1.02);
}

/* ========================================
   CARD SWIPER (MINI CAROUSEL)
   ======================================== */
.card-swiper-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-swiper-container .swiper {
    width: 100%;
    height: 100%;
}

.card-swiper-container .swiper-slide {
    text-align: center;
    background: var(--color-card);
}

.card-swiper-container .swiper-button-prev,
.card-swiper-container .swiper-button-next {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    color: var(--color-white);
}

.card-swiper-container .swiper-button-prev:after,
.card-swiper-container .swiper-button-next:after {
    font-size: 12px;
    font-weight: bold;
}

.card-swiper-container .swiper-button-prev {
    left: 6px;
}

.card-swiper-container .swiper-button-next {
    right: 6px;
}

.card-swiper-container .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: var(--color-white);
    opacity: 0.6;
}

.card-swiper-container .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--color-accent);
}

.card-swiper-container .swiper-pagination {
    bottom: 8px;
}

/* ========================================
   LAZY LOADING w/ ANIMATED SHIMMER
   ======================================== */

/* Shimmer wrapper — this is where pseudo-elements live.
   Replaced elements (img, video) cannot render ::before/::after,
   so the wrapper div carries the animation instead. */
.thumb-shimmer {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--color-bg-secondary);
    display: block;
}

/* Loading state: animate the wrapper */
.thumb-shimmer.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--color-transparent) 0%,
        var(--shimmer-mid) 40%,
        var(--shimmer-mid) 60%,
        var(--color-transparent) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}

.thumb-shimmer.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--shimmer-bg-pulse);
    animation: pulseBg 1.2s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

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

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dim the media element while loading */
.thumb-shimmer.loading .thumb-media {
    opacity: 0.08;
    filter: blur(4px);
    transform: scale(1.01);
    transition: none;
    position: relative;
    z-index: 0;
}

/* Media fills the wrapper */
.thumb-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loaded: kill shimmer, reveal media */
.thumb-shimmer.loaded::before,
.thumb-shimmer.loaded::after {
    display: none;
    content: none;
}

.thumb-shimmer.loaded .thumb-media {
    opacity: 1;
    filter: none;
    transform: scale(1);
    transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}

/* Error state */
.thumb-shimmer.error::before,
.thumb-shimmer.error::after {
    display: none;
    content: none;
}

.thumb-shimmer.error .thumb-media {
    opacity: 0.2;
}

/* ========================================
   AWARD BADGE
   ======================================== */
.award-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.78em;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    color: #b8860b;
    background: rgba(184, 134, 11, 0.1);
    border: 1px solid rgba(184, 134, 11, 0.35);
    border-radius: 4px;
    padding: 0.1em 0.5em 0.15em;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.4;
}

[data-theme="dark"] .award-badge {
    color: #f0c040;
    background: rgba(240, 192, 64, 0.1);
    border-color: rgba(240, 192, 64, 0.3);
}

/* ========================================
   LIVE BADGE
   ======================================== */
.live-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8em;
    font-size: 0.78em;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: 1px solid rgba(var(--color-accent-rgb), 0.25);
    border-radius: 4px;
    padding: 0.1em 0.5em 0.15em;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.4;
    text-decoration: none !important;
    transition: border-color 0.25s ease, opacity 0.25s ease;
    cursor: pointer;
}

.live-badge-link:hover {
    border-color: rgba(var(--color-accent-rgb), 0.6);
    opacity: 0.85;
    text-decoration: none !important;
}

.live-badge-link:active {
    transform: scale(0.97);
}

/* Non-interactive badge (no URL) */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.8em;
    font-size: 0.78em;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: 1px solid rgba(var(--color-accent-rgb), 0.25);
    border-radius: 4px;
    padding: 0.1em 0.5em 0.15em;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.4;
    cursor: default;
}

/* Pulsing dot */
.live-dot {
    display: inline-block;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background-color: var(--color-accent);
    vertical-align: middle;
    margin-right: 4px;
    animation: livePulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
    margin-top: -0.1em;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.15;
        transform: scale(0.6);
    }
}

/* Light theme */
[data-theme="light"] .live-badge-link {
    border-color: rgba(var(--color-accent-rgb), 0.25);
}

[data-theme="light"] .live-badge-link:hover {
    border-color: rgba(var(--color-accent-rgb), 0.6);
}

[data-theme="light"] .live-badge {
    border-color: rgba(var(--color-accent-rgb), 0.25);
}

/* ========================================
   CUSTOM MODAL (FULLSCREEN MEDIA VIEWER)
   ======================================== */
.media-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
}

.media-modal .modal-content {
    position: relative;
    background: transparent;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    top: 50%;
    transform: translateY(-50%);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--color-white);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.2s;
}

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

.modal-swiper-container {
    width: 100%;
    height: 100%;
}

.modal-swiper {
    width: 100%;
    height: 100%;
}

.modal-media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-black);
    border-radius: 12px;
    overflow: hidden;
}

.modal-media-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.modal-media-container video,
.modal-media-container iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-swiper .swiper-button-prev,
.modal-swiper .swiper-button-next {
    color: var(--color-white);
    background: rgba(0, 0, 0, 0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.modal-swiper .swiper-button-prev:after,
.modal-swiper .swiper-button-next:after {
    font-size: 18px;
    font-weight: bold;
}

.modal-swiper .swiper-pagination-bullet {
    background: var(--color-white);
    opacity: 0.5;
}

.modal-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--color-accent);
}

.video-progress-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--color-accent);
    width: 0%;
    transition: width 0.3s;
    z-index: 10;
    pointer-events: none;
}

/* ========================================
   ADMIN WORKSPACE
   ======================================== */
.admin-workspace {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    margin: 2rem 0;
    align-items: start;
}

/* Sticky wrapper */
.admin-form-sticky {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
    padding-right: 4px;
    margin-right: -4px;
}

.admin-form-sticky:hover {
    scrollbar-color: var(--color-accent) transparent;
}

.admin-form-sticky::-webkit-scrollbar {
    width: 4px;
}

.admin-form-sticky::-webkit-scrollbar-track {
    background: transparent;
}

.admin-form-sticky::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.admin-form-sticky:hover::-webkit-scrollbar-thumb {
    background: var(--color-accent);
}

/* The card */
.admin-form {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 28px;
    padding: 1.8rem;
}

.sorting-zone {
    position: relative;
}

/* Editing state for sort items */
.sort-item.editing {
    border-color: var(--color-accent) !important;
    border-width: 1px !important;
    border-style: solid !important;
    box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.2) !important;
    background: var(--color-bg-secondary) !important;
    transition: all 0.2s ease;
}

/* Admin search */
.admin-search {
    margin-bottom: 1rem;
}

.admin-search-input {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 0.7rem 1rem;
    color: var(--color-text);
    font-size: 0.85rem;
    transition: border-color 0.2s;
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Form groups */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 0.8rem 1rem;
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-border);
}

.form-group textarea::-webkit-scrollbar {
    width: 8px;
}

.form-group textarea::-webkit-scrollbar-track {
    background: var(--color-border);
    border-radius: 4px;
}

.form-group textarea::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
    transition: background 0.2s;
}

.form-group textarea::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

/* Character counter */
#char-counter {
    text-align: right;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    transition: color 0.2s;
}

/* Publish group */
.publish-group {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.publish-group label {
    transition: border-color 0.2s, background 0.2s;
}

.publish-group label:hover {
    border-color: var(--color-accent);
    background: var(--color-bg-secondary);
}

#form-published {
    accent-color: var(--color-accent);
    transform: scale(0.75);
    margin-right: 0.25rem;
}

/* Hide the native checkbox */
.custom-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Custom checkbox box */
.custom-checkbox-box {
    width: 16px;
    height: 16px;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    background: var(--color-bg);
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

/* Checked state - Red with white checkmark */
.custom-checkbox-input:checked + .custom-checkbox-box {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

/* White checkmark */
.custom-checkbox-input:checked + .custom-checkbox-box::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-white);
    font-size: 14px;
    font-weight: bold;
}

/* Hover effect */
.publish-group label:hover .custom-checkbox-box {
    border-color: var(--color-accent);
}

/* Responsive: disable sticky on mobile */
@media (max-width: 880px) {
    .admin-workspace {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .admin-form-sticky {
        position: relative;
        top: auto;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
        margin-right: 0;
    }
}

.sort-item .selected-star {
    font-size: 0.5rem;
    display: inline-block;
    margin-left: 0.1rem;
    vertical-align: middle;
}

/* ========================================
   CATEGORY DROPDOWN WITH CHECKBOXES
   ======================================== */
#category-form-group {
    position: relative;
}

.category-dropdown-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.category-dropdown-container {
    flex: 1;
    position: relative;
    min-width: 0;
}

.category-dropdown-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    color: var(--color-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, border-radius 0.2s;
    font-family: inherit;
    min-height: 52px;
    position: relative;
    z-index: 1;
}

.category-dropdown-toggle:hover {
    border-color: var(--color-text-muted);
}

.category-dropdown-toggle:focus {
    outline: none;
    border-color: var(--color-accent);
}

.category-dropdown-toggle.open {
    border-color: var(--color-accent);
    border-radius: 14px 14px 0 0;
    z-index: 11;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    transition: transform 0.2s;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.category-dropdown-toggle.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Manage button */
#add-category-btn {
    flex-shrink: 0;
    align-self: stretch;
}

.category-dropdown-panel {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-accent);
    border-top: none;
    border-radius: 0 0 14px 14px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 10;
    animation: fadeIn 0.15s ease;
    box-sizing: border-box;
}

.category-dropdown-panel::-webkit-scrollbar {
    width: 6px;
}

.category-dropdown-panel::-webkit-scrollbar-track {
    background: var(--color-border);
    border-radius: 3px;
}

.category-dropdown-panel::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 3px;
    transition: background 0.2s;
}

.category-dropdown-panel::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

.category-dropdown-panel {
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-border);
}

.category-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.category-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.85rem;
    color: var(--color-text);
}

.category-checkbox-item:hover {
    background: var(--color-filter-bg);
}

.category-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    margin-right: 1rem;
    vertical-align: middle;
    align-self: center;
}

.category-checkbox-item .category-name {
    flex: 1;
    line-height: 1;
    align-items: center;
    min-height: 32px;
    /* padding-left: 0.5rem; */
}

.category-checkbox-item .category-shortcut {
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-family: monospace;
    flex-shrink: 0;
    padding-left: 0.5rem;
}

.category-dropdown-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 0.5rem;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* ========================================
   ADMIN MEDIA MANAGER
   ======================================== */
.media-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.media-input-row input {
    flex: 1;
}

.media-badges-container {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-height: 60px;
}

.media-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 0.3rem 0.6rem 0.3rem 0.8rem;
    margin: 0.25rem;
    font-size: 0.75rem;
    font-family: monospace;
    transition: all 0.2s;
}

.media-badge:hover {
    border-color: var(--color-accent);
}

.media-badge.dragging-over {
    border: 2px dashed var(--color-accent);
    background: rgba(229, 72, 77, 0.1);
}

.media-badge-icon {
    font-size: 0.9rem;
}

.media-badge-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-secondary);
}

.media-badge-preview,
.media-badge-edit,
.media-badge-delete {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0 2px;
}

.media-badge-preview:hover,
.media-badge-edit:hover,
.media-badge-delete:hover {
    opacity: 1;
    color: var(--color-accent);
}

.media-paste-area {
    margin-top: 0.5rem;
}

.media-paste-textarea {
    width: 100%;
    font-size: 0.8rem;
    font-family: monospace;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.5rem;
    color: var(--color-text);
    resize: vertical;
}

.media-paste-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ========================================
   ADMIN MODAL (Edit Media, Confirm, etc.)
   ======================================== */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.admin-modal-overlay > div {
    position: relative;
    z-index: 99999;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.admin-modal-overlay h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--color-text);
}

.admin-modal-overlay p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.admin-modal-overlay input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.9rem;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

.admin-modal-overlay input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.admin-modal-overlay .btn-small {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--color-filter-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.admin-modal-overlay .btn-small:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.admin-modal-overlay .filter-btn {
    background: var(--color-filter-bg);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.admin-modal-overlay .filter-btn:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

.admin-modal-overlay .filter-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

.admin-modal-overlay .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Category Modal - Specific overrides */
#category-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99998 !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    margin: 0 !important;
    padding: 0 !important;
}

#category-modal > div {
    position: relative !important;
    z-index: 99999 !important;
    background: var(--color-card) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 24px !important;
    padding: 1.5rem !important;
    max-width: 500px !important;
    width: 90% !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* Confirmation Modal - Top Level */
#confirm-modal-root {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999999 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#confirm-modal-root > div:first-child {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

#confirm-modal-root > div:last-child {
    position: relative !important;
    z-index: 1 !important;
    background: var(--color-card) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 24px !important;
    padding: 1.5rem !important;
    max-width: 450px !important;
    width: 90% !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
    pointer-events: auto !important;
    margin: 0 auto !important;
}

#confirm-modal-root .btn-small {
    font-size: 0.75rem !important;
    padding: 0.5rem 1.2rem !important;
    background: var(--color-filter-bg) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    color: var(--color-text-secondary) !important;
    transition: all 0.2s !important;
}

#confirm-modal-root .btn-small:hover {
    background: var(--color-border) !important;
    color: var(--color-text) !important;
}

#confirm-modal-root .filter-btn {
    padding: 0.5rem 1.2rem !important;
    background: var(--color-accent) !important;
    color: var(--color-white) !important;
    border: none !important;
    border-radius: 100px !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
}

#confirm-modal-root .filter-btn:hover {
    background: var(--color-accent-hover) !important;
}

/* ========================================
   CATEGORY MANAGER
   ======================================== */
.category-manager {
    display: none;
    margin-top: 0.5rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 14px;
    border: 1px solid var(--color-border);
    animation: fadeIn 0.2s ease;
}

.category-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.category-manager-title {
    margin: 0;
    font-size: 0.95rem;
}

.category-manager-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    transition: color 0.2s;
}

.category-manager-close:hover {
    color: var(--color-accent);
}

.category-list-container {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-border);
}

.category-list-container::-webkit-scrollbar {
    width: 6px;
}

.category-list-container::-webkit-scrollbar-track {
    background: var(--color-border);
    border-radius: 3px;
}

.category-list-container::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 3px;
    transition: background 0.2s;
}

.category-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

.category-add-form {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.category-add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.category-add-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.2rem;
}

.category-input-field {
    width: 100%;
    padding: 0.5rem;
    border-radius: 10px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.category-input-field:hover {
    border-color: var(--color-text-muted);
}

.category-input-field:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb), 0.15);
}

.category-add-hint {
    color: var(--text-muted);
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
}

.category-add-btn {
    margin-top: 0.5rem;
    width: 100%;
}

/* Shortcut input in category list - subtle gray outline */
.category-list-container input[type="text"] {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.85rem;
    width: 100%;
    border: 1px solid var(--color-border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.category-list-container input[type="text"]:hover {
    border-color: var(--color-text-muted);
}

.category-list-container input[type="text"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb), 0.15);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   ADD CATEGORY INLINE FIELD
   ======================================== */
#add-category-field {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#add-category-field input {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.5rem;
    color: var(--color-text);
    font-size: 0.85rem;
}

#add-category-field input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ========================================
   CATEGORY MANAGEMENT PANEL
   ======================================== */
#category-manager {
    margin-top: 0.5rem;
}

#categories-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ========================================
   SORTABLE PROJECT LIST (ADMIN)
   ======================================== */
.sortable-list {
    list-style: none;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.sort-item {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.1s;
    cursor: default;
}

.sort-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.sort-handle {
    cursor: grab;
    font-size: 1.2rem;
    user-select: none;
    color: var(--color-text-muted);
}

.sort-handle:active {
    cursor: grabbing;
}

.delete-item-btn {
    cursor: pointer;
    transition: color 0.2s;
}

.delete-item-btn:hover {
    color: var(--color-accent) !important;
}

.row-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--color-text-muted);
    user-select: none;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.row-btn:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.move-top-btn:hover,
.move-bottom-btn:hover {
    color: var(--color-accent);
}

/* ========================================
   RICH TEXT EDITOR (not so "rich" anymore)
   ======================================== */
.rich-text-toolbar {
    display: flex;
    gap: 0.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    padding: 0.5rem;
    flex-wrap: wrap;
}

.rich-text-toolbar button {
    background: var(--color-filter-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: monospace;
}

.rich-text-toolbar button:hover {
    background: var(--color-border);
    color: var(--color-text);
    border-color: var(--color-accent);
}

.rich-text-toolbar button:active {
    transform: scale(0.97);
}

.rich-text-description {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0 0 14px 14px;
    padding: 0.8rem 1rem;
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: inherit;
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
    transition: border-color 0.2s;
    overflow-y: auto;
    box-sizing: border-box;
}

.rich-text-description:focus {
    outline: none;
    border-color: var(--color-accent);
}

.rich-text-description.tag-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.rich-text-description ul,
.rich-text-description ol {
    margin-left: 1.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.rich-text-description li {
    margin-bottom: 0.15rem;
}

.rich-text-description a {
    color: var(--color-accent);
    text-decoration: underline;
}

/* ========================================
   SELECTED WORK FILTER BUTTON
   ======================================== */
.filter-btn-selected {
    border-color: var(--color-accent) !important;
    color: var(--color-accent) !important;
    background: var(--color-filter-bg) !important;
}

.filter-btn-selected.active {
    background: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    color: var(--color-white) !important;
}

.filter-btn-selected:hover:not(.active) {
    background: rgba(229, 72, 77, 0.08) !important;
}

/* ========================================
   CATEGORY MODAL SCROLLBAR
   ======================================== */

#category-list-container {
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-border);
}

#category-list-container::-webkit-scrollbar {
    width: 6px;
}

#category-list-container::-webkit-scrollbar-track {
    background: var(--color-border);
    border-radius: 3px;
}

#category-list-container::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 3px;
    transition: background 0.2s;
}

#category-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 880px) {
    header {
        padding: 0.75rem 1rem 0.5rem;
    }

    .filter-nav {
        padding: 0.5rem 1rem;
    }

    .portfolio-container {
        padding: 0 1rem;
    }

    .admin-workspace {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .portfolio-grid {
        gap: 1.25rem;
        grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    }

    .item-image {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
    }

    .item-content p {
        max-height: 160px;
    }
}

@media (max-width: 640px) {
    .filter-nav {
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
    }

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

    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .logo-zone {
        text-align: center;
    }

    .header-actions {
        align-self: center;
        justify-content: center;
    }

    .media-badge-text {
        max-width: 120px;
    }

    .item-content p {
        max-height: 160px;
    }

    .share-hint {
        font-size: 0.6rem;
        padding: 3px 6px;
    }

    .hero-section {
        padding: 1.5rem 0 1.5rem 0;
    }

    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.8rem);
    }

    .hero-subtitle {
        font-size: 1rem;
        font-weight: 600;
    }

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

    .scroll-btn {
        width: 48px;
        height: 48px;
        margin-top: 1.5rem;
    }

    .scroll-btn svg {
        width: 24px;
        height: 24px;
    }

    .category-add-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }

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

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

    .filter-nav {
        gap: 0.4rem;
        padding: 0.4rem 0.5rem;
    }

    .filter-btn {
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
    }

    .category-dropdown-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .category-dropdown-toggle {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
        min-height: 44px;
    }

    .category-dropdown-panel {
        max-height: 180px;
    }

    .category-checkbox-item {
        font-size: 0.8rem;
        padding: 0.3rem 0.4rem;
    }
}