/**
 * Creative Studio Tab Styles
 * Premium dark theme with glassmorphic design
 * Character management and angle system
 */

/* ========================================
   Main Container
   ======================================== */

.creative-studio-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: studioFadeIn 0.5s ease-out;
}

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

/* ========================================
   Header
   ======================================== */

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

.studio-header h2 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.studio-header h2 i {
    font-size: 1.8rem;
    -webkit-text-fill-color: #ff8c00;
}

.studio-header .header-description {
    color: #94a3b8;
    font-size: 1rem;
    margin: 0;
}

/* ========================================
   Sub-navigation
   ======================================== */

.studio-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
    padding: 8px;
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.studio-nav-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.studio-nav-btn:hover {
    background: rgba(255, 140, 0, 0.1);
    color: #e2e8f0;
}

.studio-nav-btn.active {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 107, 53, 0.1));
    color: #ff8c00;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.2);
}

.studio-nav-btn i {
    font-size: 1.1rem;
}

/* ========================================
   Sections
   ======================================== */

.studio-section {
    display: none;
    animation: sectionSlide 0.3s ease;
}

.studio-section.active {
    display: block;
}

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

.section-card {
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section-card h3 {
    color: #e2e8f0;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-card h3 i {
    color: #ff8c00;
    font-size: 1.5rem;
}

.section-description {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* ========================================
   Characters Section
   ======================================== */

.character-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.character-card {
    background: rgba(30, 30, 35, 0.8);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.character-card:hover {
    border-color: rgba(255, 140, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.character-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.character-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
}

.character-favorite {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: all 0.2s ease;
}

.character-favorite:hover,
.character-favorite.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.character-features {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.character-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 140, 0, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #ff8c00;
    margin-bottom: 12px;
}

.character-actions-row {
    display: flex;
    gap: 8px;
}

.character-actions-row .btn-icon {
    flex: 1;
}

/* Character Thumbnail */
.character-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: rgba(20, 20, 25, 0.6);
    position: relative;
}

.character-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-thumbnail img.fade-in {
    animation: thumbnailFadeIn 0.3s ease-in-out;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 3rem;
    position: relative;
}

.character-thumbnail.loading .thumbnail-placeholder {
    color: #ff8c00;
}

.character-thumbnail.loading .thumbnail-placeholder i {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Shimmer animation for loading state */
.shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 140, 0, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Error state - show placeholder when image fails to load */
.character-thumbnail.error .thumbnail-placeholder {
    display: flex;
}

.character-thumbnail.error img {
    display: none;
}

/* ========================================
   Generate Section
   ======================================== */

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group label i {
    color: #ff8c00;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 15, 20, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #ff8c00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}

.textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.textarea-small {
    min-height: 80px;
}

.form-hint {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 6px;
}

/* Angle Presets Compact */
.angle-presets-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.angle-preset-btn {
    padding: 10px 16px;
    background: rgba(30, 30, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.angle-preset-btn:hover {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.3);
    color: #e2e8f0;
}

.angle-preset-btn.selected {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 107, 53, 0.1));
    border-color: #ff8c00;
    color: #ff8c00;
}

/* Options Row */
.options-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.options-row .form-group.compact {
    margin-bottom: 0;
}

/* Checkbox Group */
.checkbox-group {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff8c00;
}

.checkbox-label span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkbox-label i {
    color: #ff8c00;
}

/* Generation Result */
.generation-result {
    margin-top: 24px;
    padding: 20px;
    background: rgba(30, 30, 35, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(81, 207, 102, 0.3);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-header h4 {
    color: #51cf66;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-actions-quick {
    display: flex;
    gap: 8px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.result-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.result-item img {
    width: 100%;
    height: auto;
    display: block;
}

.result-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item:hover .result-item-overlay {
    opacity: 1;
}

/* ========================================
   Angles Section
   ======================================== */

.source-image-area {
    margin-bottom: 24px;
}

.source-drop-zone {
    background: rgba(30, 30, 35, 0.6);
    border: 2px dashed rgba(100, 116, 139, 0.3);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.source-drop-zone:hover {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.05);
}

.source-drop-zone .drop-zone-content i {
    font-size: 3rem;
    color: #64748b;
    margin-bottom: 12px;
    display: block;
}

.source-drop-zone h4 {
    color: #e2e8f0;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.source-drop-zone p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.source-preview {
    position: relative;
    display: inline-block;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
}

.source-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.btn-remove-source {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-remove-source:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Angle Categories */
.angle-categories {
    margin-bottom: 24px;
}

.angle-category {
    margin-bottom: 12px;
    background: rgba(25, 25, 30, 0.6);
    border-radius: 12px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-header:hover {
    background: rgba(255, 140, 0, 0.05);
}

.category-header h4 {
    flex: 1;
    margin: 0;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-header h4 i {
    color: #ff8c00;
}

.category-count {
    color: #64748b;
    font-size: 0.85rem;
    margin-right: 12px;
}

.category-toggle {
    color: #64748b;
    transition: transform 0.3s ease;
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-content.expanded {
    max-height: 500px;
    padding: 0 20px 20px;
}

.angle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.angle-card {
    background: rgba(35, 35, 40, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.angle-card:hover {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.3);
    transform: translateY(-2px);
}

.angle-card.selected {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 107, 53, 0.1));
    border-color: #ff8c00;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}

.angle-card i {
    font-size: 1.8rem;
    color: #94a3b8;
    margin-bottom: 8px;
    display: block;
    transition: all 0.3s ease;
}

.angle-card:hover i,
.angle-card.selected i {
    color: #ff8c00;
}

.angle-card span {
    display: block;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.angle-desc {
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Angle Quick Actions */
.angle-quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

/* Selection Summary */
.angle-selection-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(30, 30, 35, 0.8);
    border-radius: 12px;
    margin-bottom: 20px;
}

.summary-count {
    color: #e2e8f0;
    font-size: 0.95rem;
}

.summary-count span {
    color: #ff8c00;
    font-weight: 600;
}

.summary-cost {
    color: #94a3b8;
    font-size: 0.9rem;
}

.summary-cost span {
    color: #fbbf24;
    font-weight: 600;
}

/* Angle Results */
.angle-results {
    margin-top: 24px;
}

.angle-results h4 {
    color: #e2e8f0;
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.angle-results h4 i {
    color: #ff8c00;
}

.angle-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.angle-result-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(30, 30, 35, 0.8);
}

.angle-result-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.angle-result-label {
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #e2e8f0;
    font-size: 0.8rem;
    text-align: center;
}

/* ========================================
   History Section
   ======================================== */

.history-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(30, 30, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 140, 0, 0.1);
    color: #e2e8f0;
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 107, 53, 0.1));
    border-color: #ff8c00;
    color: #ff8c00;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(30, 30, 35, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: rgba(255, 140, 0, 0.2);
}

.history-thumbnail {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.history-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 140, 0, 0.15);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #ff8c00;
    margin-bottom: 8px;
}

.history-prompt-text {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-meta {
    display: flex;
    gap: 16px;
    color: #64748b;
    font-size: 0.8rem;
}

.history-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.load-more {
    text-align: center;
    margin-top: 20px;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #ff8c00, #ff6b35);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

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

.btn-secondary {
    background: rgba(60, 60, 70, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.btn-secondary:hover {
    background: rgba(80, 80, 90, 0.8);
    border-color: rgba(255, 140, 0, 0.5);
    color: #e2e8f0;
}

.btn-large {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(60, 60, 70, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.3);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 140, 0, 0.2);
    border-color: #ff8c00;
    color: #ff8c00;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ========================================
   Modals
   ======================================== */

.studio-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(25, 25, 30, 0.98);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.3s ease;
}

.modal-content.modal-large {
    max-width: 900px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    color: #e2e8f0;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: #ff8c00;
}

.modal-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #e2e8f0;
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

/* Form Fieldset */
.form-fieldset {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.form-fieldset legend {
    color: #ff8c00;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* Analyze Modal Specific */
.analyze-upload-area {
    background: rgba(30, 30, 35, 0.6);
    border: 2px dashed rgba(100, 116, 139, 0.3);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.analyze-upload-area:hover {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.05);
}

.analyze-upload-area i {
    font-size: 3rem;
    color: #64748b;
    margin-bottom: 12px;
}

.analyze-upload-area h4 {
    color: #e2e8f0;
    margin-bottom: 8px;
}

.analyze-upload-area p,
.analyze-upload-area small {
    color: #64748b;
    margin: 0;
}

.analyze-preview {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}

.analyze-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
}

.analyze-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    color: #60a5fa;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.analyze-info i {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Source Image Modal */
.source-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.source-tab {
    padding: 10px 20px;
    background: rgba(30, 30, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-tab:hover {
    background: rgba(255, 140, 0, 0.1);
}

.source-tab.active {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 107, 53, 0.1));
    border-color: #ff8c00;
    color: #ff8c00;
}

.source-tab-content {
    display: none;
}

.source-tab-content.active {
    display: block;
}

.recent-generations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.recent-generation-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.recent-generation-item:hover {
    border-color: rgba(255, 140, 0, 0.5);
    transform: scale(1.02);
}

.recent-generation-item.selected {
    border-color: #ff8c00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.2);
}

.recent-generation-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.source-upload-area {
    background: rgba(30, 30, 35, 0.6);
    border: 2px dashed rgba(100, 116, 139, 0.3);
    border-radius: 16px;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.source-upload-area:hover {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.05);
}

.source-upload-area i {
    font-size: 3rem;
    color: #64748b;
    margin-bottom: 12px;
    display: block;
}

.source-upload-area h4 {
    color: #e2e8f0;
    margin-bottom: 8px;
}

.source-upload-area p {
    color: #64748b;
}

/* ========================================
   Loading Overlay
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 140, 0, 0.2);
    border-top-color: #ff8c00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content p {
    color: #e2e8f0;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.loading-progress {
    width: 300px;
    margin: 0 auto;
}

.loading-progress .progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.loading-progress .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff8c00, #ff6b35);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.loading-progress span {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ========================================
   Empty States
   ======================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .creative-studio-container {
        padding: 16px;
    }

    .studio-header h2 {
        font-size: 1.5rem;
    }

    .studio-nav {
        flex-wrap: wrap;
    }

    .studio-nav-btn {
        flex: 1 1 45%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .section-card {
        padding: 20px;
    }

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

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

    .angle-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .character-actions {
        flex-direction: column;
    }

    .history-item {
        flex-direction: column;
    }

    .history-thumbnail {
        width: 100%;
        height: 150px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }
}
