/* JSONPrompter.online - Premium Dark Theme */

:root {
    /* Premium Dark Palette - Neon Green Theme */
    --color-bg: #0a0a0a;
    --color-bg-elevated: #111111;
    --color-bg-hover: #1a1a1a;
    --color-surface: rgba(17, 17, 17, 0.9);
    --color-surface-hover: rgba(26, 26, 26, 0.95);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-strong: rgba(255, 255, 255, 0.15);
    --color-border-accent: rgba(57, 255, 20, 0.3);

    /* Text Colors */
    --color-text: #ffffff;
    --color-text-secondary: #9ca3af;
    --color-text-tertiary: #6b7280;

    /* Premium Accent - Neon Green */
    --color-accent: #39ff14;
    --color-accent-light: #5fff3f;
    --color-accent-dark: #2ecc0f;
    --color-accent-glow: rgba(57, 255, 20, 0.15);

    /* Secondary Accent */
    --color-secondary: #39ff14;
    --color-secondary-glow: rgba(57, 255, 20, 0.1);

    /* Success/Error */
    --color-success: #39ff14;
    --color-error: #ef4444;

    /* Premium Gradients */
    --gradient-primary: linear-gradient(135deg, #39ff14 0%, #2ecc0f 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(57, 255, 20, 0.1) 0%, rgba(57, 255, 20, 0.05) 100%);
    --gradient-border: linear-gradient(135deg, rgba(57, 255, 20, 0.5), rgba(57, 255, 20, 0.3));
    --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-bg-strong: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 20px;
    --glass-saturate: 180%;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 40px rgba(57, 255, 20, 0.1);
    --shadow-glow-strong: 0 0 60px rgba(57, 255, 20, 0.15);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme transition for all elements */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Premium Background */
.bg-pattern {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(57, 255, 20, 0.08), transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(57, 255, 20, 0.05), transparent 40%),
        radial-gradient(ellipse 50% 50% at 0% 100%, rgba(57, 255, 20, 0.03), transparent 40%);
    pointer-events: none;
    z-index: -1;
    transition: background 0.5s ease;
}

/* Noise texture overlay */
.bg-pattern::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.875rem 0;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--color-border);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    padding: 0 2rem;
}

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

.logo-text {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(57, 255, 20, 0.1);
    color: #39ff14;
    border: 1px solid rgba(57, 255, 20, 0.25);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 700;
    transition: all var(--transition-base);
}

.logo:hover .logo-icon {
    transform: scale(1.05);
    background: rgba(57, 255, 20, 0.15);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.2);
}

/* Logo Wrapper with Dropdown */
.logo-wrapper {
    position: relative;
}

.logo-chevron {
    color: var(--color-text-tertiary);
    transition: transform var(--transition-fast);
    margin-left: 0.25rem;
}

.logo-wrapper:hover .logo-chevron {
    transform: rotate(180deg);
    color: var(--color-accent);
}

.logo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    min-width: 180px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.logo-wrapper:hover .logo-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.dropdown-link:hover {
    color: var(--color-text);
    background: var(--glass-bg-strong);
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--glass-bg-strong);
}

.nav-link-icon {
    display: flex;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    color: var(--color-text-tertiary);
}

.nav-link-icon:hover {
    background: var(--glass-bg-strong);
    color: var(--color-text);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 1rem;
}

.theme-toggle:hover {
    color: #39ff14;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

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

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

/* ===== HERO ===== */
.hero {
    padding: calc(8rem + 60px) 0 6rem;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: clamp(2.75rem, 7vw, 4.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.gradient-text {
    background: linear-gradient(135deg,
            #fff 0%,
            #39ff14 30%,
            #5fff3f 60%,
            #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 200% center;
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    max-width: 520px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #39ff14;
    color: #0a0a0c;
    font-weight: 700;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #4dffaa;
    box-shadow: 0 0 40px rgba(57, 255, 20, 0.4), var(--shadow-lg);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: var(--glass-bg-strong);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-strong);
    transform: translateY(-2px);
}

/* ===== STATS ===== */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
    font-weight: 500;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-divider {
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg, transparent, var(--color-border-strong), transparent);
}

/* ===== SECTION HEADERS ===== */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--gradient-subtle);
    border: 1px solid var(--color-border-accent);
    color: var(--color-accent-light);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

/* ===== GENERATOR SECTION ===== */
.generator-section {
    padding: 2rem 0 6rem;
}

.generator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .generator-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Premium Panel Card */
.generator-panel {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transition: all var(--transition-smooth);
    position: relative;
}

.generator-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-surface);
    pointer-events: none;
}

.generator-panel:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.01);
}

.panel-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.panel-body {
    padding: 1.25rem;
    position: relative;
}

/* Input Tabs */
.input-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--color-bg);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    color: var(--color-text);
    background: var(--color-bg-elevated);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

/* Upload Zone */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-xl);
    background: var(--color-bg);
    cursor: pointer;
    transition: all var(--transition-base);
    min-height: 220px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-accent);
    background: var(--color-accent-glow);
}

.upload-icon {
    color: var(--color-text-tertiary);
    margin-bottom: 1rem;
    transition: all var(--transition-base);
}

.upload-zone:hover .upload-icon {
    color: var(--color-accent);
    transform: translateY(-4px);
}

.upload-text {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.upload-text strong {
    color: var(--color-text);
    font-weight: 600;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
}

/* Image Preview */
.image-preview {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}

.image-preview img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;
}

.remove-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.remove-btn:hover {
    background: var(--color-error);
    color: white;
    border-color: var(--color-error);
    transform: scale(1.05);
}

/* Text Input */
.text-input {
    width: 100%;
    min-height: 220px;
    padding: 1.25rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--color-text);
    resize: vertical;
    transition: all var(--transition-fast);
}

.text-input::placeholder {
    color: var(--color-text-tertiary);
}

.text-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

/* Prompt Type Section */
.prompt-type-section {
    padding: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.input-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.875rem;
}

.prompt-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Prompt Templates */
.prompt-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.template-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-btn:hover {
    border-color: rgba(57, 255, 20, 0.3);
    color: #39ff14;
    background: rgba(57, 255, 20, 0.05);
}

.template-btn.active {
    background: rgba(57, 255, 20, 0.1);
    border-color: rgba(57, 255, 20, 0.3);
    color: #39ff14;
}

.type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.type-btn:hover {
    border-color: var(--color-border-strong);
    background: var(--color-bg-hover);
}

.type-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.type-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.type-btn.active .type-name {
    color: #0a0a0c;
    font-weight: 700;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0a0a0c;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.generate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.generate-btn:hover::before {
    opacity: 1;
}

.generate-btn:hover {
    box-shadow: var(--shadow-glow-strong);
}

.generate-btn .btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.generate-btn.loading .btn-text {
    opacity: 0;
}

.generate-btn.loading .btn-loader {
    opacity: 1;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.spinner {
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

.spinner circle {
    stroke: #0a0a0c;
    stroke-linecap: round;
    stroke-dasharray: 90, 150;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* ===== OUTPUT PANEL ===== */
.output-actions {
    display: flex;
    gap: 0.35rem;
}

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

.action-btn:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
    background: var(--glass-bg-strong);
}

.action-btn.copy-success {
    border-color: #00ff88;
    color: #00ff88;
    background: rgba(57, 255, 20, 0.1);
    animation: copyPulse 0.3s ease;
}

@keyframes copyPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.json-output {
    min-height: 380px;
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 380px;
    color: var(--color-text-tertiary);
}

.placeholder-icon {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.output-placeholder p {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.json-code {
    padding: 1.5rem;
    margin: 0;
    background: #0a0a0c;
    color: var(--color-text-secondary);
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
    overflow-x: auto;
    min-height: 380px;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #00ff88;
}

.json-string {
    color: #00d4ff;
}

.json-number {
    color: #fbbf24;
}

.json-boolean {
    color: #f472b6;
}

.json-null {
    color: var(--color-text-tertiary);
}

/* ===== HISTORY PANEL ===== */
.history-panel {
    margin-top: 1.5rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    position: relative;
}

.history-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-surface);
    pointer-events: none;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.history-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--color-bg);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.history-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-tab:hover {
    color: var(--color-text-secondary);
}

.history-tab.active {
    color: var(--color-text);
    background: var(--color-bg-elevated);
    box-shadow: var(--shadow-sm);
}

.clear-history-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clear-history-btn:hover {
    border-color: var(--color-error);
    color: var(--color-error);
    background: rgba(239, 68, 68, 0.1);
}

.history-content {
    max-height: 280px;
    overflow-y: auto;
    position: relative;
}

.history-list,
.favorites-list {
    padding: 0.75rem;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    text-align: center;
}

.history-empty p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.history-empty span {
    color: var(--color-text-tertiary);
    font-size: 0.8rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
}

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

.history-item:hover {
    border-color: var(--color-border-strong);
    background: var(--color-bg-hover);
}

.history-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gradient-subtle);
    border: 1px solid var(--color-border-accent);
    border-radius: var(--radius-md);
    color: var(--color-accent-light);
    flex-shrink: 0;
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-type {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-item-preview {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.2rem;
}

.history-item-time {
    font-size: 0.7rem;
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}

.history-item-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.history-item:hover .history-item-actions {
    opacity: 1;
}

.history-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-action-btn:hover {
    background: var(--glass-bg-strong);
    color: var(--color-text);
}

.history-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-error);
}

.history-action-btn.favorite.active {
    color: #f472b6;
}

.history-action-btn.favorite.active svg {
    fill: #f472b6;
}

/* ===== JSON EDITOR ===== */
.json-editor {
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.json-editor textarea {
    flex: 1;
    width: 100%;
    min-height: 320px;
    padding: 1.5rem;
    background: #0a0a0c;
    border: none;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
    resize: none;
}

.json-editor textarea:focus {
    outline: none;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: #07070a;
    border-top: 1px solid var(--color-border);
}

.editor-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.editor-btn.cancel-btn {
    background: var(--glass-bg-strong);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.editor-btn.cancel-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.editor-btn.save-btn {
    background: var(--color-success);
    color: white;
}

.editor-btn.save-btn:hover {
    background: #0d9668;
}

/* Action Button States */
.action-btn.favorite-active {
    color: #f472b6;
    border-color: #f472b6;
}

.action-btn.favorite-active svg {
    fill: #f472b6;
}

.action-btn.edit-active {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: var(--color-accent-glow);
}

/* Scrollbar */
.history-content::-webkit-scrollbar {
    width: 6px;
}

.history-content::-webkit-scrollbar-track {
    background: transparent;
}

.history-content::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: 3px;
}

.history-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
    --color-bg: #fafafa;
    --color-bg-elevated: #ffffff;
    --color-bg-hover: #f4f4f5;
    --color-surface: rgba(255, 255, 255, 0.9);
    --color-surface-hover: rgba(244, 244, 245, 0.9);
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-strong: rgba(0, 0, 0, 0.15);
    --color-border-accent: rgba(0, 200, 100, 0.3);

    --color-text: #18181b;
    --color-text-secondary: #52525b;
    --color-text-tertiary: #a1a1aa;

    --color-accent: #00cc6a;
    --color-accent-light: #00ff88;
    --color-accent-dark: #00994d;
    --color-accent-glow: rgba(0, 204, 106, 0.15);

    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-bg-strong: rgba(0, 0, 0, 0.04);
    --glass-border: rgba(0, 0, 0, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(0, 204, 106, 0.15);
    --shadow-glow-strong: 0 0 60px rgba(0, 204, 106, 0.25);

    --gradient-primary: linear-gradient(135deg, #00cc6a 0%, #00a5b5 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(0, 204, 106, 0.08) 0%, rgba(0, 165, 181, 0.04) 100%);
    --gradient-surface: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0) 100%);
}

[data-theme="light"] .bg-pattern {
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(0, 204, 106, 0.08), transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 165, 181, 0.05), transparent 40%),
        radial-gradient(ellipse 50% 50% at 0% 100%, rgba(0, 204, 106, 0.03), transparent 40%);
}

[data-theme="light"] .navbar {
    background: rgba(250, 250, 250, 0.85);
}

[data-theme="light"] .json-code,
[data-theme="light"] .json-editor textarea,
[data-theme="light"] .code-block {
    background: #1a1a1c;
}

[data-theme="light"] .btn-primary {
    background: #00cc6a;
    box-shadow: 0 0 30px rgba(0, 204, 106, 0.25);
}

[data-theme="light"] .btn-primary:hover {
    background: #00e077;
    box-shadow: 0 0 40px rgba(0, 204, 106, 0.35), var(--shadow-lg);
}

[data-theme="light"] .generate-btn {
    background: linear-gradient(135deg, #00cc6a 0%, #00a5b5 100%);
}

[data-theme="light"] .type-btn.active {
    background: linear-gradient(135deg, #00cc6a 0%, #00a5b5 100%);
}

[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #18181b 0%, #00cc6a 30%, #00a5b5 60%, #18181b 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .stat-number {
    background: linear-gradient(135deg, #00cc6a 0%, #00a5b5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .json-key {
    color: #00cc6a;
}

[data-theme="light"] .json-string {
    color: #0891b2;
}

[data-theme="light"] .json-number {
    color: #d97706;
}

/* ===== MODEL SELECTOR ===== */
.model-selector {
    position: relative;
}

.model-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.model-select:hover {
    border-color: var(--color-border-strong);
}

.model-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.model-select optgroup {
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
}

.model-select option {
    padding: 0.5rem;
    background: var(--color-bg);
    color: var(--color-text);
}

/* ===== GALLERY SECTION ===== */
.gallery-section {
    padding: 6rem 0;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    padding: 0.625rem 1.25rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #0a0a0c;
}

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

.gallery-card {
    padding: 1.75rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.gallery-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-surface);
    pointer-events: none;
}

.gallery-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.gallery-card:hover {
    border-color: var(--color-border-strong);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.gallery-card:hover::after {
    opacity: 1;
}

.gallery-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.gallery-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    position: relative;
}

.gallery-card p {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    position: relative;
}

.gallery-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-subtle);
    border: 1px solid var(--color-border-accent);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-accent-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.gallery-card.hidden {
    display: none;
}

.gallery-card.hidden-template {
    display: none;
}

.gallery-card.hidden-template.show {
    display: block;
}

.gallery-show-more {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.show-more-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.show-more-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.show-more-btn svg {
    transition: transform var(--transition-smooth);
}

.show-more-btn.expanded svg {
    transform: rotate(180deg);
}

@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-filters {
        gap: 0.375rem;
    }

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

/* ===== SCROLL ANIMATIONS ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate.animate-left {
    transform: translateX(-30px);
}

.scroll-animate.animate-left.animate-in {
    transform: translateX(0);
}

.scroll-animate.animate-right {
    transform: translateX(30px);
}

.scroll-animate.animate-right.animate-in {
    transform: translateX(0);
}

.scroll-animate.animate-scale {
    transform: scale(0.9);
}

.scroll-animate.animate-scale.animate-in {
    transform: scale(1);
}

/* Stagger children animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-children.animate-in > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animate-in > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animate-in > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animate-in > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animate-in > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animate-in > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.animate-in > * {
    opacity: 1;
    transform: translateY(0);
}

/* ===== KEYBOARD SHORTCUTS MODAL ===== */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.shortcuts-overlay.show {
    opacity: 1;
    visibility: visible;
}

.shortcuts-modal {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.shortcuts-overlay.show .shortcuts-modal {
    transform: scale(1) translateY(0);
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.shortcuts-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shortcuts-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.shortcuts-close:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--color-border);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.shortcut-keys {
    display: flex;
    gap: 0.35rem;
}

.key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text);
    box-shadow: 0 2px 0 var(--color-border-strong);
}

.shortcuts-hint {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 100;
}

.shortcuts-hint:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.shortcuts-hint .key {
    min-width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

/* ===== GENERATION COUNTER BADGE ===== */
.stats-badge {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    z-index: 100;
    transition: all var(--transition-smooth);
}

.stats-badge:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.stats-badge-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}

/* ===== SKELETON LOADER ===== */
.skeleton-loader {
    display: none;
    padding: 1.5rem;
    min-height: 380px;
}

.skeleton-loader.show {
    display: block;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg,
        var(--color-bg-hover) 25%,
        var(--color-bg-elevated) 50%,
        var(--color-bg-hover) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    animation: skeletonShimmer 1.5s infinite;
}

.skeleton-line:nth-child(1) { width: 60%; }
.skeleton-line:nth-child(2) { width: 80%; }
.skeleton-line:nth-child(3) { width: 45%; }
.skeleton-line:nth-child(4) { width: 90%; }
.skeleton-line:nth-child(5) { width: 70%; }
.skeleton-line:nth-child(6) { width: 55%; }
.skeleton-line:nth-child(7) { width: 85%; }
.skeleton-line:nth-child(8) { width: 40%; }

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

/* ===== CONFETTI CANVAS ===== */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* ===== ENHANCED TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.toast.toast-success .toast-icon {
    background: rgba(57, 255, 20, 0.15);
    color: var(--color-accent);
}

.toast.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-error);
}

.toast.toast-warning .toast-icon {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.toast.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.toast-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 0.5rem;
}

.toast-close:hover {
    background: var(--glass-bg-strong);
    color: var(--color-text);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--color-accent);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    animation: toastProgress 3s linear forwards;
}

.toast.toast-error .toast-progress {
    background: var(--color-error);
}

.toast.toast-warning .toast-progress {
    background: #fbbf24;
}

.toast.toast-info .toast-progress {
    background: #3b82f6;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .shortcuts-hint {
        bottom: 1rem;
        right: 1rem;
        padding: 0.5rem 0.75rem;
    }

    .stats-badge {
        top: 4.5rem;
        right: 1rem;
        min-width: 32px;
        height: 32px;
        padding: 0 0.5rem;
    }

    .stats-badge-count {
        font-size: 0.75rem;
    }
}