/* ═══════════════════════════════════════════════════════════════
   HUB - Tools Grid & Tool-Specific Styles
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   AMBIENT SPLASHES - Green accent for Tools page
   ─────────────────────────────────────────────────────────────── */
.splash--green-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-green);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.splash--green-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-green);
    bottom: 20%;
    right: 10%;
    animation-delay: -8s;
    animation-duration: 30s;
}

.splash--cyan-1 {
    width: 350px;
    height: 350px;
    background: var(--accent-cyan);
    top: 50%;
    right: 25%;
    animation-delay: -12s;
    animation-duration: 28s;
}

/* ───────────────────────────────────────────────────────────────
   PAGE HERO - Cinematic
   ─────────────────────────────────────────────────────────────── */
.page-hero {
    margin-bottom: var(--space-2xl);
    animation: fadeSlideUp 0.7s var(--ease-dramatic) backwards;
}

.page-hero-eyebrow {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.page-hero-eyebrow-line {
    width: 32px;
    height: 2px;
    background: var(--accent-green);
    border-radius: var(--radius-full);
    position: relative;
}

.page-hero-eyebrow-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-green);
    filter: blur(6px);
    opacity: 0.5;
}

.page-hero-eyebrow-text {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-hero-title {
    font-family: var(--font-display);
    font-size: clamp(var(--text-4xl), 10vw, var(--text-5xl));
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.page-hero-subtitle {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-secondary);
    max-width: 420px;
    line-height: 1.7;
}

/* ───────────────────────────────────────────────────────────────
   TOOLS SEARCH
   ─────────────────────────────────────────────────────────────── */
.tools-search {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    animation: fadeSlideUp 0.7s var(--ease-dramatic) 0.1s backwards;
}

.tools-search-wrap {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.tools-search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.tools-search-input {
    padding-left: calc(var(--space-md) + 26px) !important;
}

.tools-search-wrap:focus-within .tools-search-icon {
    color: var(--accent-blue);
}

.tools-search-count {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

/* ───────────────────────────────────────────────────────────────
   HUB CONTROLS - Search + Filter Bar
   ─────────────────────────────────────────────────────────────── */
.hub-controls {
    margin-bottom: var(--space-xl);
    animation: fadeSlideUp 0.7s var(--ease-dramatic) 0.1s backwards;
}

.hub-controls .tools-search {
    margin-bottom: var(--space-md);
}

/* ───────────────────────────────────────────────────────────────
   FILTER PILLS - Category navigation
   ─────────────────────────────────────────────────────────────── */
.hub-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.hub-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition:
        color var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform 200ms var(--ease-bounce);
    white-space: nowrap;
}

.hub-filter-pill i {
    font-size: 15px;
    transition: color var(--transition-fast);
}

.hub-filter-pill .hub-filter-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.hub-filter-pill:hover {
    color: var(--text-secondary);
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.hub-filter-pill:hover i {
    color: var(--pill-accent, var(--accent-green));
}

.hub-filter-pill.active {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--pill-accent, var(--accent-green)) 10%, var(--bg-tertiary));
    border-color: color-mix(in srgb, var(--pill-accent, var(--accent-green)) 30%, transparent);
    box-shadow: 0 0 20px -6px color-mix(in srgb, var(--pill-accent, var(--accent-green)) 30%, transparent);
}

.hub-filter-pill.active i {
    color: var(--pill-accent, var(--accent-green));
}

.hub-filter-pill.active .hub-filter-count {
    background: color-mix(in srgb, var(--pill-accent, var(--accent-green)) 18%, var(--bg-elevated));
    color: var(--pill-accent, var(--accent-green));
}

/* ───────────────────────────────────────────────────────────────
   HUB SECTIONS - Category groups
   ─────────────────────────────────────────────────────────────── */
.hub-sections {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

.hub-section {
    animation: fadeSlideUp 0.6s var(--ease-dramatic) backwards;
}

.hub-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    position: relative;
}

.hub-section-marker {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.hub-section-marker-line {
    width: 24px;
    height: 2px;
    background: var(--section-accent, var(--accent-green));
    border-radius: var(--radius-full);
    position: relative;
}

.hub-section-marker-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--section-accent, var(--accent-green));
    filter: blur(4px);
    opacity: 0.5;
}

.hub-section-marker-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--section-accent, var(--accent-green));
    box-shadow: 0 0 8px color-mix(in srgb, var(--section-accent, var(--accent-green)) 50%, transparent);
    flex-shrink: 0;
}

.hub-section-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.hub-section-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--section-accent, var(--accent-green)) 8%, var(--bg-tertiary));
    border: var(--border-thin) solid color-mix(in srgb, var(--section-accent, var(--accent-green)) 12%, transparent);
}

.hub-section-icon i {
    font-size: 16px;
    color: var(--section-accent, var(--accent-green));
}

.hub-section-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hub-section-count {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
}

/* Section divider line that extends after the header */
.hub-section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(
        to right,
        color-mix(in srgb, var(--section-accent, var(--accent-green)) 15%, transparent),
        transparent 80%
    );
}

@media (max-width: 640px) {
    .hub-filter {
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--space-sm);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .hub-filter::-webkit-scrollbar {
        display: none;
    }

    .hub-filter-pill {
        padding: 6px 12px;
        font-size: var(--text-xs);
    }

    .hub-filter-pill span:not(.hub-filter-count) {
        display: none;
    }

    .hub-section-title {
        font-size: var(--text-base);
    }
}

/* ───────────────────────────────────────────────────────────────
   TOOLS GRID - BENTO LAYOUT
   ─────────────────────────────────────────────────────────────── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
    gap: var(--grid-gap);
}

/* ───────────────────────────────────────────────────────────────
   TOOL CARD - Cinematic depth
   ─────────────────────────────────────────────────────────────── */
.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: var(--border-thin) solid var(--border-subtle);
    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
    grid-column: span 1;
    grid-row: span 1;
    transition:
        border-color var(--transition-slow),
        box-shadow var(--transition-slower),
        transform var(--transition-base);
    animation: cardEntrance 0.8s var(--ease-dramatic) backwards;
    animation-delay: 0.15s;
}

.tool-card:nth-child(2) {
    animation-delay: 0.25s;
}

.tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--accent) 8%, transparent) 0%,
        transparent 50%,
        color-mix(in srgb, var(--accent) 3%, transparent) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-slower);
}

.tool-card:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent),
        0 8px 70px -20px var(--accent);
    transform: translateY(-6px);
}

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

/* Card glow effect */
.tool-card .card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent) 12%, transparent) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.tool-card:hover .card-glow {
    opacity: 1;
}

/* Shine effect */
.tool-card .card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.02) 45%,
        rgba(255, 255, 255, 0.04) 50%,
        rgba(255, 255, 255, 0.02) 55%,
        transparent 60%
    );
    transform: translateX(-100%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

.tool-card:hover .card-shine {
    transform: translateX(100%);
}

/* Card content */
.tool-card .card-content {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    z-index: 1;
}

.tool-card .card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-tertiary));
    margin-bottom: var(--space-lg);
    transition: all var(--transition-base);
    border: var(--border-thin) solid color-mix(in srgb, var(--accent) 15%, transparent);
    position: relative;
}

.tool-card .card-icon::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    background: radial-gradient(circle, var(--accent), transparent 70%);
    opacity: 0;
    filter: blur(10px);
    transition: opacity var(--transition-slow);
    z-index: -1;
}

.tool-card:hover .card-icon {
    background: color-mix(in srgb, var(--accent) 18%, var(--bg-tertiary));
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    transform: scale(1.08) translateY(-2px);
}

.tool-card:hover .card-icon::before {
    opacity: 0.3;
}

.tool-card .card-icon i {
    font-size: 24px;
    color: var(--accent);
    transition: transform var(--transition-base);
}

.tool-card:hover .card-icon i {
    transform: scale(1.05);
}

.tool-card .card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-card .card-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    transition: color var(--transition-base);
}

.tool-card:hover .card-title {
    color: var(--accent);
}

.tool-card .card-subtitle {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Arrow indicator */
.tool-card .card-arrow {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-base);
}

.tool-card .card-arrow i {
    font-size: 20px;
    color: var(--accent);
    transition: transform var(--transition-base);
}

.tool-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.tool-card:hover .card-arrow i {
    transform: translateX(3px);
}

/* Coming soon card - muted state */
.tool-card--coming-soon {
    cursor: default;
    opacity: 0.6;
}

.tool-card--coming-soon:hover {
    transform: none;
    border-color: var(--border-subtle);
    box-shadow: none;
}

.tool-card--coming-soon:hover::before {
    opacity: 0;
}

.tool-card--coming-soon:hover .card-icon {
    transform: none;
}

.tool-card--coming-soon:hover .card-title {
    color: var(--text-primary);
}

/* ───────────────────────────────────────────────────────────────
   COMPRESS TOOL - SPECIFIC OVERRIDES
   ─────────────────────────────────────────────────────────────── */
.compress-tool {
    --accent: var(--accent-purple);
}

.compression-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.compression-mode {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ───────────────────────────────────────────────────────────────
   VIDEO TRIMMER - SPECIFIC STYLES
   ─────────────────────────────────────────────────────────────── */
.video-trimmer {
    --accent: var(--accent-cyan);
    max-width: 720px;
}

.trim-editor {
    display: none;
    flex-direction: column;
    gap: var(--space-lg);
    width: 100%;
    box-sizing: border-box;
}

.trim-editor.active {
    display: flex;
}

/* Video Player */
.trim-video-wrap {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    border: var(--border-thin) solid var(--border-subtle);
    box-sizing: border-box;
    cursor: pointer;
}

.trim-video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    background: #000;
}

/* Play/Pause overlay on video */
.trim-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    cursor: pointer;
}

.trim-play-overlay.visible {
    opacity: 1;
}

.trim-video-wrap:hover .trim-play-overlay.visible {
    opacity: 1;
}

.trim-play-overlay i {
    font-size: 48px;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Timeline */
.trim-timeline {
    position: relative;
    width: 100%;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    box-sizing: border-box;
    cursor: pointer;
    touch-action: none;
    overflow: visible;
}

.trim-timeline-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    border-radius: inherit;
    overflow: hidden;
    opacity: 0.4;
}

.trim-timeline-thumb {
    flex: 1;
    min-width: 0;
    background-size: cover;
    background-position: center;
}

.trim-timeline-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: color-mix(in srgb, var(--accent-cyan) 18%, transparent);
    border-top: 3px solid var(--accent-cyan);
    border-bottom: 3px solid var(--accent-cyan);
    pointer-events: none;
    z-index: 1;
}

.trim-timeline-playhead {
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: 0;
    width: 2px;
    background: var(--text-primary);
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Trim Handles - large, obvious, draggable */
.trim-handle {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 14px;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.trim-handle-bar {
    width: 14px;
    height: 100%;
    border-radius: var(--radius-sm);
    background: var(--accent-cyan);
    position: relative;
    transition:
        box-shadow var(--transition-fast),
        width var(--transition-fast);
}

/* Grip lines on the handle */
.trim-handle-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 16px;
    border-left: 1.5px solid rgba(0, 0, 0, 0.4);
    border-right: 1.5px solid rgba(0, 0, 0, 0.4);
}

.trim-handle:hover .trim-handle-bar {
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent-cyan) 60%, transparent);
}

.trim-handle.dragging .trim-handle-bar {
    width: 16px;
    box-shadow:
        0 0 20px color-mix(in srgb, var(--accent-cyan) 70%, transparent),
        0 0 40px color-mix(in srgb, var(--accent-cyan) 30%, transparent);
}

.trim-handle:focus-visible {
    outline: none;
}

.trim-handle:focus-visible .trim-handle-bar {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-cyan) 40%, transparent);
}

/* Time Display */
.trim-times {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
}

.trim-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.trim-time-label {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.trim-time-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text-primary);
}

.trim-time-value--accent {
    color: var(--accent-cyan);
}

/* Trim Controls */
.trim-controls {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ───────────────────────────────────────────────────────────────
   VIDEO DOWNLOADER - SPECIFIC STYLES
   ─────────────────────────────────────────────────────────────── */
.video-downloader {
    --accent: var(--accent-green);
    max-width: 640px;
}

/* Supported Sites */
.supported-sites {
    margin-bottom: var(--space-md);
}

.supported-sites-label {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
}

.supported-sites-logos {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
}

.site-logo {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.site-logo:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: color-mix(in srgb, var(--accent-green) 8%, var(--bg-tertiary));
    transform: translateY(-2px);
}

.site-logo svg {
    width: 18px;
    height: 18px;
}

.site-logo--more {
    width: auto;
    padding: 0 var(--space-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: -0.02em;
}

.url-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.url-input-progress {
    position: absolute;
    inset: 0;
    width: 0%;
    background: color-mix(in srgb, var(--accent-green) 12%, transparent);
    border-radius: inherit;
    transition: width 0.2s ease;
    pointer-events: none;
    z-index: 0;
}

.url-input-status {
    display: none;
    margin: var(--space-xs) 0 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--accent-green);
}

.url-input-status.active {
    display: block;
}

.url-input-icon {
    position: absolute;
    left: var(--space-md);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.url-input {
    padding-left: calc(var(--space-md) + 28px) !important;
    padding-right: calc(var(--space-md) + 40px) !important;
}

.url-paste-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 1;
}

.url-paste-btn:hover {
    background: color-mix(in srgb, var(--accent-green) 15%, var(--bg-tertiary));
    color: var(--accent-green);
}

.url-paste-btn i {
    font-size: 16px;
}

/* Format Toggle */
.format-toggle {
    display: flex;
    align-items: center;
}

/* Video Info Card */
.video-info-card {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.video-info-card.active {
    display: flex;
}

.video-info-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
}

.video-info-thumb-skeleton {
    display: none;
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.video-info-card.loading .video-info-thumb-skeleton {
    display: block;
}

.video-info-card.loading .video-info-thumb,
.video-info-card.loading .video-info-duration,
.video-info-card.loading .video-info-title,
.video-info-card.loading .video-info-meta {
    display: none;
}

.video-info-card.loading .skeleton-text {
    display: block;
}

.video-info-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-info-duration {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
}

/* Skeleton loading placeholders */
.skeleton-text {
    display: none;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-title {
    height: 20px;
    width: 75%;
}

.skeleton-meta {
    height: 14px;
    width: 40%;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.video-info-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.video-info-title {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.video-info-meta {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ───────────────────────────────────────────────────────────────
   PDF TOOLS - ACCENT OVERRIDES
   ─────────────────────────────────────────────────────────────── */
.pdf-merge {
    --accent: var(--accent-red);
}

.pdf-split {
    --accent: var(--accent-yellow);
}

.pdf-compress {
    --accent: var(--accent-blue);
}

.pdf-to-word {
    --accent: var(--accent-blue);
}

.word-to-pdf {
    --accent: var(--accent-red);
}

.pdf-to-ppt {
    --accent: var(--accent-yellow);
}

/* ───────────────────────────────────────────────────────────────
   PDF MERGE - FILE LIST WITH DRAG REORDER
   ─────────────────────────────────────────────────────────────── */
.merge-file-list-container {
    display: none;
    flex-direction: column;
    gap: var(--space-sm);
}

.merge-file-list-container.active {
    display: flex;
}

.merge-file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.merge-file-count {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.merge-file-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    position: relative;
}

.merge-file-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform 100ms ease;
    user-select: none;
}

/* Drag handle */
.merge-file-drag {
    color: var(--text-muted);
    font-size: 18px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    cursor: grab;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    touch-action: none;
}

.merge-file-drag:hover {
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--text-muted) 8%, transparent);
}

.merge-file-drag:active {
    cursor: grabbing;
}

/* Order number */
.merge-file-order {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Dragging state — floating item */
.merge-file-item.merge-file-dragging {
    box-shadow: var(--shadow-xl), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
    border-color: var(--accent);
    background: var(--bg-secondary);
    opacity: 0.95;
    pointer-events: none;
    cursor: grabbing;
}

/* Placeholder — holds space while dragging */
.merge-file-placeholder {
    border-radius: var(--radius-md);
    border: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    transition: height 100ms ease;
}

.merge-file-icon {
    color: var(--accent-red);
    font-size: 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.merge-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.merge-file-name {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merge-file-size {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Action buttons group */
.merge-file-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.merge-file-move,
.merge-file-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.merge-file-move:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-tertiary));
    color: var(--accent);
}

.merge-file-move:disabled {
    opacity: 0.25;
    cursor: default;
}

.merge-file-remove:hover {
    background: color-mix(in srgb, var(--accent-red) 15%, var(--bg-tertiary));
    color: var(--accent-red);
}

.merge-file-hint {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-style: italic;
}

/* ───────────────────────────────────────────────────────────────
   PDF SPLIT - RANGE INPUT
   ─────────────────────────────────────────────────────────────── */
.range-group {
    display: none;
}

.range-group.active {
    display: block;
}

.form-hint {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ───────────────────────────────────────────────────────────────
   PDF TOOLS - FILE PREVIEW WITH ICON (no thumbnail)
   ─────────────────────────────────────────────────────────────── */
.file-preview-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-tertiary));
    color: var(--accent);
    font-size: 20px;
    flex-shrink: 0;
}

/* Result info text */
.result-info {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: 0 var(--space-lg);
}

/* ───────────────────────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-hero {
        margin-bottom: var(--space-xl);
    }

    .page-hero-title {
        font-size: var(--text-4xl);
    }

    .page-hero-subtitle {
        font-size: var(--text-base);
    }

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

    .tool-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: 200px;
        padding: var(--space-lg);
    }

    .tool-card .card-icon {
        width: 52px;
        height: 52px;
        margin-bottom: var(--space-md);
    }

    .tool-card .card-icon i {
        font-size: 24px;
    }

    .tool-card .card-title {
        font-size: 1.25rem;
    }

    .tool-card .card-arrow {
        top: var(--space-lg);
        right: var(--space-lg);
    }

    /* Video Trimmer responsive */
    .trim-video {
        max-height: 240px;
    }

    .trim-timeline {
        height: 56px;
    }

    .trim-handle {
        width: 18px;
    }

    .trim-handle-bar {
        width: 18px;
    }

    .trim-time-value {
        font-size: var(--text-base);
    }

    .trim-controls {
        flex-direction: column;
    }
}


/* ───────────────────────────────────────────────────────────────
   PDF THUMBNAILS - Reorder & Delete Pages
   ─────────────────────────────────────────────────────────────── */
.pdf-thumbnails-container {
    display: none;
    margin-bottom: var(--space-lg);
}

.pdf-thumbnails-container.active {
    display: block;
    animation: fadeSlideUp 0.4s var(--ease-dramatic);
}

.pdf-thumbnails-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.pdf-thumbnails-count {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.pdf-thumbnails-selected {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.pdf-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-lg);
    min-height: 100px;
}

.pdf-thumbnail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-primary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: grab;
    transition: var(--transition-fast);
    user-select: none;
}

.pdf-thumbnail:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pdf-thumbnail.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.pdf-thumbnail.drag-over {
    border-color: var(--accent-green);
    background: color-mix(in srgb, var(--accent-green) 8%, var(--bg-primary));
}

.pdf-thumbnail.marked-delete {
    border-color: var(--accent-red, #ef4444);
    background: color-mix(in srgb, var(--accent-red, #ef4444) 8%, var(--bg-primary));
    opacity: 0.6;
}

.pdf-thumbnail.marked-delete .pdf-thumbnail-delete-badge {
    display: flex;
}

.pdf-thumbnail-img {
    width: 100%;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--bg-base);
}

.pdf-thumbnail-img canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pdf-thumbnail-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.pdf-thumbnail-delete-badge {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    background: var(--accent-red, #ef4444);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
}

/* OCR Output */
.ocr-output {
    margin-bottom: var(--space-md);
}

.ocr-output .form-textarea {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    resize: vertical;
}

/* File Format Converter - Select */
.tool-page.file-format-converter select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    padding-right: var(--space-2xl);
}

/* Textarea for HTML input */
.form-textarea {
    min-height: 200px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
}

@media (max-width: 640px) {
    .pdf-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: var(--space-sm);
    }

    .pdf-thumbnails-header {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════════════
   IMAGE TOOLS - SHARED STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Range input group */
.range-input-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.form-range {
    flex: 1;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    appearance: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--accent, var(--accent-green));
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--accent, var(--accent-green));
    border: 2px solid var(--bg-primary);
    cursor: pointer;
}

.range-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
}

/* Aspect lock button */
.form-group--icon {
    display: flex;
    align-items: flex-end;
    padding-bottom: 6px;
}

.aspect-lock-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: var(--border-thin) solid var(--border-subtle);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.aspect-lock-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.aspect-lock-btn.active {
    background: color-mix(in srgb, var(--accent) 15%, var(--bg-tertiary));
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--accent);
}

.aspect-lock-btn i {
    font-size: 18px;
}

/* Color input */
.form-color {
    width: 48px;
    height: 40px;
    padding: 4px;
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    cursor: pointer;
}

.form-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.form-color::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-sm);
}

/* ───────────────────────────────────────────────────────────────
   IMAGE CROP - Canvas & Handles
   ─────────────────────────────────────────────────────────────── */
.crop-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.crop-container.active {
    display: flex;
}

.crop-preview-wrapper {
    position: relative;
    display: block;
    width: fit-content;
    line-height: 0;
}

.crop-image {
    display: block;
}

.crop-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px solid var(--accent-green);
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    pointer-events: auto;
}

.crop-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent-green);
    border: 2px solid #fff;
    border-radius: var(--radius-sm);
    pointer-events: auto;
}

.crop-handle--nw { top: -8px; left: -8px; cursor: nw-resize; }
.crop-handle--ne { top: -8px; right: -8px; cursor: ne-resize; }
.crop-handle--sw { bottom: -8px; left: -8px; cursor: sw-resize; }
.crop-handle--se { bottom: -8px; right: -8px; cursor: se-resize; }

.crop-info {
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Ratio buttons */
.ratio-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.ratio-btn {
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ratio-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.ratio-btn.active {
    background: color-mix(in srgb, var(--accent) 15%, var(--bg-tertiary));
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--accent);
}

/* ───────────────────────────────────────────────────────────────
   IMAGE TEXT - Editor & Position Grid
   ─────────────────────────────────────────────────────────────── */
.image-editor {
    display: none;
    margin-bottom: var(--space-md);
}

.image-editor.active {
    display: block;
}

.editor-canvas-wrapper {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.editor-canvas-wrapper canvas {
    max-width: 100%;
    height: auto;
}

.text-controls {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.text-controls.active {
    display: flex;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xs);
    max-width: 180px;
}

.position-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.position-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.position-btn.active {
    background: color-mix(in srgb, var(--accent) 15%, var(--bg-tertiary));
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--accent);
}

.position-btn i {
    font-size: 18px;
}

/* ───────────────────────────────────────────────────────────────
   IMAGE BLUR - Editor & Tools
   ─────────────────────────────────────────────────────────────── */
.blur-editor {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.blur-editor.active {
    display: flex;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.tool-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: var(--border-thin) solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tool-btn.active {
    background: color-mix(in srgb, var(--accent) 15%, var(--bg-secondary));
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--accent);
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tool-btn i {
    font-size: 18px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
    margin: 0 var(--space-xs);
}

.blur-editor .editor-canvas-wrapper {
    position: relative;
}

.blur-editor .editor-canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
}

#overlayCanvas {
    cursor: crosshair;
    z-index: 1;
}

.blur-controls {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
}

.blur-controls.active {
    display: flex;
}

/* ───────────────────────────────────────────────────────────────
   IMAGE METADATA - Viewer & Tabs
   ─────────────────────────────────────────────────────────────── */
.metadata-viewer {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.metadata-viewer.active {
    display: flex;
}

.metadata-tabs {
    display: flex;
    gap: var(--space-xs);
    border-bottom: var(--border-thin) solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.metadata-tab {
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.metadata-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.metadata-tab.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-tertiary));
}

.metadata-content {
    min-height: 200px;
}

.metadata-panel {
    display: none;
}

.metadata-panel.active {
    display: block;
}

.metadata-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--text-muted);
}

.metadata-loading i {
    font-size: 20px;
}

.metadata-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.metadata-list--full {
    max-height: 400px;
    overflow-y: auto;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.metadata-key {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.metadata-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
}

.metadata-empty {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.metadata-map {
    margin-top: var(--space-md);
}

.metadata-map-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--accent);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.metadata-map-link:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-tertiary));
}

.metadata-actions {
    display: none;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.metadata-actions.active {
    display: flex;
}

/* ───────────────────────────────────────────────────────────────
   FILES LIST - Image to PDF
   ─────────────────────────────────────────────────────────────── */
.files-list {
    display: none;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.files-list.active {
    display: flex;
}

.files-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: var(--border-thin) solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.files-list-number {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.files-list-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.files-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.files-list-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-list-size {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.files-list-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.files-list-remove:hover {
    background: color-mix(in srgb, var(--accent-red) 15%, var(--bg-tertiary));
    color: var(--accent-red);
}

/* Result preview */
.result-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.result-preview:has(.result-preview-img[src]) {
    background: transparent;
    padding: 0;
}

.result-preview.transparent-bg {
    background-image:
        linear-gradient(45deg, var(--bg-secondary) 25%, transparent 25%),
        linear-gradient(-45deg, var(--bg-secondary) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--bg-secondary) 75%),
        linear-gradient(-45deg, transparent 75%, var(--bg-secondary) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.result-preview-img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
}

/* Spin animation for loading */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}
