/* Elloia - Shared Styles (white background, black + dark red) */

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

body {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #1a1a1a;
    padding: 0;
    margin: 0;
}

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

h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a1a1a;
}

h1.center {
    text-align: center;
    margin-bottom: 12px;
}

.subtitle {
    color: #4a4a4a;
    font-size: 1.05rem;
    line-height: 1.5;
}

.subtitle.center {
    text-align: center;
    margin-bottom: 44px;
}

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 32px;
    margin-bottom: 28px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.card h2 {
    color: #8B1538;
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: #8B1538;
    border-radius: 2px;
}

/* Navigation */
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nav a {
    color: #1a1a1a;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 12px;
    background: #f5f5f5;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-block;
    transition: all 0.2s;
}

.nav a:hover {
    background: rgba(139, 21, 56, 0.08);
    border-color: #8B1538;
    color: #8B1538;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row.form-row-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.form-row.form-row-5 {
    grid-template-columns: repeat(5, 1fr);
}

.form-group-quarter {
    margin-bottom: 20px;
}

@media (max-width: 1000px) {
    .form-row.form-row-5 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .form-row.form-row-4 {
        grid-template-columns: 1fr 1fr;
    }
    .form-row.form-row-5 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row.form-row-4,
    .form-row.form-row-5 {
        grid-template-columns: 1fr;
    }
}

.form-group-inline {
    margin-bottom: 20px;
}

.form-group-half {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-weight: 500;
}

input[type="text"],
input[type="number"] {
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: #ffffff;
    color: #1a1a1a;
    transition: border-color 0.2s;
}

input[type="text"] {
    width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #8B1538;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: #6a6a6a;
}

.input-number {
    width: 80px;
    padding: 10px 14px;
}

/* Temperature slider styles */
.temperature-slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.temperature-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.temperature-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8B1538;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, transform 0.1s;
}

.temperature-slider::-webkit-slider-thumb:hover {
    background: #a01842;
    transform: scale(1.1);
}

.temperature-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8B1538;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, transform 0.1s;
}

.temperature-slider::-moz-range-thumb:hover {
    background: #a01842;
    transform: scale(1.1);
}

.temperature-slider:focus {
    outline: none;
}

.temperature-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.2);
}

.temperature-slider:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.2);
}

.temperature-value-display {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    padding: 4px 0;
}

.temperature-value-display span {
    min-width: 40px;
    text-align: center;
}

select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: #ffffff;
    color: #1a1a1a;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:focus {
    outline: none;
    border-color: #8B1538;
}

select option {
    background: #ffffff;
    color: #1a1a1a;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #8B1538;
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.12);
}

textarea::placeholder {
    color: #6a6a6a;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #1a1a1a;
}

.checkbox-label input {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: #8B1538;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
}

.btn:hover:not(:disabled) {
    background: #6B0F2A;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 21, 56, 0.3);
}

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

.btn-full-width {
    width: 100%;
}

.btn-primary {
    background: #8B1538;
}

.btn-primary:hover {
    background: #6B0F2A;
}

.btn-secondary {
    background: rgba(139, 21, 56, 0.15);
    color: #8B1538;
}

.btn-secondary:hover {
    background: rgba(139, 21, 56, 0.25);
    color: #6B0F2A;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #f5f5f5;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #4a4a4a;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.04);
}

.mode-btn.active {
    background: rgba(139, 21, 56, 0.12);
    color: #8B1538;
}

/* Option toggles (model, prompt style – same look as mode toggle) */
.option-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #f5f5f5;
}

.option-toggle .option-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #4a4a4a;
    cursor: pointer;
    transition: all 0.2s;
}

.option-toggle .option-btn:hover {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.04);
}

.option-toggle .option-btn.active {
    background: rgba(139, 21, 56, 0.12);
    color: #8B1538;
}

.select-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #8B1538;
    background: rgba(139, 21, 56, 0.06);
}

.drop-zone p {
    color: #4a4a4a;
    margin-bottom: 8px;
}

.drop-zone small {
    color: #6a6a6a;
    font-size: 0.9rem;
}

/* Reference Images */
.reference-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.reference-images.empty {
    display: none;
}

.reference-image-item {
    position: relative;
    width: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reference-image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
}

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

.reference-image-filename-row {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin-top: 4px;
    min-height: 0;
}

.reference-image-filename {
    flex: 1;
    min-width: 0;
    font-size: 0.7rem;
    color: #555;
    word-break: break-all;
    white-space: normal;
    line-height: 1.25;
    max-width: 100%;
}

.reference-image-item .add-to-prompt-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: rgba(139, 21, 56, 0.15);
    color: #8B1538;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.reference-image-item .add-to-prompt-btn:hover {
    background: rgba(139, 21, 56, 0.3);
}

.reference-image-preview .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #8B1538;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.reference-image-preview .remove-btn:hover {
    opacity: 1;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: #8B1538;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

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

/* Result Sections */
.result-section {
    display: none;
}

.result-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.result-content {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #1a1a1a;
}

.result-content.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #4a4a4a;
    min-height: 100px;
}

.result-content.loading .spinner {
    display: block;
}

/* Generated Images */
.generated-image {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.generated-image img {
    max-width: 100%;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: opacity 0.2s;
}

.generated-image img:hover {
    opacity: 0.9;
}

/* Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox-overlay.open {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #8B1538;
    color: #fff;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1;
}

.lightbox-close:hover {
    background: #6B0F2A;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    margin-left: auto;
}

.status-badge.pending {
    background: rgba(249, 168, 37, 0.2);
    color: #b8860b;
}

.status-badge.success {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.status-badge.error {
    background: rgba(139, 21, 56, 0.15);
    color: #8B1538;
}

/* Error Messages */
.error {
    background: rgba(139, 21, 56, 0.08);
    border: 1px solid rgba(139, 21, 56, 0.3);
    color: #8B1538;
    padding: 15px 20px;
    border-radius: 12px;
}

.error-box {
    background: rgba(139, 21, 56, 0.08);
    border: 1px solid rgba(139, 21, 56, 0.3);
    border-radius: 16px;
    padding: 24px;
    color: #8B1538;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.navigation-buttons .btn-primary,
.navigation-buttons .btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s;
}

.navigation-buttons .btn-secondary {
    color: #8B1538;
}

/* Header Row */
.header-row {
    display: flex;
    align-items: center;
}

.header {
    text-align: center;
    margin-bottom: 44px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #4a4a4a;
    font-size: 1.1rem;
}

.empty-state p {
    margin-bottom: 16px;
}

.empty-state a {
    color: #8B1538;
    text-decoration: none;
    font-weight: 500;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Links */
a {
    color: #8B1538;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Full-width content when sidebar is hidden – no empty space */
/* Override Tabler's sidebar spacing completely */
:root {
    --tblr-sidebar-width: 0 !important;
}

.page {
    padding-left: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
}

.page .page-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

.page .page-body {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.page .page-body > .container-xl,
.page .page-body > .container-fluid,
.page .page-body > div[class*="container"] {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

/* Ensure navbar container is also full width */
.navbar .container-xl {
    max-width: 100% !important;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Top navbar: "Elloia" on the right – heavy bold, bigger, dark red */
.navbar-brand-right {
    font-weight: 900 !important;
    font-size: 2.7rem !important;
    color: #8B1538 !important;
    text-decoration: none !important;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.navbar-brand-right:hover {
    color: #6B0F2A !important;
}

/* Top navbar (when sidebar is hidden) */
.navbar .navbar-nav .nav-link.active {
    color: #8B1538 !important;
    font-weight: 600;
}

.navbar .navbar-nav .nav-link:hover {
    color: #8B1538 !important;
}

/* User menu: credits + email on one line, credits left of email */
.navbar .user-menu-line {
    display: inline-flex !important;
    align-items: center !important;
}
.navbar .credits-badge-link {
    display: inline-block !important;
    padding: 0.3em 0.7em !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    background: #f5f5f5 !important;
    background-color: #f5f5f5 !important;
    color: #1a1a1a !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: none !important;
    transition: background-color 0.2s, border-color 0.2s !important;
    text-decoration: none !important;
    cursor: pointer !important;
}
.navbar .credits-badge-link:hover {
    background: #e8e8e8 !important;
    background-color: #e8e8e8 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #1a1a1a !important;
    text-decoration: none !important;
}
.navbar .user-menu-inner {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}
.navbar .user-menu-inner .user-email {
    display: inline !important;
}
.navbar .user-menu-inner .user-email {
    display: inline !important;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 12px;
    }
}
