/* ==========================================================================
   HEXA'S METASTUDIO PRO - PREMIUM DESIGN SYSTEM
   Modern Dark Glassmorphism, Sleek Borders, Vibrant Gradients & Micro-interactions
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-base: #080c14;
    --bg-surface: #0d1322;
    --bg-surface-elevated: #131b2e;
    --bg-card: rgba(16, 23, 41, 0.75);
    --bg-card-hover: rgba(22, 32, 56, 0.85);
    --bg-glass-input: rgba(13, 19, 34, 0.7);

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --card-border-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);

    /* Solid Accents */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --cyan-accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-link: #818cf8;

    /* Borders & Glass Effects */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(99, 102, 241, 0.6);
    --glass-blur: blur(16px);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --card-shadow-hover: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 2px 1px rgba(99, 102, 241, 0.3);

    /* Typography & Radius */
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 9999px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Background Ambient Glows */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.09) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
    height: 68px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(13, 19, 34, 0.7);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
}

.brand-logo:hover .logo-icon {
    transform: scale(1.05) rotate(-3deg);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pro-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    background: var(--accent-gradient);
    color: #fff;
    border-radius: 4px;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.privacy-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    color: #34d399;
    font-weight: 600;
}

.privacy-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #34d399;
    box-shadow: 0 0 8px #34d399;
}

/* Preset Selector in Header */
.preset-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 4px 6px 4px 12px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.preset-selector-wrapper:hover {
    border-color: var(--border-medium);
}

.preset-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-md {
    padding: 10px 20px;
    font-size: 0.88rem;
    border-radius: var(--radius-md);
}

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

.btn-lg {
    padding: 12px 24px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    border-color: var(--border-medium);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}
.btn-glass:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-color: var(--border-medium);
}

.btn-accent {
    background: rgba(6, 182, 212, 0.15);
    color: #38bdf8;
    border-color: rgba(6, 182, 212, 0.3);
}
.btn-accent:hover:not(:disabled) {
    background: rgba(6, 182, 212, 0.25);
    border-color: rgba(6, 182, 212, 0.5);
    color: #fff;
}

.btn-danger-soft {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}
.btn-danger-soft:hover:not(:disabled) {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.custom-select {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-family: var(--font-main);
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.custom-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ==========================================================================
   WORKSPACE & DROPZONE
   ========================================================================== */
.main-workspace {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.upload-section {
    position: relative;
    max-width: 800px;
    margin: 4rem auto;
    padding: 2px;
}

.dropzone-glow {
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    filter: blur(28px);
    opacity: 0.25;
    z-index: 0;
    transition: var(--transition);
}

.dropzone-card {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: 4.5rem 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dropzone-card:hover, .dropzone-card.drag-active {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.dropzone-card.drag-active + .dropzone-glow {
    opacity: 0.5;
}

.file-input-hidden {
    display: none;
}

.upload-icon-pulse {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
    transition: var(--transition);
}

.dropzone-card:hover .upload-icon-pulse {
    transform: scale(1.1);
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 0 40px var(--primary-glow);
}

.upload-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: #fff;
}

.highlight-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upload-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 480px;
    margin-bottom: 2rem;
}

.upload-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.upload-features-bar {
    display: flex;
    gap: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.75rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.feat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}
.feat-item svg {
    color: var(--cyan-accent);
}

/* ==========================================================================
   ACTIVE EDITOR WORKSPACE (2-COLUMN GRID)
   ========================================================================== */
.editor-workspace {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 1.75rem;
    align-items: start;
    animation: fadeIn 0.4s ease-out;
}

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

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-medium);
}

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

.header-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.file-name-text {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-text-action {
    background: transparent;
    border: none;
    color: var(--text-link);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition);
}
.btn-text-action:hover {
    color: #fff;
    text-decoration: underline;
}

/* Left Panel */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.image-preview-card {
    position: relative;
}

.image-display-frame {
    position: relative;
    width: 100%;
    min-height: 240px;
    max-height: 380px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-preview-img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    display: block;
}

.image-overlay-badges {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Instant EXIF Summary Dashboard */
.exif-summary-panel {
    padding: 0.9rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.summary-stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 0.82rem;
    color: #e2e8f0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: rgba(13, 19, 34, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.badge-accent {
    background: rgba(99, 102, 241, 0.85);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.5);
}

/* GPS Map Card */
.gps-map-card {
    position: relative;
}

.map-header-actions {
    display: flex;
    gap: 0.5rem;
}

.map-container-wrap {
    position: relative;
    width: 100%;
    height: 230px;
}

.leaflet-map-element {
    width: 100%;
    height: 100%;
    background: #111;
}

.no-gps-banner {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, 0.85);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
}

.no-gps-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.map-coord-display {
    padding: 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.coord-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.coord-label {
    color: var(--text-muted);
}
.coord-val {
    color: var(--cyan-accent);
    font-weight: 600;
}

.coord-tip {
    font-size: 0.72rem;
    color: var(--text-muted);
    width: 100%;
}

/* Action Controls Card */
.action-controls-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.btn-action {
    width: 100%;
    padding: 13px 20px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

.action-sub-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

/* ==========================================================================
   RIGHT PANEL: METADATA STUDIO
   ========================================================================== */
.right-panel {
    display: flex;
    flex-direction: column;
}

.editor-card {
    display: flex;
    flex-direction: column;
    min-height: 640px;
}

.editor-header-bar {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.editor-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.editor-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Tab Navigation */
.tabs-nav-bar {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.tab-btn.active svg {
    color: var(--primary);
}

/* Tab Pane Contents */
.tab-content-area {
    padding: 1.5rem;
    flex: 1;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
    display: block;
}

/* Forms & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

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

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tag-badge {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 6px;
    border-radius: 4px;
}

.form-control {
    background: var(--bg-glass-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(19, 27, 46, 0.9);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

textarea.form-control {
    resize: vertical;
    min-height: 70px;
}

/* SEO Copy Banner */
.seo-copy-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.seo-copy-desc strong {
    display: block;
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.seo-copy-desc p {
    color: var(--text-secondary);
    font-size: 0.76rem;
    margin: 0;
}

/* GPS Specific Notice Banner */
.gps-notice-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 10px 14px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-sm);
    color: #67e8f9;
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
}

.quick-loc-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

/* Raw EXIF Tree Tab */
.raw-actions-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.raw-search-box {
    flex: 1;
}

.raw-tree-scroll {
    background: #040711;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    height: 480px;
    overflow-y: auto;
}

.raw-code-block {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #a5b4fc;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ==========================================================================
   PRESETS MODAL
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 620px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.modal-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

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

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 4px;
    transition: var(--transition);
}
.btn-close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.preset-create-bar {
    display: flex;
    gap: 0.6rem;
}

.preset-list-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.preset-list-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.preset-items-list {
    max-height: 250px;
    overflow-y: auto;
}

.preset-row {
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition);
}

.preset-row:last-child {
    border-bottom: none;
}

.preset-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.preset-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.preset-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preset-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
}

.default-preset-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-weight: 700;
}

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

.preset-row-actions {
    display: flex;
    gap: 0.4rem;
}

.preset-backup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(19, 27, 46, 0.95);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 420px;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: var(--transition);
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}
.toast.toast-info {
    border-left: 4px solid var(--cyan-accent);
}
.toast.toast-warning {
    border-left: 4px solid var(--warning);
}
.toast.toast-danger {
    border-left: 4px solid var(--danger);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1200px) {
    .editor-workspace {
        grid-template-columns: 380px 1fr;
    }
}

@media (max-width: 992px) {
    .editor-workspace {
        grid-template-columns: 1fr;
    }
    .main-workspace {
        padding: 1.25rem;
    }
    .app-header {
        padding: 0 1.25rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.full-width {
        grid-column: span 1;
    }
    .header-right {
        gap: 0.6rem;
    }
    .preset-selector-wrapper {
        display: none; /* Accessible from Presets Manager modal */
    }
}

/* ==========================================================================
   WORKSPACE MODE SWITCHER (SINGLE vs BATCH)
   ========================================================================== */
.workspace-mode-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.mode-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.mode-switch-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.mode-switch-btn.active {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.45);
}

.batch-hot-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 0.62rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   BATCH WORKSPACE STYLES
   ========================================================================== */
.batch-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

.batch-upload-card {
    padding: 3.25rem 2rem;
    text-align: center;
    border: 2px dashed rgba(99, 102, 241, 0.4);
    background: rgba(13, 19, 33, 0.7);
    border-radius: var(--radius-xl);
    transition: var(--transition);
}

.batch-upload-card:hover,
.batch-upload-card.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 35px rgba(99, 102, 241, 0.3);
}

.batch-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.batch-icon-glow {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

.batch-drop-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.batch-drop-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 580px;
    line-height: 1.5;
}

.batch-btn-row {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.25rem;
}

.batch-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 12px 24px;
    font-family: var(--font-main);
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid transparent;
}

.batch-action-btn:active {
    transform: scale(0.97);
}

.batch-action-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.batch-action-btn:hover svg {
    transform: translateY(-1px);
}

.batch-btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
}

.batch-btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.65);
    transform: translateY(-2px);
}

.batch-btn-secondary {
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.batch-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.95);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.batch-btn-sample {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.batch-btn-sample:hover {
    background: rgba(245, 158, 11, 0.22);
    color: #fef08a;
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}

/* Batch Active Panel */
.batch-active-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.batch-config-bar {
    padding: 1.5rem;
}

.batch-config-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr;
    gap: 1.25rem;
    align-items: flex-end;
}

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

.config-col {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.config-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.config-col.action-col {
    justify-content: flex-end;
}

/* Progress Display Card */
.batch-progress-card {
    margin-top: 1.25rem;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: fadeIn 0.25s ease-out;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.progress-status-text {
    font-weight: 700;
    color: #fff;
}

.progress-time-text {
    color: var(--cyan-accent);
    font-size: 0.78rem;
    font-family: var(--font-mono);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--cyan-accent), #34d399);
    border-radius: var(--radius-full);
    transition: width 0.15s ease-out;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.current-file-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.spinner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan-accent);
    box-shadow: 0 0 8px var(--cyan-accent);
    animation: pulseGlow 1.2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Batch Completion & Download Banner */
.batch-download-banner {
    margin-top: 1.25rem;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(6, 182, 212, 0.09));
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15);
}

@media (max-width: 768px) {
    .batch-download-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

.download-banner-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.check-circle-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.download-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

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

.download-banner-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Queue Grid */
.batch-queue-card {
    padding: 1.25rem;
}

.batch-queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    max-height: 520px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-top: 0.75rem;
}

.queue-item-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.queue-item-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.queue-item-thumb-frame {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.queue-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.queue-item-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: flex;
    justify-content: space-between;
}

.queue-status-tag {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
    border: 1px solid rgba(100, 116, 139, 0.4);
}

.status-processing {
    background: rgba(6, 182, 212, 0.25);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.5);
    animation: pulseGlow 1s infinite;
}

.status-done {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.status-error {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.5);
}
