/* Recreate-specific styles */

/* Credit Balance Pill */
.credit-balance-pill {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #facc15 0%, #fbbf24 100%);
    color: #1f2937;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4), 
                0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    animation: creditGlow 2s ease-in-out infinite alternate;
}

.credit-balance-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5), 
                0 3px 12px rgba(0, 0, 0, 0.15);
}

@keyframes creditGlow {
    0% {
        box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4), 
                    0 2px 8px rgba(0, 0, 0, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(251, 191, 36, 0.6), 
                    0 2px 12px rgba(0, 0, 0, 0.15);
    }
}

/* Fixed footer positioning for recreate mode */
.recreate-mode .input-bar {
    position: fixed;
    bottom: 0;
    left: 260px; /* Updated to match new sidebar width */
    right: 0;
    z-index: 50;
    margin: 0;
    padding: 0.75rem 1.5rem; /* Reduced from 1.75rem 2rem */
}

/* Adjust chat area to account for fixed footer */
.recreate-mode .chat-area {
    padding-bottom: 250px; /* Reduced back for desktop inline layout */
    height: calc(100vh - 250px);
    overflow-y: auto;
}

/* Desktop layout: New compact two-row layout */
.recreate-mode .input-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0rem 1.5rem;
    align-items: start;
    grid-template-areas: 
        "creativity mode buttons"
        "creativity textarea buttons";
}

.recreate-mode .mode-indicator-section {
    grid-area: mode;
    justify-self: center;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
}

.recreate-mode .creativity-selector-section {
    grid-area: creativity;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recreate-mode .text-input-section {
    grid-area: textarea;
}

.recreate-mode .buttons-section {
    grid-area: buttons;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-self: stretch;
    justify-content: space-between;
}

.recreate-mode .buttons-section .upload-link-section,
.recreate-mode .buttons-section .file-upload-section,
.recreate-mode .buttons-section .generate-section {
    flex: 0 0 auto;
}

/* Creativity Level Selector */
.creativity-selector-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.creativity-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: #FFD700;
    font-weight: 500;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.creativity-info-icon {
    width: 16px;
    height: 16px;
    color: #FFD700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.creativity-info-icon:hover {
    color: #FFA500;
    transform: scale(1.1);
}

.creativity-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: translateX(-50px); /* Offset to avoid sidebar */
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(42, 42, 42, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
    color: #ccc;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    min-width: 280px;
}

.creativity-info-icon:hover .creativity-tooltip,
.creativity-info-icon.active .creativity-tooltip {
    opacity: 1;
    visibility: visible;
    animation: tooltipSlideUp 0.3s ease-out;
}





.creativity-selector {
    display: flex;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 1rem;
    padding: 0.25rem;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(10px);
}

.creativity-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #ccc;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.creativity-tab:hover {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.creativity-tab.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    animation: creativityTabGlow 2s ease-in-out infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.creativity-tab.active:hover {
    animation: none;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.6);
}

@keyframes creativityTabGlow {
    0% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

/* Enhanced file upload, upload link and generate button styling for recreate mode */
.recreate-mode .file-upload-btn,
.recreate-mode .upload-link-btn,
.recreate-mode .generate-btn {
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 1rem;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    min-height: 50px; /* Compact height for desktop */
    min-width: 120px;
    padding: 0.6rem 1rem; /* Tighter padding */
    display: flex;
    flex-direction: row; /* Horizontal layout for compact design */
    align-items: center;
    justify-content: center;
    gap: 0.4rem; /* Smaller gap */
    font-size: 0.85rem; /* Smaller font */
    color: #FFD700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}


.recreate-mode .mode-dropdown {
    position: relative;
    display: inline-block;
}

.recreate-mode .mode-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    min-width: 120px;
    min-height: 50px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 2px solid #FFD700;
    border-radius: 0.75rem;
    color: #FFD700;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    animation: modeGlow 2s ease-in-out infinite alternate;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recreate-mode .mode-dropdown-btn:hover {
    border-color: #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.15) 100%);
}

.recreate-mode .mode-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(42, 42, 42, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
    display: none;
    z-index: 100;
    min-width: 150px;
}

.recreate-mode .mode-dropdown-menu.show {
    display: block;
    animation: dropdownSlideUp 0.3s ease-out;
}

.recreate-mode .mode-option {
    padding: 1rem 1.5rem;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    font-weight: 500;
}

.recreate-mode .mode-option:last-child {
    border-bottom: none;
    border-radius: 0 0 1rem 1rem;
}

.recreate-mode .mode-option:first-child {
    border-radius: 1rem 1rem 0 0;
}

.recreate-mode .mode-option:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    color: #FFD700;
}

.recreate-mode .mode-option.selected {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    color: #FFD700;
    font-weight: 600;
    border-left: 4px solid #FFD700;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.2);
}

@keyframes modeGlow {
    0% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

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

/* Style dropdown styling for recreate mode */
.recreate-mode .style-dropdown {
    position: relative;
    display: inline-block;
}

.recreate-mode .style-dropdown-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    min-height: 50px; /* Compact height for desktop */
    min-width: 120px;
    padding: 0.6rem 1rem; /* Tighter padding */
    color: #FFD700;
    font-weight: 600;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row; /* Horizontal layout for compact design */
    align-items: center;
    justify-content: center;
    gap: 0.4rem; /* Smaller gap */
    font-size: 0.85rem; /* Smaller font */
    text-decoration: none;
}

.recreate-mode .style-dropdown-btn:hover {
    border-color: #FFD700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
}

.recreate-mode .style-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(42, 42, 42, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
    display: none;
    z-index: 100;
}

.recreate-mode .style-dropdown-menu.show {
    display: block;
    animation: dropdownSlideUp 0.3s ease-out;
}

.recreate-mode .style-option {
    padding: 1rem 1.5rem;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    font-weight: 500;
}

.recreate-mode .style-option:last-child {
    border-bottom: none;
    border-radius: 0 0 1rem 1rem;
}

.recreate-mode .style-option:first-child {
    border-radius: 1rem 1rem 0 0;
}

.recreate-mode .style-option:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    color: #FFD700;
}

.recreate-mode .style-option.selected {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    color: #FFD700;
    font-weight: 600;
    border-left: 4px solid #FFD700;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.2);
}

.recreate-mode .file-upload-btn,
.recreate-mode .upload-link-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
}

.recreate-mode .generate-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    animation: recreateButtonGlow 2s ease-in-out infinite alternate;
    color: #1a1a1a;
    font-weight: 800;
    display: inline-flex;
    flex-direction: column; /* second line under main row */
    align-items: center;
}
.recreate-mode .generate-btn .generate-top {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.1;
}


.recreate-mode .file-upload-btn:hover,
.recreate-mode .upload-link-btn:hover {
    border-color: #FFD700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
}

.recreate-mode .generate-btn:hover {
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.5);
    animation: none;
}

/* Second line under the button label showing credit cost */
.recreate-mode .generate-btn .credits-inline {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    color: #1a1a1a;
    opacity: 0.95;
}

/* Enhanced textarea styling for recreate mode */
.recreate-mode .message-textarea {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(42, 42, 42, 0.9) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
    min-height: 90px; /* Back to original height */
    padding: 1rem;
}

.recreate-mode .message-textarea:focus {
    border-color: #FFD700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

/* Special welcome message styling for recreate mode */
.recreate-mode .welcome-message .message-text {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 215, 0, 0.06) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.25);
}

/* Welcome message styling for recreate mode */
.recreate-mode .welcome-main-text {
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 600;
    color: #ffec7e;
    margin-bottom: 0.3rem;
    margin-top: 1rem;
}

.recreate-mode .welcome-sub-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ededca;
    margin-left: 1rem;
    margin-bottom: 0.3rem;
}

/* Recreate-specific animations */
@keyframes recreateButtonGlow {
    0% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    }
}

/* Progress indicator for file upload */
.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 0 0 1rem 1rem;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* File preview styling */
.file-preview {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 0.5rem;
    object-fit: cover;
}

/* Chat image message styling */
.uploaded-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.03) 100%);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 1rem;
    margin: 0.5rem 0;
}

/* User Request Card (recreate theme) */
.user-message .user-request-card {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(42, 42, 42, 0.9) 100%);
    border: 1.5px solid rgba(255, 215, 0, 0.35);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.12), inset 0 0 0 1px rgba(255, 215, 0, 0.12);
}

.user-request-card .request-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.user-request-card .request-title {
    color: #ffec7e;
    font-weight: 800;
    letter-spacing: 0.2px;
    text-align: center;
}

.user-request-card .request-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.user-request-card .badge {
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-gold {
    color: #1a1a1a;
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.badge-slate {
    color: #e5e7eb;
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
}

.badge-cost {
    color: #1a1a1a;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
}

.user-request-card .request-body .row {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.6rem;
    align-items: center; /* center content vertically */
    padding: 0.35rem 0;
    border-top: 1px dashed rgba(255, 215, 0, 0.18);
}

.user-request-card .request-body .row:first-child {
    border-top: 0;
}

.user-request-card .label {
    color: #fcd34d;
    font-size: 0.9rem;
    font-weight: 600;
}

.user-request-card .value {
    color: #f3f4f6;
}

.user-request-card .desc {
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.18);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    line-height: 1.45;
    color: #ededca;
    display: flex;           /* center desc text vertically */
    align-items: center;      /* center desc text vertically */
    min-height: 38px;         /* consistent height for single-line */
    font-size: 0.9rem;        /* slightly smaller text inside box */
    white-space: normal;      /* allow wrapping */
    word-break: break-word;   /* break long words/URLs */
    overflow-wrap: anywhere;  /* wrap anywhere as last resort */
}

/* Generated image action buttons */
.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
}

.redo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4) !important;
}

.uploaded-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 0.75rem;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Generated image responsive sizing (parity with text/edits) */
.generated-result { width: 100%; }
.generated-image-container { max-width: 100%; }
.generated-result .generated-image { display: block; margin: 0 auto; }

/* Landscape 16:9 */
.generated-result.aspect-16-9 .generated-image {
  width: 100%;
  height: auto;
}

/* Portrait 9:16 (tall) */
.generated-result.aspect-9-16 .generated-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
}

/* Square 1:1 */
.generated-result.aspect-1-1 .generated-image {
  width: 70%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Portrait 4:5 */
.generated-result.aspect-4-5 .generated-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* Small screens: relax caps */
@media (max-width: 640px) {
  .generated-result.aspect-16-9 .generated-image { max-width: 100%; }
  .generated-result.aspect-1-1 .generated-image { max-width: 92vw; }
  .generated-result.aspect-9-16 .generated-image { max-height: 65vh; }
  .generated-result.aspect-4-5 .generated-image { max-height: 75vh; }
}

.image-wrapper {
    position: relative;
    display: inline-block;
}

.image-filename {
    font-size: 0.875rem;
    color: #FFD700;
    font-weight: 500;
    text-align: center;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.file-info {
    flex: 1;
    color: #FFD700;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: #ccc;
}

/* Responsive adjustments for recreate mode */
/* Upload from Link Modal - Desktop Styles */
.upload-link-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-link-modal.active {
    opacity: 1;
    visibility: visible;
}

.upload-link-modal-content {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 
                0 0 0 1px rgba(59, 130, 246, 0.3),
                0 0 20px rgba(59, 130, 246, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.upload-link-modal.active .upload-link-modal-content {
    transform: scale(1) translateY(0);
}

.upload-link-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.upload-link-modal-title {
    color: #f1f5f9;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-link-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.upload-link-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.upload-link-input-group {
    margin-bottom: 1.5rem;
}

.upload-link-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #334155;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: #f1f5f9;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.upload-link-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.upload-link-input::placeholder {
    color: #64748b;
}

.upload-link-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.upload-link-fetch-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.upload-link-fetch-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.upload-link-fetch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.upload-link-cancel-btn {
    padding: 0.875rem 1.5rem;
    background: rgba(71, 85, 105, 0.5);
    border: 2px solid #475569;
    border-radius: 12px;
    color: #cbd5e1;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-link-cancel-btn:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: #64748b;
}

.upload-link-preview {
    display: none;
    text-align: center;
    margin-bottom: 1.5rem;
}

.upload-link-preview.show {
    display: block;
}

.upload-link-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

.upload-link-use-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.upload-link-use-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.upload-link-error {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 1rem;
    color: #fca5a5;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.upload-link-error.show {
    display: block;
}

.upload-link-loading {
    display: none;
    text-align: center;
    color: #94a3b8;
    margin: 1rem 0;
}

.upload-link-loading.show {
    display: block;
}

.upload-link-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #334155;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* Generation Modal Overlay */
.generation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.generation-modal.active {
    opacity: 1;
    visibility: visible;
}

.generation-modal-content {
    text-align: center;
    transform: scale(0.8) rotate(-5deg);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90vw;
    padding: 2rem;
}

.generation-modal.active .generation-modal-content {
    transform: scale(1) rotate(0deg);
}

/* Progress Bar Container */
.generation-progress-container {
    width: 100%;
    max-width: 300px;
    margin: 1.5rem auto;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
    position: relative;
    overflow: hidden;
}

/* Progress Bar */
.generation-progress-bar {
    height: 8px;
    background: linear-gradient(90deg, 
        #22c55e 0%, 
        #16a34a 25%, 
        #15803d 50%, 
        #166534 75%, 
        #14532d 100%);
    border-radius: 16px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 
        0 0 10px rgba(34, 197, 94, 0.6),
        0 0 20px rgba(34, 197, 94, 0.4),
        0 0 30px rgba(34, 197, 94, 0.2);
}

/* Glowing effect on progress bar */
.generation-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    border-radius: 16px;
    animation: progressGlow 2s ease-in-out infinite;
}

/* Progress percentage text */
.generation-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #22c55e;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.generation-progress-text.show {
    opacity: 1;
}

/* Progress stages */
.generation-progress-stage {
    position: absolute;
    top: -25px;
    font-size: 0.7rem;
    color: #22c55e;
    font-weight: 500;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.generation-progress-stage.active {
    opacity: 1;
    color: #22c55e;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    font-weight: 600;
}

.generation-progress-stage.completed {
    opacity: 1;
    color: #16a34a;
}

/* Stage positions */
.generation-progress-stage.submitted {
    left: 0%;
}

.generation-progress-stage.pending {
    left: 25%;
}

.generation-progress-stage.processing {
    left: 50%;
}

.generation-progress-stage.completed {
    left: 75%;
}

/* Progress bar animations */
@keyframes progressGlow {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-100%);
    }
    50% {
        opacity: 0.6;
        transform: translateX(100%);
    }
}

/* Progress bar fill animations for different stages */
.generation-progress-bar.submitted {
    width: 25%;
}

.generation-progress-bar.pending {
    width: 50%;
}

.generation-progress-bar.processing {
    width: 75%;
}

.generation-progress-bar.completed {
    width: 100%;
}

/* Animated Loader */
.generation-loader {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.loader-ring {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.loader-ring:nth-child(1) {
    width: 120px;
    height: 120px;
    border-top: 3px solid #FFD700;
    border-right: 3px solid #FFD700;
    animation-duration: 2s;
}

.loader-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    top: 15px;
    left: 15px;
    border-bottom: 3px solid #FFA500;
    border-left: 3px solid #FFA500;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 30px;
    left: 30px;
    border-top: 3px solid #FFD700;
    border-right: 3px solid #FFD700;
    animation-duration: 1s;
}

.loader-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s ease-in-out infinite alternate;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.loader-icon {
    width: 20px;
    height: 20px;
    color: #1a1a1a;
    animation: iconBounce 2s ease-in-out infinite;
}

/* Floating Particles */
.loader-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FFD700;
    border-radius: 50%;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.loader-particle:nth-child(4) {
    top: 10px;
    left: 50%;
    animation-delay: 0s;
}

.loader-particle:nth-child(5) {
    top: 50%;
    right: 10px;
    animation-delay: 0.5s;
}

.loader-particle:nth-child(6) {
    bottom: 10px;
    left: 50%;
    animation-delay: 1s;
}

.loader-particle:nth-child(7) {
    top: 50%;
    left: 10px;
    animation-delay: 1.5s;
}

/* Modal Text */
.generation-message {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s ease-in-out infinite;
}

.generation-subtitle {
    color: #ccc;
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    animation: fadeInOut 2s ease-in-out infinite;
}

/* Queue Details Styling */
.queue-details {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 1rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

/* Queue apology message */
.queue-apology {
    color: #fbbf24;
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 0.75rem;
    font-style: italic;
    text-align: center;
}

.queue-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    text-align: center;
}

.queue-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.queue-label {
    font-size: 0.8rem;
    color: #ccc;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.queue-value {
    font-size: 1rem;
    color: #FFD700;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Pulsing Dots */
.loading-dots {
    display: inline-block;
    margin-left: 0.5rem;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFD700;
    margin: 0 2px;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }
    100% { 
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
    }
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translateY(-20px) scale(1.2);
        opacity: 0.7;
    }
}

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

@keyframes fadeInOut {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Download Modal Styles - Different from Generation Modal */
.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.download-modal.active {
    opacity: 1;
    visibility: visible;
}

.download-modal-content {
    text-align: center;
    transform: scale(0.7) translateY(30px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90vw;
    padding: 2rem;
}

.download-modal.active .download-modal-content {
    transform: scale(1) translateY(0);
}

/* Pulsing Ring Loader */
.download-loader {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #10b981;
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring:nth-child(1) {
    animation-delay: 0s;
}

.pulse-ring:nth-child(2) {
    animation-delay: 0.4s;
}

.pulse-ring:nth-child(3) {
    animation-delay: 0.8s;
}

.download-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: downloadIconBounce 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.download-icon svg {
    width: 18px;
    height: 18px;
}

/* Download Modal Text */
.download-message {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #10b981 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: downloadShimmer 2.5s ease-in-out infinite;
}

.download-subtitle {
    color: #d1d5db;
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
    animation: downloadFadeInOut 2s ease-in-out infinite;
}

/* Download Dots Animation */
.download-dots {
    display: inline-block;
    margin-left: 0.5rem;
}

.download-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    margin: 0 2px;
    animation: downloadDotPulse 1.2s ease-in-out infinite both;
}

.download-dots span:nth-child(1) { animation-delay: -0.24s; }
.download-dots span:nth-child(2) { animation-delay: -0.12s; }
.download-dots span:nth-child(3) { animation-delay: 0s; }

/* Download Modal Animations */
@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

@keyframes downloadIconBounce {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
    }
}

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

@keyframes downloadFadeInOut {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

@keyframes downloadDotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Unauthenticated Generate Modal Styles */
.unauth-generate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.unauth-generate-modal.active {
    opacity: 1;
    visibility: visible;
}

.unauth-generate-modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(42, 42, 42, 0.98) 100%);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.18), 0 0 60px rgba(255, 215, 0, 0.08);
    max-width: 460px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.unauth-generate-modal.active .unauth-generate-modal-content {
    transform: translateY(0) scale(1);
}

.unauth-generate-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 20px 20px 0 20px;
}

.unauth-generate-modal-close {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #FFD700;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}

.unauth-generate-modal-close:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #1a1a1a;
    transform: scale(1.1);
}

.unauth-generate-modal-body {
    padding: 0 30px 30px 30px;
    text-align: center;
}

.unauth-generate-modal-icon {
    margin: 0 auto 20px auto;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.unauth-generate-modal-title {
    color: #FFD700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.unauth-generate-modal-message {
    color: #e5e7eb;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 30px 0;
    opacity: 0.9;
}

.unauth-generate-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.unauth-generate-modal-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.unauth-generate-modal-login {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.35);
}

.unauth-generate-modal-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
    color: #1a1a1a;
}

.unauth-generate-modal-signup {
    background: transparent;
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.15);
}

.unauth-generate-modal-signup:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.25);
    color: #FFD700;
}

/* Plan Upgrade modal specific overrides (id-targeted) */
#planUpgradeModal.unauth-generate-modal {
    background: rgba(0, 0, 0, 0.85);
}

#planUpgradeModal .unauth-generate-modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(42, 42, 42, 0.98) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.22), 0 0 60px rgba(255, 215, 0, 0.12);
}

#planUpgradeModal .unauth-generate-modal-title {
    color: #FFD700;
}

#planUpgradeModal .unauth-generate-modal-message {
    color: #e5e7eb;
}

#planUpgradeModal .unauth-generate-modal-login,
#planUpgradeModal .unauth-generate-modal-signup {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    border-color: rgba(255, 215, 0, 0.35);
}

#planUpgradeModal .unauth-generate-modal-login:hover,
#planUpgradeModal .unauth-generate-modal-signup:hover {
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
}

/* Validation Loading Overlay */
.validation-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.validation-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.validation-loading-content {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(42, 42, 42, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.35);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.18), 0 0 60px rgba(255, 215, 0, 0.08);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    max-width: 320px;
    width: 90%;
}

.validation-loading-overlay.active .validation-loading-content {
    transform: scale(1);
}

.validation-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.validation-spinner {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: validationSpin 2s linear infinite;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.45), 0 0 50px rgba(255, 215, 0, 0.25);
}

.validation-spinner svg {
    width: 20px;
    height: 20px;
    color: #1f2937;
    animation: validationPulse 1.5s ease-in-out infinite;
}

.validation-message {
    font-size: 18px;
    font-weight: 600;
    color: #FFD700;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.validation-submessage {
    font-size: 14px;
    color: #e5e7eb;
    margin: 0;
    opacity: 0.9;
}

@keyframes validationSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* Mobile responsive styles for unauth modal */
@media (max-width: 768px) {
    .unauth-generate-modal-content {
        max-width: 350px;
        margin: 20px;
    }
    
    .unauth-generate-modal-body {
        padding: 0 20px 25px 20px;
    }
    
    .unauth-generate-modal-title {
        font-size: 20px;
    }
    
    .unauth-generate-modal-message {
        font-size: 15px;
    }
    
    .unauth-generate-modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .unauth-generate-modal-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .unauth-generate-modal-content {
        max-width: 90%;
        border-radius: 16px;
    }

    .user-request-card .request-body .row {
        grid-template-columns: 1fr;
    }
    
    .unauth-generate-modal-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }
    
    .unauth-generate-modal-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .unauth-generate-modal-title {
        font-size: 18px;
    }
    
    .unauth-generate-modal-message {
        font-size: 14px;
        margin-bottom: 24px;
    }
}

@media (max-width: 1024px) {
    .recreate-mode .input-bar {
        left: 260px; /* Account for sidebar being open on tablet - sidebar is 260px wide */
        right: 0; /* Constrain the width */
        width: calc(100vw - 260px); /* Explicitly set width to available space */
        padding: 1rem;
    }
    
    .recreate-mode .chat-area {
        padding-bottom: 400px; /* Increased for tablet layout */
        height: calc(100vh - 400px);
    }
    
    /* Mobile layout: creativity/mode on top row, textarea full width, buttons side by side */
    .recreate-mode .input-container {
        display: grid;
        grid-template-rows: auto auto auto;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        grid-template-areas:
            "creativity mode"
            "textarea textarea"
            "buttons buttons";
    }
    
    .recreate-mode .creativity-selector-section {
        grid-area: creativity;
    }
    
    .recreate-mode .mode-indicator-section {
        grid-area: mode;
        align-self: start;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .recreate-mode .text-input-section {
        grid-area: textarea;
    }
    
    .recreate-mode .buttons-section {
        grid-area: buttons;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.75rem;
    }
    
    .recreate-mode .upload-link-section {
        grid-column: 1;
    }
    
    .recreate-mode .file-upload-section {
        grid-column: 2;
    }
    
    .recreate-mode .generate-section {
        grid-column: 3;
    }
    
    /* Make buttons responsive and horizontal */
    .recreate-mode .file-upload-btn,
    .recreate-mode .upload-link-btn,
    .recreate-mode .generate-btn {
        width: 100% !important;
        min-width: auto !important;
        min-height: 70px;
        flex-direction: row;
        padding: 0.75rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    /* Keep credits second line visible even on tablet: override row layout for generate button only */
    .recreate-mode .generate-btn {
        flex-direction: column !important;
    }

    .recreate-mode .mode-indicator-section .style-dropdown-btn {
        width: 100%;
        min-width: auto;
        min-height: 60px;
        flex-direction: row;
        padding: 0.75rem;
        font-size: 0.875rem;
        gap: 0.5rem;
    }
    
    /* Compact textarea for tablet */
    .recreate-mode .message-textarea {
        min-height: 80px;
        padding: 1rem;
        font-size: 0.875rem;
        min-width: 200px;
    }
    
    /* Adjust creativity tabs for tablet */
    .creativity-tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Mobile tooltip positioning */
    .creativity-tooltip {
        left: 1rem;
        right: 1rem;
        transform: none;
        min-width: 240px;
        width: auto;
        max-width: none;
        white-space: normal;
    }
    
    /* Mobile mode dropdown styling */
    .recreate-mode .mode-dropdown-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .recreate-mode .mode-dropdown-menu,
    .recreate-mode .style-dropdown-menu {
        left: 0;
        right: 0;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    /* Credit Balance Pill - Mobile */
    .credit-balance-pill {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 16px;
    }

    /* Mobile responsive button styling */
    .image-action-buttons {
        flex-direction: column;
        gap: 8px !important;
    }
    
    .download-btn, .edit-btn, .redo-btn {
        width: 100%;
        justify-content: center !important;
        text-align: center !important;
        align-items: center !important;
    }
    
    .recreate-mode .input-bar {
        left: 0; /* No sidebar offset on mobile */
        right: 0; /* Use full width */
        width: 100vw; /* Use full viewport width on mobile */
        padding: 1rem;
    }
    
    /* Welcome message responsive styles */
        .recreate-mode .welcome-main-text {
        font-size: 1rem;
        margin-bottom: 0.3rem;
        margin-top: 0.75rem;
    }

    .recreate-mode .welcome-sub-text {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .recreate-mode .chat-area {
        padding-bottom: 400px; /* Increased for mobile layout with creativity selector */
        height: calc(100vh - 400px);
    }
    
    /* Mobile layout: creativity/mode on top row, textarea full width, buttons side by side */
    .recreate-mode .input-container {
        display: grid;
        grid-template-rows: auto auto auto;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        grid-template-areas:
            "creativity mode"
            "textarea textarea"
            "buttons buttons";
    }
    
    .recreate-mode .creativity-selector-section {
        grid-area: creativity;
    }
    
    .creativity-selector-section::before {
        font-size: 0.8rem; /* Smaller font for compact design */
    }

    .recreate-mode .mode-indicator-section {
        grid-area: mode;
        align-self: start;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .recreate-mode .text-input-section {
        grid-area: textarea;
    }
    
    .recreate-mode .buttons-section {
        grid-area: buttons;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.75rem;
    }
    
    .recreate-mode .upload-link-section {
        grid-column: 1;
    }
    
    .recreate-mode .file-upload-section {
        grid-column: 2;
    }
    
    .recreate-mode .generate-section {
        grid-column: 3;
    }
    
    /* Mobile-specific creativity selector styling */
    .creativity-selector-section::before {
        font-size: 0.9rem;
    }
    
    /* Mobile tooltip positioning */
    .creativity-tooltip {
        left: 1rem;
        right: 1rem;
        transform: none;
        min-width: 240px;
        width: auto;
        max-width: none;
        white-space: normal;
    }
    
    /* Make buttons responsive and horizontal */
    .recreate-mode .file-upload-btn,
    .recreate-mode .upload-link-btn,
    .recreate-mode .generate-btn {
        width: 100% !important;
        min-width: auto !important;
        min-height: 70px;
        flex-direction: row;
        padding: 0.75rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    /* Keep credits second line visible even on mobile: override row layout for generate button only */
    .recreate-mode .generate-btn {
        flex-direction: column !important;
    }

    .recreate-mode .mode-indicator-section .style-dropdown-btn {
        width: 100%;
        min-width: auto;
        min-height: 60px;
        flex-direction: row;
        padding: 0.75rem;
        font-size: 0.875rem;
        gap: 0.5rem;
    }
    
    /* Compact textarea for mobile */
    .recreate-mode .message-textarea {
        min-height: 80px;
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    /* Adjust creativity tabs for mobile */
    .creativity-tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Mobile responsive image messages */
    .uploaded-image-container {
        padding: 0.5rem;
        gap: 0.4rem;
    }
    
    .uploaded-image {
        max-height: 150px;
    }
    
    .image-filename {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Mobile mode dropdown styling */
    .recreate-mode .mode-dropdown-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .recreate-mode .welcome-message .message-text h3 {
        font-size: 1rem;
    }
    
    .recreate-mode .mode-dropdown-menu,
    .recreate-mode .style-dropdown-menu {
        left: 0;
        right: 0;
        min-width: 150px;
    }
    
    /* Upload from Link Modal - Mobile Styles */
    .upload-link-modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .upload-link-modal-title {
        font-size: 1.25rem;
    }
    
    .upload-link-buttons {
        flex-direction: column;
    }
    
    /* Generation modal responsive adjustments */
    .generation-loader {
        width: 100px;
        height: 100px;
    }
    
    .loader-ring:nth-child(1) {
        width: 100px;
        height: 100px;
    }
    
    .loader-ring:nth-child(2) {
        width: 75px;
        height: 75px;
        top: 12.5px;
        left: 12.5px;
    }
    
    .loader-ring:nth-child(3) {
        width: 50px;
        height: 50px;
        top: 25px;
        left: 25px;
    }
    
    .generation-message {
        font-size: 1.3rem;
    }
    
    .generation-subtitle {
        font-size: 1rem;
    }
    
    /* Progress bar responsive */
    .generation-progress-container {
        max-width: 250px;
        margin: 1rem auto;
    }
    
    .generation-progress-bar {
        height: 6px;
    }
    
    .generation-progress-stage {
        font-size: 0.6rem;
        top: -20px;
    }
    
    .generation-progress-text {
        font-size: 0.65rem;
    }
    
    /* Queue details responsive */
    .queue-details {
        margin-top: 1rem;
        margin-bottom: 1rem;
        padding: 0.75rem;
    }
    
    .queue-info-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .queue-stat {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        background: rgba(255, 215, 0, 0.05);
        border-radius: 0.5rem;
    }
    
    .queue-label {
        font-size: 0.75rem;
    }
    
    .queue-value {
        font-size: 0.9rem;
    }
    
    .queue-apology {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
    
    /* Download modal responsive adjustments */
    .download-loader {
        width: 80px;
        height: 80px;
    }
    
    .download-icon {
        width: 28px;
        height: 28px;
    }
    
    .download-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .download-message {
        font-size: 1.2rem;
    }
    
    .download-subtitle {
        font-size: 0.9rem;
    }
    
    .download-modal-content {
        padding: 1.5rem;
    }

    .validation-loading-content {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .validation-spinner {
        width: 40px;
        height: 40px;
    }
    
    .validation-spinner svg {
        width: 16px;
        height: 16px;
    }
    
    .validation-message {
        font-size: 16px;
    }
    
    .validation-submessage {
        font-size: 12px;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    /* Credit Balance Pill - Small Mobile */
    .credit-balance-pill {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 14px;
        gap: 4px;
    }

    .recreate-mode .input-bar {
        padding: 0.75rem;
    }
    
    .recreate-mode .chat-area {
        padding-bottom: 450px;
        height: calc(100vh - 450px);
    }
    
    /* Welcome message responsive styles */
        .recreate-mode .welcome-main-text {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
        margin-top: 0.5rem;
    }

    .recreate-mode .welcome-sub-text {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }
    
    .recreate-mode .file-upload-btn,
    .recreate-mode .upload-link-btn,
    .recreate-mode .generate-btn {
        min-height: 60px;
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    .recreate-mode .mode-indicator-section .style-dropdown-btn {
        min-height: 30px;
        padding: 0.6rem;
        font-size: 0.75rem;
    }

    .recreate-mode .mode-dropdown-btn {
        min-height: 30px;
        padding: 0.6rem;
        font-size: 0.75rem;
    }
    
    .recreate-mode .message-textarea {
        min-height: 50px;
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Smaller creativity tabs for very small screens */
    .creativity-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Mobile responsive image messages */
    .uploaded-image-container {
        padding: 0.5rem;
        gap: 0.4rem;
    }
    
    .uploaded-image {
        max-height: 150px;
    }
    
    .image-filename {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
    
    .generation-loader {
        width: 80px;
        height: 80px;
    }
    
    .loader-ring:nth-child(1) {
        width: 80px;
        height: 80px;
    }
    
    .loader-ring:nth-child(2) {
        width: 60px;
        height: 60px;
        top: 10px;
        left: 10px;
    }
    
    .loader-ring:nth-child(3) {
        width: 40px;
        height: 40px;
        top: 20px;
        left: 20px;
    }
    
    .generation-message {
        font-size: 1.1rem;
    }
    
    .generation-subtitle {
        font-size: 0.9rem;
    }
    
    .generation-modal-content {
        padding: 1.5rem;
    }
    
    /* Progress bar for very small screens */
    .generation-progress-container {
        max-width: 200px;
        margin: 0.75rem auto;
    }
    
    .generation-progress-bar {
        height: 5px;
    }
    
    .generation-progress-stage {
        font-size: 0.55rem;
        top: -18px;
    }
    
    .generation-progress-text {
        font-size: 0.6rem;
    }
    
    /* Queue details for very small screens */
    .queue-details {
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
        padding: 0.5rem;
    }
    
    .queue-info-grid {
        gap: 0.5rem;
    }
    
    .queue-stat {
        padding: 0.4rem;
    }
    
    .queue-label {
        font-size: 0.7rem;
    }
    
    .queue-value {
        font-size: 0.85rem;
    }
    
    .queue-apology {
        font-size: 0.75rem;
        margin-top: 0.4rem;
    }

    .creativity-header {
        font-size: 0.9rem;
    }

    .creativity-info-icon {
        width: 16px;
    }
}

@media (max-width: 480px) {
    .download-loader {
        width: 70px;
        height: 70px;
    }
    
    .download-message {
        font-size: 1.1rem;
    }
    
    .download-subtitle {
        font-size: 0.85rem;
    }
}

