/**
 * ==============================================================================
 * IMAGE CLOUD 2026 - MODERN AURORA GLASS DESIGN SYSTEM
 * Version: 3.5.0
 * Author: Image Cloud Engineering
 * ==============================================================================
 */

/* ------------------------------------------------------------------------------
   1. DESIGN TOKENS & CSS VARIABLES (DARK & LIGHT THEMES)
   ------------------------------------------------------------------------------ */
:root {
    /* Color Palette - Dark Mode (Default) */
    --bg-main: #060813;
    --bg-surface: rgba(13, 19, 38, 0.72);
    --bg-surface-elevated: rgba(18, 27, 54, 0.85);
    --bg-glass-card: rgba(11, 17, 36, 0.75);
    --bg-glass-input: rgba(6, 10, 22, 0.65);
    --bg-glass-dropdown: rgba(10, 16, 34, 0.95);
    --bg-modal: rgba(8, 13, 28, 0.92);

    --border-glass: rgba(255, 255, 255, 0.1);
    --border-glass-hover: rgba(255, 255, 255, 0.2);
    --border-glass-focus: rgba(56, 189, 248, 0.65);
    --border-subtle: rgba(255, 255, 255, 0.05);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.82);
    --text-muted: rgba(255, 255, 255, 0.48);
    --text-faint: rgba(255, 255, 255, 0.28);

    /* Brand Primary Accent */
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --primary-glow: rgba(59, 130, 246, 0.4);

    /* Accents */
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-violet: #8b5cf6;
    --accent-indigo: #6366f1;
    --accent-pink: #ec4899;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    /* Status Colors */
    --color-success: #10b981;
    --color-error: #f43f5e;
    --color-warning: #f59e0b;
    --color-info: #38bdf8;

    /* Shadows & Glows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-glass: 0 25px 65px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--border-glass) inset;
    --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.35);
    --shadow-glow-primary: 0 0 30px rgba(59, 130, 246, 0.35);

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;

    /* Motion */
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.18s ease;
    --transition-base: 0.28s var(--ease-smooth);
    --transition-slow: 0.5s var(--ease-smooth);
}

/* Light Theme Variables */
html.light {
    --bg-main: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-elevated: rgba(255, 255, 255, 0.95);
    --bg-glass-card: rgba(255, 255, 255, 0.88);
    --bg-glass-input: rgba(241, 245, 249, 0.85);
    --bg-glass-dropdown: rgba(255, 255, 255, 0.98);
    --bg-modal: rgba(255, 255, 255, 0.96);

    --border-glass: rgba(15, 23, 42, 0.08);
    --border-glass-hover: rgba(15, 23, 42, 0.16);
    --border-glass-focus: rgba(37, 99, 235, 0.65);
    --border-subtle: rgba(15, 23, 42, 0.04);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    --primary-glow: rgba(37, 99, 235, 0.25);
    --shadow-glass: 0 20px 50px -12px rgba(15, 23, 42, 0.1), 0 0 0 1px var(--border-glass) inset;
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* ------------------------------------------------------------------------------
   2. GLOBAL RESETS & BASE STYLES
   ------------------------------------------------------------------------------ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.32);
}
html.light ::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
}
html.light ::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.35);
}

/* ------------------------------------------------------------------------------
   3. AURORA AMBIENT BACKGROUND & MESH GLOWS
   ------------------------------------------------------------------------------ */
.ambient-bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Dynamic Aurora Orbs */
.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.45;
    mix-blend-mode: screen;
    animation: orbDrift 20s infinite alternate ease-in-out;
}
html.light .aurora-orb {
    opacity: 0.25;
    mix-blend-mode: multiply;
}

.aurora-1 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, #3b82f6 0%, rgba(59, 130, 246, 0) 70%);
    top: -150px;
    left: -100px;
    animation-duration: 18s;
}

.aurora-2 {
    width: 750px;
    height: 750px;
    background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
    top: 20%;
    right: -150px;
    animation-duration: 24s;
    animation-delay: -5s;
}

.aurora-3 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
    bottom: -100px;
    left: 25%;
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes orbDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, 60px) scale(1.08);
    }
    100% {
        transform: translate(-30px, 30px) scale(0.95);
    }
}

/* Cyber Matrix / Subtle Grid Overlay */
.ambient-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at 50% 30%, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 50% 30%, black 40%, transparent 80%);
}
html.light .ambient-grid {
    background-image: 
        linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

/* Optional Video Background Container */
.video-bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.video-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.28;
    filter: brightness(0.8) contrast(1.1);
}
.video-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 20%, rgba(6, 8, 19, 0.4) 0%, rgba(6, 8, 19, 0.95) 100%);
}
html.light .video-bg {
    display: none;
}

/* ------------------------------------------------------------------------------
   4. LAYOUT CONTAINERS
   ------------------------------------------------------------------------------ */
.app-layout {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.container-lg {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ------------------------------------------------------------------------------
   5. NAVIGATION HEADER
   ------------------------------------------------------------------------------ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 74px;
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(6, 8, 19, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    transition: background-color var(--transition-base), border-color var(--transition-base);
}
html.light .header {
    background: rgba(255, 255, 255, 0.82);
}

.header-inner {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Brand Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    transition: transform var(--transition-fast);
}
.brand-logo:hover {
    transform: translateY(-1px);
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.45);
    color: #ffffff;
    transition: box-shadow var(--transition-fast);
}
.brand-logo:hover .brand-icon {
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.65);
}

.brand-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.brand-highlight {
    background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-glow {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
}

.badge-emerald {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.14);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-pink {
    background: rgba(236, 72, 153, 0.14);
    color: #f9a8d4;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-amber {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Live Ping Beacon */
.server-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pulse-beacon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    position: relative;
}
.pulse-beacon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    opacity: 0.6;
    animation: beaconPulse 2s infinite ease-out;
}
@keyframes beaconPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* History Badge Counter */
.history-badge-count {
    background: var(--accent-cyan);
    color: #060813;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: 0.25rem;
}

/* Theme Toggle Button */
.btn-theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-theme-toggle:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-glass-hover);
    transform: translateY(-1px);
}
.icon-theme-dark {
    display: block;
}
.icon-theme-light {
    display: none;
}
html.light .icon-theme-dark {
    display: none;
}
html.light .icon-theme-light {
    display: block;
}

/* ------------------------------------------------------------------------------
   6. BUTTONS & CONTROLS
   ------------------------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    user-select: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-1.5px);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.btn-secondary:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-glass-hover);
    transform: translateY(-1.5px);
}
.btn-secondary:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.45rem 0.95rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 0.32rem 0.75rem;
    font-size: 0.75rem;
    height: 32px;
    border-radius: var(--radius-sm);
}

.btn-icon-only {
    padding: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-copy {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.38);
    font-size: 0.78rem;
    font-weight: 600;
}
html.light .btn-copy {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.28);
}
.btn-copy:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
}

.btn-success {
    background: rgba(16, 185, 129, 0.22) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.55) !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35) !important;
}

.w-full {
    width: 100%;
}
.flex-1 {
    flex: 1;
}
.flex-center {
    display: flex;
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* ------------------------------------------------------------------------------
   7. HERO SECTION
   ------------------------------------------------------------------------------ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.75rem 0 3.5rem;
}

.hero-section {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.95rem;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    color: #93c5fd;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}
html.light .hero-badge-pill {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
    color: #2563eb;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
@media (min-width: 768px) {
    .hero-title {
        font-size: 2.85rem;
    }
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}

.kbd-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: var(--radius-xs);
}
html.light .kbd-tag {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.25);
}

/* ------------------------------------------------------------------------------
   8. MAIN GLASS CARD (UPLOAD HUB)
   ------------------------------------------------------------------------------ */
.glass-card {
    background: var(--bg-glass-card);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
    padding: 2rem;
    position: relative;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.glass-card:hover {
    border-color: var(--border-glass-hover);
}

/* Segmented Tabs Navigation */
.tabs-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    padding: 0.35rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-glass);
    max-width: 440px;
    margin: 0 auto 1.75rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.tab-label-short {
    display: none;
}

/* ------------------------------------------------------------------------------
   9. DROPZONE AREA (TAB 1)
   ------------------------------------------------------------------------------ */
.dropzone-container {
    border: 2px dashed rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    padding: 3rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}
html.light .dropzone-container {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(15, 23, 42, 0.015);
}

.dropzone-container:hover,
.dropzone-container.dragover {
    border-color: var(--primary-light);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2) inset;
    transform: scale(1.005);
}

.dropzone-icon-wrapper {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone-icon-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--primary-glow);
    animation: dropzonePulse 2.5s infinite ease-out;
}
@keyframes dropzonePulse {
    0% {
        transform: scale(0.85);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.dropzone-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
    position: relative;
    z-index: 2;
    transition: transform var(--transition-fast);
}
.dropzone-container:hover .dropzone-icon {
    transform: translateY(-2px);
}

.dropzone-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.dropzone-title span {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.dropzone-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Supported Formats Chips */
.format-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.format-pill {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-xs);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

/* ------------------------------------------------------------------------------
   10. URL INPUT CONTAINER (TAB 2)
   ------------------------------------------------------------------------------ */
.url-upload-container {
    display: none;
    flex-direction: column;
    gap: 1rem;
}
.url-upload-container.active {
    display: flex;
}

.textarea-control {
    width: 100%;
    background: var(--bg-glass-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 1rem;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.textarea-control:focus {
    border-color: var(--border-glass-focus);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.25);
}
.textarea-control::placeholder {
    color: var(--text-muted);
    font-family: var(--font-sans);
}

/* ------------------------------------------------------------------------------
   11. QUICK TOOLS & SERVER SELECTOR BAR
   ------------------------------------------------------------------------------ */
.quick-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-glass);
}

.server-selector {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Custom Dropdown for Server Select */
.custom-dropdown {
    position: relative;
    user-select: none;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.95rem;
    color: var(--text-primary);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}
.dropdown-trigger:hover,
.dropdown-trigger.active {
    background: var(--bg-surface-elevated);
    border-color: var(--border-glass-hover);
}

.dropdown-trigger-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-auto { background-color: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.dot-cctv { background-color: var(--accent-violet); box-shadow: 0 0 8px var(--accent-violet); }
.dot-upanh { background-color: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }

.dropdown-chevron {
    transition: transform var(--transition-fast);
}
.dropdown-trigger.active .dropdown-chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 290px;
    background: var(--bg-glass-dropdown);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.45rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 60;
    animation: fadeInDown 0.2s ease;
}
.dropdown-menu.active {
    display: flex;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.dropdown-item:hover {
    background: var(--bg-surface-elevated);
}
.dropdown-item.selected {
    background: rgba(59, 130, 246, 0.16);
}

.dropdown-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.item-title {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-primary);
}
.item-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.item-check {
    display: none;
}
.dropdown-item.selected .item-check {
    display: block;
}

.dot-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

/* Quick Preference Toggles */
.upload-preferences {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preference-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ------------------------------------------------------------------------------
   12. UPLOAD RESULTS SECTION
   ------------------------------------------------------------------------------ */
.results-section {
    display: none;
    margin-top: 2rem;
}
.results-section.active {
    display: block;
    animation: slideUpFade 0.4s var(--ease-smooth);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-section-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.results-bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Result Card */
.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 1.25rem;
    align-items: center;
    transition: all var(--transition-fast);
}
.result-card:hover {
    border-color: var(--border-glass-hover);
    background: var(--bg-surface-elevated);
    box-shadow: var(--shadow-sm);
}

.result-thumb {
    width: 88px;
    height: 88px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}
.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-fast);
}
.result-thumb:hover img {
    transform: scale(1.08);
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.result-filename {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Input Copy Group */
.input-copy-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-glass-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.35rem 0.25rem 0.75rem;
    transition: border-color var(--transition-fast);
}
.input-copy-group:focus-within {
    border-color: var(--border-glass-focus);
}

.input-control {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
}

.font-mono {
    font-family: var(--font-mono);
}
.text-xs {
    font-size: 0.75rem;
}

/* ------------------------------------------------------------------------------
   13. UPLOAD PROGRESS MODAL (HUD)
   ------------------------------------------------------------------------------ */
.progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(4, 7, 16, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.progress-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.progress-modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
    padding: 2.25rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
}

.progress-visual {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--accent-cyan);
    animation: pulseGlow 2s infinite ease-out;
}
@keyframes pulseGlow {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.pulse-core {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.5);
}

.progress-status {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.progress-substatus {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width 0.2s ease;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.progress-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}
#progress-percent {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

/* ------------------------------------------------------------------------------
   14. HISTORY MODAL & DRAWER
   ------------------------------------------------------------------------------ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    background: rgba(4, 7, 16, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.modal-card {
    background: var(--bg-modal);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
    padding: 1.75rem;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.modal-card-lg {
    max-width: 860px;
}
.modal-card-md {
    max-width: 540px;
}

.history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--border-glass);
    gap: 1rem;
    flex-wrap: wrap;
}

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

.history-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-header-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.history-view-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.btn-toggle-view {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-toggle-view.active,
.btn-toggle-view:hover {
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
}

.history-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.25rem 0.5rem;
}

/* History Grid Mode */
.history-view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.history-grid-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-fast);
}
.history-grid-card:hover {
    border-color: var(--border-glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.history-grid-thumb {
    width: 100%;
    height: 125px;
    background: #000;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.history-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-fast);
}
.history-grid-card:hover .history-grid-thumb img {
    transform: scale(1.06);
}

.history-grid-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.history-grid-card:hover .history-grid-delete-btn {
    opacity: 1;
}
.history-grid-delete-btn:hover {
    background: var(--color-error);
}

.history-grid-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-grid-name {
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.history-grid-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.history-grid-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* History List Mode */
.history-view-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.history-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    gap: 1rem;
    transition: all var(--transition-fast);
}
.history-item-card:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-glass-hover);
}

.history-item-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.history-thumb-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    flex-shrink: 0;
    cursor: pointer;
}
.history-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.history-time-text {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.history-empty {
    text-align: center;
    padding: 4rem 1rem;
}
.history-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--text-muted);
}

/* Close Header Button */
.btn-close-header {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}
.btn-close-header:hover {
    color: var(--text-primary);
}

/* ------------------------------------------------------------------------------
   15. VIEWER PAGE STYLES (VIEW.PHP)
   ------------------------------------------------------------------------------ */
.viewer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-top: 1rem;
}
@media (min-width: 900px) {
    .viewer-grid {
        grid-template-columns: 1.15fr 0.85fr;
    }
}

.viewer-image-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.viewer-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 380px;
    max-height: 580px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0b0f19;
    /* Transparent checkerboard pattern */
    background-image: 
        linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    cursor: zoom-in;
    border: 1px solid var(--border-glass);
}
html.light .viewer-image-wrapper {
    background-color: #f1f5f9;
    background-image: 
        linear-gradient(45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.04) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.04) 75%);
}

.viewer-image {
    max-width: 100%;
    max-height: 540px;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.viewer-zoom-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    pointer-events: none;
}

.viewer-image-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.viewer-meta-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Codes Card */
.viewer-codes-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

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

.embed-list {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.embed-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.embed-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.825rem;
}

/* Fullscreen Lightbox */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}
.lightbox-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

/* ------------------------------------------------------------------------------
   16. TOAST NOTIFICATIONS
   ------------------------------------------------------------------------------ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--bg-modal);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    padding: 0.75rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 380px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast-success {
    border-left: 3px solid var(--accent-emerald);
}
.toast-error {
    border-left: 3px solid var(--color-error);
}
.toast-info {
    border-left: 3px solid var(--accent-cyan);
}

.animate-slide-up {
    animation: toastSlideUp 0.3s var(--ease-smooth);
}
@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.fade-out {
    animation: toastFadeOut 0.3s forwards ease;
}
@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
}

/* ------------------------------------------------------------------------------
   17. FOOTER
   ------------------------------------------------------------------------------ */
.footer {
    position: relative;
    z-index: 10;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(6, 8, 19, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-top: auto;
}
html.light .footer {
    background: rgba(255, 255, 255, 0.6);
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-link:hover {
    color: var(--primary-light);
}

/* ------------------------------------------------------------------------------
   18. RESPONSIVE BREAKPOINTS
   ------------------------------------------------------------------------------ */
@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
        height: 64px;
    }
    .btn-text-full {
        display: none;
    }
    .btn-text-short {
        display: inline;
    }
    .tab-label-full {
        display: none;
    }
    .tab-label-short {
        display: inline;
    }
    .hero-title {
        font-size: 2rem;
    }
    .glass-card {
        padding: 1.25rem;
    }
    .dropzone-container {
        padding: 2rem 1rem;
    }
    .result-card {
        grid-template-columns: 1fr;
    }
    .result-thumb {
        width: 100%;
        height: 160px;
    }
    .quick-tools {
        flex-direction: column;
        align-items: flex-start;
    }
    .server-status-pill {
        display: none;
    }
}

@media (max-width: 480px) {
    .history-header-right .btn-clear-history .btn-text-full {
        display: none;
    }
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
}
