@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --primary-glow: 0 0 20px rgba(96, 165, 250, 0.3);
    --accent-glow: 0 0 20px rgba(167, 139, 250, 0.3);
    --scrollbar-track: rgba(15, 23, 42, 0.72);
    --scrollbar-thumb: rgba(71, 85, 105, 0.95);
    --scrollbar-thumb-hover: rgba(96, 165, 250, 0.95);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #020617;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
    background-attachment: fixed;
}

html,
body {
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--scrollbar-thumb), #334155);
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.85);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--scrollbar-thumb-hover), #60a5fa);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
}

/* Custom Scrollbar for Results Panel */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.9);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
    background-image: linear-gradient(to bottom, #60a5fa, #38bdf8);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Glassmorphism effects */
.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-panel:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Tag Styles Redesign */
.seo-tag {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02);
}

.seo-tag::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.seo-tag:hover::after {
    transform: translateX(100%);
}

.seo-tag:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(96, 165, 250, 0.3);
    color: #ffffff;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.4);
}

/* Results Content Redesign */
#resultsContent .group {
    background: rgba(15, 23, 42, 0.2);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.4s ease;
}

#resultsContent .group:hover {
    background: rgba(15, 23, 42, 0.3);
    border-color: rgba(96, 165, 250, 0.1);
}

.metadata-preview-card {
    position: relative;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    box-shadow: 
        0 20px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.metadata-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, rgba(96, 165, 250, 0.05), transparent 40%);
    pointer-events: none;
}

.metadata-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metadata-preview-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.metadata-preview-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 1.2rem;
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.2);
}

.metadata-preview-title {
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
}

.metadata-preview-subtitle {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
}

.metadata-preview-pill {
    border-radius: 10px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.metadata-preview-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    align-items: start;
}

.metadata-preview-figure {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(2, 6, 23, 0.4);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.metadata-preview-figure:hover {
    transform: scale(1.02);
}

.metadata-preview-figure img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.metadata-preview-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.metadata-preview-file-name {
    margin: 0;
    font-size: 1.1rem;
    color: #f8fafc;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metadata-preview-summary {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.6;
    background: rgba(2, 6, 23, 0.3);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.metadata-preview-stats {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.metadata-preview-stats span {
    font-size: 0.7rem;
    color: #cbd5e1;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(30, 41, 59, 0.4);
    padding: 6px 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.metadata-preview-stats span:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(96, 165, 250, 0.2);
    color: #ffffff;
}

@media (max-width: 860px) {
    .metadata-preview-body {
        grid-template-columns: 1fr;
    }
}

[contenteditable="true"] {
    background: rgba(2, 6, 23, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
    border-radius: 16px !important;
    padding: 18px !important;
    color: #e2e8f0 !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    transition: all 0.3s ease !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

[contenteditable="true"]:focus {
    background: rgba(2, 6, 23, 0.6) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.05) !important;
    outline: none;
}

/* Tabs & Toolbar Refinement */
.output-toolbar {
    background: rgba(15, 23, 42, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    padding: 16px 24px !important;
}

.tab-btn {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    padding: 12px 4px !important;
    transition: all 0.3s ease !important;
}

.tab-btn i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.tab-btn.active {
    color: #60a5fa !important;
}

.tab-indicator {
    height: 3px !important;
    border-radius: 3px 3px 0 0 !important;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6) !important;
}

.output-action-btn {
    border-radius: 12px !important;
    padding: 8px 16px !important;
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    transition: all 0.3s ease !important;
}

.output-action-btn:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.8) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.output-action-btn i {
    opacity: 0.9;
}

/* Loading Shimmer */
.shimmer {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

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

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

/* Input & Select Custom Styles */
.custom-input {
    background: rgba(2, 6, 23, 0.5);
    transition: all 0.3s ease;
}

.custom-input:focus {
    background: rgba(2, 6, 23, 0.8);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
}

/* Stable cross-host range slider rendering */
.ui-range {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.ui-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.92);
}

.ui-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #e2e8f0;
    border: 2px solid #0f172a;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
    margin-top: -7px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ui-range:hover::-webkit-slider-thumb {
    transform: scale(1.03);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.24);
}

.ui-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 5px rgba(96, 165, 250, 0.28);
}

.ui-range::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.92);
}

.ui-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #e2e8f0;
    border: 2px solid #0f172a;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Button Glows */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    transform: scale(0);
    transition: transform 0.6s ease-out;
}

.btn-glow:hover::before {
    transform: scale(1);
}

/* Generate CTA */
.generate-btn-wrap {
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 23, 0.75) 100%);
}

.generate-btn {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(96, 165, 250, 0.38);
    background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.generate-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    border-color: rgba(147, 197, 253, 0.65);
    box-shadow: 0 14px 34px rgba(59, 130, 246, 0.42);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.15);
    box-shadow: none;
}

.retry-batch-btn {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.38), rgba(69, 10, 10, 0.48));
    color: #fecaca;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.retry-batch-btn:hover {
    border-color: rgba(252, 165, 165, 0.68);
    background: linear-gradient(90deg, rgba(153, 27, 27, 0.52), rgba(127, 29, 29, 0.62));
    color: #fee2e2;
    transform: translateY(-1px);
}

.retry-batch-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

/* Gradient Text */
.text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Hover Effects */
.hover-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(96, 165, 250, 0.2);
}

/* New Animations for Empty State */
@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 10s linear infinite;
}

@keyframes scan {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

.animate-scan {
    animation: scan 2s linear infinite;
}

/* Output toolbar cleanup */
.output-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    overflow-x: clip;
    overflow-y: visible;
    scrollbar-width: thin;
}

.output-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    white-space: nowrap;
    flex: 1 1 320px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.output-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1 1 360px;
    min-width: 0;
}

.output-action-btn {
    min-height: 34px;
    min-width: fit-content;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .output-actions {
        margin-left: auto;
        justify-content: flex-end;
    }
}

/* Batch Queue UI Redesign */
.batch-list-panel {
    scrollbar-gutter: stable;
    padding-right: 4px;
}

.batch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(15, 23, 42, 0.35);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

.batch-item:last-child {
    margin-bottom: 0;
}

.batch-item:hover {
    border-color: rgba(96, 165, 250, 0.15);
    background: rgba(15, 23, 42, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.5);
}

.batch-item.is-done {
    border-color: rgba(34, 197, 94, 0.15);
    background: rgba(6, 78, 59, 0.08);
}

.batch-item.is-processing {
    border-color: rgba(96, 165, 250, 0.25);
    background: rgba(30, 58, 138, 0.12);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.08);
}

.batch-item-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}

.batch-thumb {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background-color: #020617;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.batch-item:hover .batch-thumb {
    transform: scale(1.05);
}

.batch-item-copy {
    min-width: 0;
    flex: 1;
}

.batch-file-name {
    margin: 0;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.batch-file-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-file-ext {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 8px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.05);
}

.batch-file-size {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.batch-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.batch-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.6);
    font-size: 0.675rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.batch-status i {
    font-size: 0.75rem;
}

.status-label {
    display: inline-block;
}

.batch-status--pending {
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.4);
}

.batch-status--processing {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.08);
}

.batch-status--done {
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.08);
}

.batch-status--error {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.08);
}

.batch-remove-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #64748b;
    background: rgba(30, 41, 59, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
}

.batch-remove-btn:hover {
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.3);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.batch-remove-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 640px) {
    .batch-item {
        padding: 9px 10px;
        gap: 8px;
    }

    .batch-status span:last-child {
        display: none;
    }
}
