/* PhotoGenPrompt - V2: LEXICA.ART INSPIRED THEME (Consolidated) */
:root {
    /* Backgrounds: Deep Dark "Void" */
    --bg-page: radial-gradient(circle at top center, #0a1128 0%, #000000 100%);
    --bg-card: #151515;
    --bg-input: #1e1e1e;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a1a1a1;
    --text-placeholder: #525252;

    /* UI Borders & Accents */
    --border-subtle: #2a2a2a;
    --border-active: #ffffff;
    --accent-glow: 0 0 15px rgba(255, 255, 255, 0.1);

    /* Layout */
    --card-radius: 16px;
    --input-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-page);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem;
}

.app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   HEADER & NAVIGATION (Lexica Style)
   ========================================= */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

/* Base Auth Wrapper (Shared) */
.auth-wrapper {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.lang-switcher {
    display: flex;
    gap: 4px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-profile.hidden {
    display: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    border: 1.5px solid var(--accent-color);
    background: #222;
    object-fit: cover;
    display: block;
}

.btn-primary-small {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary-small.hidden {
    display: none;
}

.btn-primary-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn-icon-small {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 600px) {
    .auth-wrapper {
        position: relative;
        top: auto;
        right: auto;
        margin: 1rem auto;
        width: fit-content;
    }
}

.logo {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
}

.logo .icon {
    margin-right: 12px;
}

.app-logo-icon {
    height: 72px;
    width: auto;
    filter: invert(1);
    /* Makes black SVG white */
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.optic-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: #3b82f6;
    letter-spacing: -1.5px;
}

.prompt-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    color: #f97316;
    letter-spacing: -0.5px;
}

.logo:hover .app-logo-icon {
    transform: rotate(5deg) scale(1.1);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.tabs-nav {
    display: inline-flex;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 999px;
    margin-bottom: 3rem;
    border: 1px solid var(--border-subtle);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: #333;
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* =========================================
   CONTENT & INPUTS (Lexica Style)
   ========================================= */
.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    margin-top: 1rem;
    padding-left: 5px;
}

.controls-grid,
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    padding-bottom: 2rem;
}

.control-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 8px;
}

input,
select,
textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 14px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    border-radius: var(--input-radius);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    /* Modern look for selects */
}

input::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #555;
    background: #1a1a1a;
}

input:focus,
select:focus,
textarea:focus {
    background: #1c1c1c;
    border-color: #666;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Select Arrow Customization */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '↓';
    font-size: 0.8rem;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: transform 0.2s;
}

.select-wrapper:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
    color: var(--text-primary);
}

/* Image Upload */
.file-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2rem;
    background: var(--bg-card);
    border: 2px dashed var(--border-subtle);
    border-radius: var(--card-radius);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.file-upload-label:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: #1a1a1a;
}

.file-input {
    display: none;
}

.extracted-colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-subtle);
}

.extracted-swatch {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.extracted-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.hidden {
    display: none !important;
}

/* =========================================
   FOOTER / RESULTS (V1 REPLICATION)
   ========================================= */
.result-section {
    position: relative;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    background: transparent;
    box-shadow: none;
    z-index: 1;
    display: block;
}

.output-group {
    margin-bottom: 2rem;
    position: relative;
    width: 100%;
}

.label-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.label-header label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-box {
    width: 100%;
    display: block;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-subtle);
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 1.5rem;
    border-radius: 12px;
    min-height: 120px;
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    /* Fix: Wrap long lines */
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
}

.prompt-box:focus {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.prompt-box.json-view {
    font-size: 0.85rem;
    color: #94a3b8;
    background: rgba(20, 20, 20, 0.7);
    min-height: 200px;
}

.btn-copy,
#clear-colors-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn-copy:hover,
#clear-colors-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-copy.copy-success {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.btn-copy:active {
    transform: scale(0.95);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* =========================================
   PRESETS MODAL
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 500px;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.save-preset-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.input-preset-name {
    flex-grow: 1;
}

.btn-primary {
    background: #e2e8f0;
    color: #0f172a;
    border: none;
    padding: 0 16px;
    font-weight: 600;
    border-radius: var(--input-radius);
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-text {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-text:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.presets-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.preset-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-subtle);
}

.preset-name {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    flex-grow: 1;
}

.preset-actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* =========================================
   HISTORY SIDE PANEL
   ========================================= */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

.side-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    max-width: 85%;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    right: 0;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-subtle);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    min-height: 24px;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-copy-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
    text-align: center;
}

.history-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.history-preview {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .app-header {
        margin-bottom: 2rem;
        padding-top: 85px;
        /* Increased from 60px for more separation */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
        position: relative;
    }

    .logo {
        font-size: 2.2rem;
        justify-content: center;
        width: 100%;
        order: 1;
        margin: 0;
    }

    .subtitle {
        font-size: 0.9rem;
        padding: 0 1rem;
        display: block;
        text-align: center;
        order: 2;
    }

    .header-actions {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 5px !important;
        order: 3;
        width: 100%;
    }

    .header-actions .btn-text {
        margin: 0 !important;
        /* Reset specific margins */
    }

    .controls-grid,
    .input-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
        text-align: center;
        /* Center labels and inputs by default */
    }

    .control-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        /* Center children in vertical grid */
    }

    label {
        margin-left: 0;
        /* Clear left margin in mobile */
        text-align: center;
        width: 100%;
    }

    .side-panel {
        width: 100%;
        max-width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 0;
    }

    .prompt-box {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .tabs-nav {
        display: flex;
        /* Better for scrollable centering */
        justify-content: flex-start;
        /* Default to start for scrollability */
        margin-bottom: 2rem;
        overflow-x: auto;
        padding: 4px 15px;
        /* Extra padding for edges */
        position: relative;
        left: 0;
        transform: none;
        /* Remove problematic transform */
        width: 100%;
        scrollbar-width: none;
        -ms-overflow-style: none;
        mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
    }

    .tabs-nav::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
    }

    .app-logo-icon {
        height: 40px;
    }

    /* Fixed Positions for Header Actions */
    .custom-lang-selector {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 1001;
        transform: none;
        display: flex;
        align-items: center;
        height: 32px;
        /* Match button height */
    }

    .auth-wrapper {
        position: absolute !important;
        top: 10px !important;
        right: 10px;
        z-index: 1001;
        transform: none;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        display: flex !important;
        align-items: center !important;
        height: 32px !important;
    }

    .header-actions {
        flex-direction: row;
        /* Keep them side by side if they fit, or column if needed */
        flex-wrap: wrap;
        justify-content: center;
    }

    @media (max-width: 360px) {
        .app-header {
            padding-top: 110px;
            /* Increased from 80px for extra space */
        }

        .logo {
            font-size: 1.6rem;
        }
    }

    .lang-selected {
        min-width: 100px;
        padding: 0 10px;
        height: 32px;
        font-size: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        /* Remove border for perfect alignment */
    }

    .btn-primary-small {
        padding: 0 15px;
        height: 32px;
        /* Fixed height for symmetry */
        font-size: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        /* Match lang selector */
    }

    .user-avatar {
        width: 24px;
        height: 24px;
        border-width: 1px;
    }

    .user-profile {
        gap: 6px;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

/* --- PHASE 7: SLIDERS & HELP --- */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
}

.help-icon:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.input-field.slider-type {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-with-val {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-val {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.85rem;
}

.help-modal-body {
    line-height: 1.6;
}

.help-modal-body h4 {
    margin-top: 0;
    color: white;
    font-size: 1.1rem;
}

.help-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.help-example-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    font-size: 0.9rem;
}

.help-example-box code {
    color: var(--accent-color);
    background: transparent;
    padding: 0;
}

/* Auth cleanup (redundant removed) */

/* --- CUSTOM LANGUAGE DROPDOWN --- */
.custom-lang-selector {
    position: absolute;
    top: 15px;
    left: 20px;
    z-index: 999;
}

.lang-selected {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid var(--accent-color);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    min-width: 120px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lang-selected:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: white;
}

.lang-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: #1a1a1a;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    list-style: none;
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: slideDownCustom 0.2s ease-out;
}

.lang-options.show {
    display: flex;
}

.lang-option {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.flag-icon {
    width: 18px;
    height: 12px;
    display: inline-block;
    background-size: cover;
    border-radius: 2px;
    flex-shrink: 0;
    border: 0.5px solid rgba(255, 255, 255, 0.2);
}

.flag-es {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 750 500'%3E%3Cpath fill='%23c10a19' d='M0 0h750v500H0z'/%3E%3Cpath fill='%23ffc400' d='M0 125h750v250H0z'/%3E%3C/svg%3E");
}

.flag-en {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Cpath fill='%23012169' d='M0 0h60v30H0z'/%3E%3Cpath stroke='%23fff' stroke-width='6' d='m0 0 60 30m0-30L0 30'/%3E%3Cpath stroke='%23C8102E' stroke-width='4' d='m0 0 60 30m0-30L0 30'/%3E%3Cpath stroke='%23fff' stroke-width='10' d='M30 0v30M0 15h60'/%3E%3Cpath stroke='%23C8102E' stroke-width='6' d='M30 0v30M0 15h60'/%3E%3C/svg%3E");
}

.chevron {
    margin-left: auto;
    font-size: 0.6rem;
    opacity: 0.6;
}

@keyframes slideDownCustom {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- INFO MODAL STYLES --- */
.info-modal-content {
    max-width: 600px;
}

#info-modal-body h4 {
    color: var(--color-accent);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

#info-modal-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

#info-modal-body ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

#info-modal-body li {
    margin-bottom: 0.5rem;
}

#info-modal-body a {
    color: var(--color-primary);
    text-decoration: none;
}

#info-modal-body a:hover {
    text-decoration: underline;
}

/* --- PROFESSIONAL FOOTER --- */
.app-footer {
    width: 100%;
    max-width: 100vw;
    margin-top: 5rem;
    padding: 3rem 0 2rem;
    background: rgba(21, 21, 21, 0.6);
    border-top: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.footer-logo-icon {
    height: 35px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 350px;
}

.footer-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-list a:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-3px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Footer Mobile Responsiveness */
@media (max-width: 768px) {
    .app-footer {
        margin-top: 3rem;
        padding: 2rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .footer-section {
        text-align: center;
        align-items: center;
    }

    .footer-description {
        max-width: 100%;
    }

    .footer-list {
        align-items: center;
    }

    .footer-list a:hover {
        transform: none;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer-title {
        font-size: 1.3rem;
    }

    .footer-logo-icon {
        height: 28px;
    }

    .footer-description {
        font-size: 0.85rem;
    }

    .footer-subtitle {
        font-size: 0.95rem;
    }

    .footer-list a {
        font-size: 0.85rem;
    }

    .social-link {
        width: 36px;
        height: 36px;
    }

    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

/* --- GUIDE MODAL (Carousel V2 - Elegant & Modern) --- */
.guide-modal-content {
    max-width: 900px !important;
    /* Wider for better layout */
    width: 95%;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #0f111a;
    /* Deeper dark */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.guide-modal-body {
    padding: 0;
    overflow: hidden;
    position: relative;
    height: 550px;
    /* Taller for images */
}

.guide-slides-container {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    /* Smoother */
}

.guide-slide {
    min-width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two columns split */
    box-sizing: border-box;
    overflow: hidden;
    padding: 0;
    /* Remove old padding */
    text-align: left;
    /* Reset alignment */
    align-items: stretch;
}

.slide-visual {
    background-size: cover;
    background-position: center;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.slide-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 70%, #0f111a);
}

.slide-text-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #3b82f6;
    margin-bottom: 15px;
    font-weight: 700;
}

.guide-slide h4 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
}

.guide-slide p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 20px;
    max-width: none;
    margin-left: 0;
}

.guide-modal-footer {
    padding: 24px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.dots-container {
    display: flex;
    gap: 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.4s ease;
}

.dot.active {
    background: #3b82f6;
    width: 30px;
    border-radius: 4px;
}

/* Tip Box Refined */
.tip-box {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-top: 10px;
}

.tip-box strong {
    color: #60a5fa;
    display: block;
    margin-bottom: 4px;
}

#guide-start-btn {
    padding: 14px 30px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

#guide-start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

@media (max-width: 850px) {
    .guide-slide {
        grid-template-columns: 1fr;
    }

    .slide-visual {
        height: 180px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .slide-visual::before {
        background: linear-gradient(to bottom, transparent 60%, #0f111a);
    }

    .guide-modal-body {
        height: 75vh;
        max-height: 750px;
        overflow-y: auto;
        /* Scroll whole body */
        scrollbar-width: thin;
    }

    .guide-slides-container {
        height: auto;
        min-height: 100%;
        align-items: flex-start;
        /* Prevent stretch forcing height */
    }

    .guide-slide {
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    .slide-text-content {
        padding: 30px;
        overflow-y: visible;
        /* Let parent scroll */
        max-height: none;
        display: block;
    }

    .guide-slide h4 {
        font-size: 1.4rem;
    }
}

.logo-white {
    filter: brightness(0) invert(1);
    max-width: 150px;
    margin-bottom: 20px;
}

/* --- OUTPUT ACTIONS VIBRANT (V4) --- */
.label-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.output-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
    align-items: center;
}

.btn-vibrant {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white !important;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    height: 36px;
    line-height: 1;
}

.btn-vibrant:active {
    transform: scale(0.95);
}

.btn-vibrant-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-vibrant-blue:hover {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.btn-vibrant-emerald {
    background: linear-gradient(135deg, #10b981, #047857);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-vibrant-emerald:hover {
    background: linear-gradient(135deg, #34d399, #059669);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-vibrant-gemini {
    background: linear-gradient(135deg, #1d4ed8, #7c3aed, #ec4899);
    background-size: 200% 200%;
    animation: gradientGemini 3s ease infinite;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-vibrant-gemini:hover {
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
    transform: translateY(-2px);
}

.gemini-mini-logo {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    display: block;
    flex-shrink: 0;
}

@keyframes gradientGemini {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- RESET BUTTON --- */
.btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-reset:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.btn-reset:active {
    transform: scale(0.95);
}