/**
 * MJ Bypass - Image Generator Styles
 * Full Responsive Design
 */

/* ==================== VARIABLES ==================== */
/* Color palette matched to vitalentum.net */
:root {
    --bg-dark: #080922;
    --bg-sidebar: #07081c;
    --bg-card: #0f1029;
    --bg-input: #151735;
    --border-color: #1e2245;
    --text-primary: #ffffff;
    --text-secondary: #CBCBCB;
    --text-muted: #7a7a8a;
    --accent-primary: #F97316;
    --accent-secondary: #FB923C;
    --accent-gradient: linear-gradient(135deg, #F97316, #FB923C);
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --sidebar-width: 280px;
    --settings-width: 280px;
    --mobile-header-height: 56px;

    /* Multi-color badge palette */
    --accent-purple: #A855F7;
    --accent-blue: #3B82F6;
    --accent-cyan: #06B6D4;
    --accent-pink: #EC4899;
    --accent-indigo: #6366F1;
    --accent-teal: #14B8A6;
    --accent-yellow: #EAB308;
    --accent-green: #22C55E;
}

.ai-tools .vitalentum-body {
    margin-bottom: 0 !important;
}

/* ==================== MOBILE HEADER ==================== */
.mobile-header {
    display: none;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.menu-toggle {
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.mobile-logo {
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== APP LAYOUT ==================== */
.app-layout {
    display: flex;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-inner {
    padding: 1rem 1rem 0 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}


/* Limits Block */
.limits-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.limits-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.6rem;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    background: rgba(249, 115, 22, 0.15);
    border-radius: 20px;
    font-size: 0.65rem;
    color: var(--accent-primary);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.plan-badge[data-plan="basic"] {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
}

.plan-badge[data-plan="pro"] {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
}

.limits-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

.limit-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.limit-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.limit-stat-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.limit-stat-highlight {
    color: var(--accent-primary);
}

.progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
}
/* ==================== STYLES BLOCK ==================== */

.styles-block {
    margin-bottom: 0.5rem;
}

.block-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.block-title i {
    font-size: 0.85rem;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
}

.style-btn {
    padding: 0.5rem 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 48px;
}

.style-btn i {
    font-size: 1rem;
}

.style-btn span {
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.2;
}

.style-btn:hover {
    background: var(--bg-input);
    border-color: var(--accent-primary);
}

.style-btn.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

/* Categories */
.categories-block {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Fade effect at bottom */
.categories-block::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, var(--bg-sidebar) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.categories-block.has-scroll::after {
    opacity: 1;
}

.block-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 0.5rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    padding-right: 4px;
    margin-right: -4px;
}

/* Custom scrollbar for categories */
.categories-list::-webkit-scrollbar {
    width: 4px;
}

.categories-list::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.categories-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-cyan));
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.categories-list:hover::-webkit-scrollbar-thumb {
    opacity: 1;
}

/* Hide scrollbar when not hovering */
.categories-list {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.categories-list:hover {
    scrollbar-color: rgba(249, 115, 22, 0.5) transparent;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.category-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.category-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    border-left: 2px solid var(--accent-indigo);
}

.category-btn i {
    width: 20px;
    text-align: center;
}

/* History */
.history-block {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-color);
}

.history-list {
    max-height: 150px;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 1rem 0;
}

.history-item {
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: var(--bg-card);
}

.history-prompt {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Demo Block */
.demo-block {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.demo-block label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.demo-block select {
    width: 100%;
    padding: 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 90;
    backdrop-filter: blur(1px);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Content Header - Sticky */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.current-category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.current-category i {
    font-size: 1.25rem;
    color: var(--accent-primary);
}

.content-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.tab-btn i {
    font-size: 0.9rem;
}


/* History Grid Tab */
.history-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.history-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.history-grid-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.history-grid-empty p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.history-grid-empty span {
    font-size: 0.85rem;
}

.history-grid-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}

.history-grid-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
}

.history-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-grid-item .item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.75rem;
}

.history-grid-item:hover .item-overlay {
    opacity: 1;
}

.history-grid-item .item-prompt {
    font-size: 0.7rem;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.history-grid-item .item-time {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.7);
}

/* ==================== GALLERY SECTION ==================== */
.gallery-section {
    flex: 1;
    padding: 1rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    text-align: center;
    color: var(--text-muted);
}

.gallery-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.gallery-empty p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.gallery-empty span {
    font-size: 0.85rem;
    opacity: 0.7;
}

.gallery-empty.hidden {
    display: none;
}


/* ==================== GENERATION BLOCK (4 images row) ==================== */
.generation-block, .video-gallery-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.generation-block.is-new, .video-gallery-card.is-new {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
}

.generation-header, .video-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.generation-prompt, .video-gallery-prompt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    margin-right: 1rem;
    word-break: break-word;
}

.generation-time, .video-gallery-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.generation-grid, .video-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Image card within generation */
.gen-image-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-input);
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.gen-image-card:hover {
    border-color: var(--accent-primary);
}

/* Fixed aspect ratio - width always the same, height varies */
.generation-grid.ar-square .gen-image-card { aspect-ratio: 1; }
.generation-grid.ar-landscape .gen-image-card { aspect-ratio: 4/3; }
.generation-grid.ar-portrait .gen-image-card { aspect-ratio: 3/4; }

.gen-image-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    /* Prevent image from causing repaints */
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Image number */
.gen-image-card .img-num {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    z-index: 1;
}

/* Hover overlay with actions */
.gen-image-card .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 8px;
}

.gen-image-card:hover .card-overlay {
    opacity: 1;
}

.card-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.card-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: opacity 0.2s;
}

.card-action-btn:hover {
    opacity: 0.8;
}

.card-action-btn i {
    font-size: 0.75rem;
}

/* Upscale Grid */
.upscale-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 400px;
    width: 100%;
}

.upscale-btn {
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.upscale-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ==================== INPUT SECTION ==================== */
.input-section {
    padding: 1rem 1.5rem 1.5rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
}

/* Reference Panel */
.reference-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.reference-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.close-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}


.reference-content {
    padding: 1rem;
}

.reference-layout {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.reference-image-side {
    flex: 0 0 360px;
    min-height: 160px;
}

.reference-sliders-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    justify-content: center;
}

.reference-preview {
    position: relative;
    height: 100%;
}

.reference-preview img {
    width: 100%;
    height: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-input);
}

/* Reference Sliders */
.ref-slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ref-slider-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.ref-slider-label i {
    width: 14px;
    text-align: center;
    font-size: 0.7rem;
}

.ref-slider-label span {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.ref-slider-value {
    margin-left: auto;
    font-family: monospace;
    font-weight: 600;
    font-size: 0.75rem;
    min-width: 2rem;
    text-align: right;
}

.ref-slider-value.ref-slider-disabled {
    opacity: 0.3;
}

.ref-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 20px; /* увеличенная touch-зона */
    border-radius: 10px;
    background: transparent;
    outline: none;
    cursor: pointer;
    touch-action: pan-y; /* позволяет скролл по вертикали, захватывает горизонталь */
    user-select: none;
    -webkit-user-select: none;
    will-change: transform;
    padding: 0;
    margin: 0;
}

/* визуальный трек через webkit-slider-runnable-track */
.ref-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(
        to right,
        var(--track-fill) 0%,
        var(--track-fill) var(--fill, 0%),
        var(--bg-input) var(--fill, 0%),
        var(--bg-input) 100%
    );
}

.ref-slider::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--bg-input);
}

.ref-slider::-moz-range-progress {
    height: 4px;
    border-radius: 2px 0 0 2px;
    background: var(--track-fill);
}

.ref-slider:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ref-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -7px; /* центрировать по треку */
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    transition: transform 0.1s;
}

.ref-slider:not(:disabled)::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.ref-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    transition: transform 0.1s;
}

.ref-slider-green  { --track-fill: #4ade80; }
.ref-slider-purple { --track-fill: #c084fc; }
.ref-slider-cyan   { --track-fill: #22d3ee; }

.ref-slider-green::-webkit-slider-thumb  { background: #4ade80; }
.ref-slider-green::-moz-range-thumb      { background: #4ade80; }
.ref-slider-purple::-webkit-slider-thumb { background: #c084fc; }
.ref-slider-purple::-moz-range-thumb     { background: #c084fc; }
.ref-slider-cyan::-webkit-slider-thumb   { background: #22d3ee; }
.ref-slider-cyan::-moz-range-thumb       { background: #22d3ee; }

.ref-slider-hint {
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.ref-cref-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.ref-cref-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    accent-color: #22d3ee;
    cursor: pointer;
}

.remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-btn:hover {
    background: #EF4444;
}

.reference-upload {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
    min-height: 160px;
}

.upload-area > i {
    font-size: 2rem;
    color: var(--accent-primary);
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(249, 115, 22, 0.05);
}

.upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(249, 115, 22, 0.1);
}


.upload-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.6rem;
    justify-content: center;
    margin-top: 0.4rem;
}

.upload-hints span {
    font-size: 0.62rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.hint-formats i { color: #22c55e; }
.hint-size i { color: var(--accent-primary); }

.upload-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.url-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.url-input-wrapper input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.url-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.url-load-btn {
    width: 40px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.url-load-btn:hover {
    opacity: 0.9;
}

/* Tools Row */
.tools-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.tool-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* Inline size controls in tools-row */
.inline-size-controls {
    display: flex;
    gap: 0.25rem;
}

.inline-size-controls .size-type-btn {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.inline-size-controls .size-type-btn i {
    font-size: 0.8rem;
}

/* Inline mode controls in tools-row */
.inline-mode-controls {
    display: flex;
    gap: 0.25rem;
}

.inline-mode-controls .mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover:not(.locked) {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.tool-btn.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.tool-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.lock-icon {
    font-size: 0.7rem;
    color: #F59E0B;
}
.setting-block .lock-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
}
/* Setting Block */
.setting-block {
    margin-bottom: 0.75rem;
}

.setting-block label {
    display: flex;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.setting-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
/* Prompt */
.prompt-wrapper {
    display: flex;
    gap: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    transition: border-color 0.2s;
}

.prompt-wrapper:focus-within {
    border-color: var(--accent-primary);
}

.prompt-input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.prompt-wrapper textarea {
    flex: 1;
    min-height: 50px;
    max-height: 120px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    width: 100%;
}

.prompt-wrapper textarea:focus {
    outline: none;
}

.prompt-wrapper textarea::placeholder {
    color: var(--text-muted);
}

/* Bottom row inside prompt: ref button + footer */
.prompt-bottom-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.25rem;
}

/* Reference attach button inside prompt */
.ref-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ref-attach-btn:hover:not(.locked) {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.ref-attach-btn.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.ref-attach-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.ref-attach-btn .lock-icon {
    font-size: 0.5rem;
    color: #F59E0B;
}

.prompt-footer-inline {
    display: flex;
    justify-content: space-between;
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.generate-btn {
    display: flex;
    align-items: center;
    align-self: flex-end;
    gap: 0.5rem;
    padding: 0.55rem 1.5rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.generate-btn:hover:not(:disabled) {
    color: white;
    opacity: 0.9;
    transform: translateY(-1px);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.generate-btn.loading i {
    animation: spin 1s linear infinite;
}
/* Video Result Item in gallery */
.video-result {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.video-quality-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 0.15rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 2;
    letter-spacing: 0.5px;
}

.video-quality-badge.badge-sd {
    background: rgba(34, 197, 94, 0.85);
    color: #fff;
}

.video-quality-badge.badge-hd {
    background: rgba(168, 85, 247, 0.9);
    color: #fff;
}

.video-result:hover {
    border-color: var(--accent-primary);
}

.video-result video {
    width: 100%;
    display: block;
}

.video-result-actions {
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.video-action-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
}

.video-action-btn:hover {
    opacity: 0.8;
}

/* ==================== INLINE SETTINGS (moved from panel) ==================== */

.size-type-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.size-type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.size-type-btn i {
    font-size: 1rem;
}

.size-type-btn:hover {
    border-color: var(--accent-primary);
}

.size-type-btn.active {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}

.ratio-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ratio-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ratio-btn:hover {
    border-color: var(--accent-primary);
}

.ratio-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}


/* Mode Buttons */
.mode-buttons {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    flex: 1;
    padding: 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: var(--accent-primary);
}

.mode-btn.active[data-mode="fast"], .mode-btn.fast-mode.active{
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.mode-btn.active[data-mode="relax"], .mode-btn.relax-mode.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}


/* Quality Buttons */
.quality-buttons {
    display: flex;
    gap: 0.4rem;
}

.quality-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-align: left;
}

.quality-btn:hover:not(.locked) {
    background: var(--bg-input);
    border-color: rgba(255, 255, 255, 0.2);
}

.quality-btn.active[data-quality="sd"] {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.quality-btn.active[data-quality="sd"] .quality-icon {
    background: linear-gradient(135deg, #22C55E, #14B8A6);
}

.quality-btn.active[data-quality="hd"] {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.quality-btn.active[data-quality="hd"] .quality-icon {
    background: linear-gradient(135deg, #A855F7, #EC4899);
}

.quality-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quality Icon Badge */
.quality-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    transition: all 0.2s;
}

.quality-icon.hd {
    background: rgba(168, 85, 247, 0.2);
}

.quality-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* Quality Info */
.quality-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}

.quality-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.quality-res {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Batch Buttons */
.batch-buttons {
    display: flex;
    gap: 0.5rem;
}

.batch-btn {
    flex: 1;
    padding: 0.55rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.batch-btn:hover:not(.locked) {
    background: var(--bg-input);
    border-color: var(--accent-primary);
}

.batch-btn.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}

.batch-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle Button */
.toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: var(--bg-input);
}

.toggle-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-indigo);
}

.toggle-label {
    font-size: 0.9rem;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 11px;
    position: relative;
    transition: all 0.2s;
}

.toggle-btn.active .toggle-switch {
    background: var(--accent-indigo);
}

.toggle-knob {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
}

.toggle-btn.active .toggle-knob {
    left: 20px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.progress-wrapper .progress-track {
    flex: 1;
    height: 8px;
}

.progress-wrapper span {
    font-size: 0.85rem;
    color: var(--accent-primary);
    min-width: 40px;
}

/* ==================== UTILITIES ==================== */
.hidden {
    display: none !important;
}

/* ==================== RESPONSIVE - TABLET ==================== */
@media (max-width: 1024px) {
    .inline-size-controls,
    .inline-mode-controls {
        gap: 0.35rem;
    }

    .inline-size-controls .size-type-btn span,
    .inline-mode-controls .mode-btn span {
        display: none;
    }

    .gallery-section {
        padding: 1rem;
    }

    .generation-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

/* ==================== RESPONSIVE - MOBILE ==================== */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: 0;
        bottom: 0;
        top: 0;
        width: 290px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background-color: var(--bg-sidebar);
        padding-left: 1rem;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
        top: 0;
    }

    /* Content Header Mobile */
    .content-header {
        padding: 0.75rem 0;
    }

    .current-category {
        font-size: 1rem;
        justify-content: center;
    }

    /* Gallery */
    .gallery-section {
        padding: 0.75rem 0;
    }

    .gallery-empty {
        padding: 2.5rem 1.5rem;
    }

    .gallery-empty i {
        font-size: 2.5rem;
    }

    .gallery-empty p {
        font-size: 0.9rem;
    }

    .video-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .generation-block {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .generation-header, .video-gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .generation-prompt, .video-gallery-prompt {
        font-size: 0.8rem;
    }
    .video-gallery-card {
        padding: 0.75rem;
        border-radius: 12px;
    }
    .generation-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .card-action-btn {
        width: 28px;
        height: 28px;
    }

    /* Show card overlay always on touch devices */
    .gen-image-card .card-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 40%);
    }

    /* Input Section */
    .input-section {
        padding: 0.75rem 0;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .reference-panel {
        margin-bottom: 0.75rem;
    }

    .reference-layout {
        flex-direction: row;
        align-items: stretch;
        gap: 0.75rem;
    }

    .reference-image-side {
        flex: 0 0 140px;
        min-height: 140px;
    }

    .reference-preview img {
        max-height: 140px;
        object-fit: contain;
    }

    .upload-area {
        min-height: 140px;
        padding: 0.75rem 0.5rem;
    }

    .tools-row {
        margin-bottom: 0.75rem;
        gap: 0.35rem;
    }

    .tool-divider {
        display: none;
    }

    .inline-size-controls .size-type-btn {
        padding: 0.4rem 0.5rem;
    }

    .inline-size-controls .size-type-btn span {
        display: none;
    }

    .inline-mode-controls .mode-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }

    .inline-mode-controls .mode-btn span {
        display: none;
    }

    .ratio-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }

    .prompt-wrapper {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.6rem;
    }

    .prompt-wrapper textarea {
        min-height: 50px;
        font-size: 0.9rem;
    }

    .ref-attach-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .generate-btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem;
        border-radius: 20px;
        align-self: stretch;
    }

    /* Upscale */
    .upscale-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.35rem;
    }

    .upscale-btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    /* Toast on mobile */
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .toast {
        width: 100%;
    }

    /* Lightbox mobile */
    .img-lightbox-inner, .video-lightbox-inner {
        padding: 50px 10px;
    }

    .img-lightbox-prev,
    .img-lightbox-next,
    .video-lightbox-prev,
    .video-lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .img-lightbox-prev, .video-lightbox-prev { left: 5px; }
    .img-lightbox-next, .video-lightbox-next { right: 5px; }

    .img-lightbox-actions, .video-lightbox-actions {
        top: 10px;
        gap: 8px;
    }

    .img-lightbox-btn, .video-lightbox-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .img-lightbox-thumb {
        width: 40px;
        height: 40px;
    }

    .img-lightbox-counter {
        bottom: 70px;
    }
}

/* ==================== RESPONSIVE - SMALL MOBILE ==================== */
@media (max-width: 480px) {
    .generation-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .tools-row {
        gap: 0.25rem;
    }

    .ratio-btn {
        padding: 0.35rem 0.4rem;
        font-size: 0.65rem;
    }
    .batch-buttons {
        gap: 0.4rem;
    }

    .batch-btn {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    .prompt-footer-inline #prompt-hint {
        display: none;
    }
}

/* ==================== RESPONSIVE - EXTRA SMALL ==================== */
@media (max-width: 360px) {
    .inline-size-controls .size-type-btn {
        padding: 0.35rem 0.4rem;
    }

    .inline-mode-controls .mode-btn {
        padding: 0.35rem 0.4rem;
        font-size: 0.65rem;
    }

    .prompt-wrapper {
        padding: 0.5rem;
    }

    .prompt-wrapper textarea {
        min-height: 40px;
        font-size: 0.85rem;
    }

    .upload-area {
        padding: 1rem;
    }

    .upload-area i {
        font-size: 1.5rem;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .app-layout {
        height: -webkit-fill-available;
    }
}


/* ==================== MULTI-COLOR BADGES ==================== */

/* Base badge style */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

/* Orange (Primary) */
.badge-orange,
.badge-primary {
    background: rgba(249, 115, 22, 0.2);
    color: #FB923C;
}

/* Purple */
.badge-purple {
    background: rgba(168, 85, 247, 0.2);
    color: #C084FC;
}

/* Blue */
.badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

/* Cyan */
.badge-cyan {
    background: rgba(6, 182, 212, 0.2);
    color: #22D3EE;
}

/* Pink */
.badge-pink {
    background: rgba(236, 72, 153, 0.2);
    color: #F472B6;
}

/* Indigo */
.badge-indigo {
    background: rgba(99, 102, 241, 0.2);
    color: #818CF8;
}

/* Green */
.badge-green {
    background: rgba(34, 197, 94, 0.2);
    color: #4ADE80;
}

/* Yellow */
.badge-yellow {
    background: rgba(234, 179, 8, 0.2);
    color: #FACC15;
}

/* Teal */
.badge-teal {
    background: rgba(20, 184, 166, 0.2);
    color: #2DD4BF;
}

/* ==================== MODE BADGES (Fast/Relax/Turbo) ==================== */

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.mode-badge-fast {
    background: rgba(168, 85, 247, 0.2);
    color: #C084FC;
}

.mode-badge-relax {
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

.mode-badge-turbo {
    background: rgba(249, 115, 22, 0.2);
    color: #FB923C;
}

/* ==================== QUALITY BADGES (SD/HD) ==================== */

.quality-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.quality-badge-sd {
    background: rgba(34, 197, 94, 0.2);
    color: #4ADE80;
}

.quality-badge-hd {
    background: rgba(249, 115, 22, 0.2);
    color: #FB923C;
}

/* ==================== FEATURE TAGS ==================== */

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.feature-tag-purple {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #C084FC;
}

.feature-tag-blue {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60A5FA;
}

.feature-tag-orange {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.3);
    color: #FB923C;
}

.feature-tag-green {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ADE80;
}

.feature-tag-pink {
    background: rgba(236, 72, 153, 0.15);
    border-color: rgba(236, 72, 153, 0.3);
    color: #F472B6;
}

.feature-tag-cyan {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.3);
    color: #22D3EE;
}

.feature-tag-yellow {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.3);
    color: #FACC15;
}

.feature-tag-indigo {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #818CF8;
}

/* Hover effect for feature tags */
.feature-tag:hover {
    transform: translateY(-1px);
}

/* ==================== IMAGE LIGHTBOX POPUP ==================== */

.img-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.img-lightbox.active {
    display: flex !important;
}

.img-lightbox-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

.img-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.img-lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.img-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.img-lightbox-prev,
.img-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.img-lightbox-prev { left: 15px; }
.img-lightbox-next { right: 15px; }

.img-lightbox-prev:hover,
.img-lightbox-next:hover {
    background: var(--accent-primary);
}

.img-lightbox-thumbs {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.6);
    border-radius: 10px;
}

.img-lightbox-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.img-lightbox-thumb:hover { opacity: 0.8; }
.img-lightbox-thumb.active {
    opacity: 1;
    border-color: var(--accent-primary);
}

.img-lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-lightbox-actions {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

.img-lightbox-btn {
    padding: 8px 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s;
}

.img-lightbox-btn:hover { transform: scale(1.05); }

.img-lightbox-btn.secondary {
    background: rgba(255,255,255,0.15);
}

.img-lightbox-counter {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: rgba(0,0,0,0.6);
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
}
/* ==================== VIDEO LIGHTBOX ==================== */

.video-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-lightbox.active {
    display: flex;
}

.video-lightbox-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

.video-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.video-lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.video-lightbox-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.video-lightbox-prev,
.video-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.video-lightbox-prev { left: 15px; }
.video-lightbox-next { right: 15px; }

.video-lightbox-prev:hover,
.video-lightbox-next:hover {
    background: var(--accent-primary);
}

.video-lightbox-actions {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

.video-lightbox-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: transform 0.2s;
}

.video-lightbox-btn:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.25);
}

.video-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: rgba(0,0,0,0.6);
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
}
@media (max-width: 768px) {
    /* Lightbox mobile */
    .video-lightbox-inner {
        padding: 50px 10px;
    }

    .video-lightbox-prev,
    .video-lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .video-lightbox-prev { left: 5px; }
    .video-lightbox-next { right: 5px; }

    .video-lightbox-actions {
        top: 10px;
        gap: 8px;
    }

    .video-lightbox-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}