/* Create Modal Styles */

/* Modal Overlay */
.create-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.create-modal.show {
    display: flex;
    opacity: 1;
}

.create-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

body.light-mode .create-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* Modal Container */
.create-modal-container {
    position: relative;
    width: 98vw;
    height: 98vh;
    margin: auto;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.create-modal.show .create-modal-container {
    transform: scale(1);
}

/* Modal Header */
.create-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.modal-title i {
    color: #00d4ff;
    font-size: 20px;
}

.modal-controls {
    display: flex;
    gap: 8px;
}

.modal-control-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-control-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.modal-control-btn.minimize-btn:hover {
    background: #feca57;
    color: #000;
}

.modal-control-btn.maximize-btn:hover {
    background: #48dbfb;
    color: #000;
}

.modal-control-btn.close-btn:hover {
    background: #ff4757;
}

/* Modal Content */
.create-modal-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Panels */
.create-panel {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.create-panel.right-panel {
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.panel-title i {
    color: #00d4ff;
    font-size: 14px;
}

.panel-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.preview-price-badge {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.preview-price-badge i {
    font-size: 12px;
}

.panel-control-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.panel-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.panel-control-btn.generate-btn {
    background: linear-gradient(135deg, rgb(90, 44, 119) 0%, rgb(118, 75, 162) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    min-width: 120px;
    white-space: nowrap;
    width: auto;
}

.panel-control-btn.generate-btn span {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.panel-control-btn.generate-btn i {
    font-size: 14px;
}

.panel-control-btn.generate-btn:hover {
    background: linear-gradient(135deg, rgb(125, 64, 163) 0%, rgb(154, 107, 201) 100%);
    transform: translateY(-1px);
}

.panel-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Resize Handle */
.resize-handle {
    width: 4px;
    background: rgba(255, 255, 255, 0.1);
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.resize-handle:hover {
    background: rgba(0, 212, 255, 0.3);
}

.resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

/* Creation Methods Grid - Badge Layout */
.creation-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    max-height: 400px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.creation-method-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.creation-method-badge:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.1);
}

.creation-method-badge.selected {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.badge-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    font-size: 20px;
    color: #00d4ff;
}

.creation-method-badge:hover .badge-icon {
    background: rgba(0, 212, 255, 0.2);
    transform: scale(1.1);
}

.badge-content {
    flex: 1;
    min-width: 0;
}

.badge-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading-badges {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-badges i {
    font-size: 32px;
    margin-bottom: 16px;
    color: #00d4ff;
}

.loading-badges p {
    font-size: 14px;
    margin: 0;
}

.no-methods-message {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.no-methods-message i {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.no-methods-message p {
    color: var(--text-secondary);
    margin: 8px 0;
}

.no-methods-message .reload-btn {
    margin-top: 16px;
    padding: 10px 24px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #00d4ff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.no-methods-message .reload-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

/* Form content below badges */
#formContent {
    padding: 0 16px 16px 16px;
    overflow-y: auto;
}

/* Mobile responsive badges */
@media (max-width: 768px) {
    .creation-methods-grid {
        grid-template-columns: 1fr;
        padding: 12px;
        max-height: 300px;
    }
    
    .creation-method-badge {
        padding: 12px;
    }
}

/* Selection Steps (Legacy - for backwards compatibility) */
.selection-steps {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.selection-step {
    margin-bottom: 30px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.selection-step.active {
    opacity: 1;
}

.selection-step.completed {
    opacity: 0.8;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.selection-step.active .step-number {
    background: linear-gradient(135deg, #00d4ff, #667eea);
    color: var(--text-primary);
}

.selection-step.completed .step-number {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.step-title {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.step-content {
    padding-left: 44px;
}

/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn.prev-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-btn.next-btn {
    background: linear-gradient(135deg, #00d4ff, #667eea);
    color: var(--text-primary);
}

.nav-btn.generate-btn {
    background: linear-gradient(135deg, #00d4ff, #667eea);
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    width: auto;
    min-width: fit-content;
}

.nav-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.nav-btn.prev-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn.next-btn:not(:disabled):hover,
.nav-btn.generate-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #00b8e6, #5a6fd8);
}

.method-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.method-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.method-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.method-card:hover::before {
    opacity: 1;
}

.method-icon {
    font-size: 24px;
    color: #00d4ff;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.method-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.method-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
}

.loading-methods {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-methods i {
    font-size: 24px;
    margin-bottom: 16px;
    color: #00d4ff;
}

/* Dynamic Form */
.dynamic-form-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.back-to-methods-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.back-to-methods-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.form-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

/* Preview Container */
.preview-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bg-secondary), 0.02);
    border-radius: 8px;
    border: 2px dashed rgba(var(--border-color), 0.1);
}

.preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.preview-placeholder i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.preview-placeholder h4 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 8px;
}

.preview-placeholder p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Generation Progress */
.generation-progress {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-header h4 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0;
}

.progress-percentage {
    color: #00d4ff;
    font-weight: 600;
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #667eea);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    text-align: center;
}

/* Clear Results Container */
.clear-results-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.clear-results-btn {
    width: auto;
    min-width: 120px;
    padding: 10px 20px;
    gap: 8px;
}

.clear-results-btn span {
    font-size: 13px;
    font-weight: 500;
}

/* Results Actions */
.results-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
    justify-content: center;
  
}

.action-btn.primary {
    background: linear-gradient(135deg, #00d4ff, #667eea);
    color: var(--text-primary);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn:not(.primary):not(.secondary) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #00b8e6, #5a6fd8);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .create-modal-container {
        width: 95vw;
        height: 95vh;
    }
}

@media (max-width: 768px) {
    .create-modal-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .create-modal-content {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .create-panel {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        overflow: visible;
    }
    
    .panel-content,
    .form-content {
        overflow-y: visible;
    }
    
    .create-panel.right-panel {
        border-left: none;
        border-bottom: none;
    }
    
    .resize-handle {
        width: 100%;
        height: 4px;
        cursor: row-resize;
    }
    
    .resize-handle::before {
        width: 20px;
        height: 2px;
    }
    
    .methods-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        flex: none;
    }
    
    /* Hide elements on mobile to reduce crowding */
    .modal-title {
        font-size: 14px;
    }
    
    .modal-title i {
        display: none;
    }
    
    /* Hide only left panel header on mobile (Creation Setup) */
    .left-panel .panel-header {
        display: none;
    }
    
    .panel-title {
        display: none;
    }
    
    .step-header {
        display: none;
    }
    
    /* Remove padding-left from step-content on mobile */
    .step-content {
        padding-left: 0;
    }
    
    
}

/* Scrollbar Styling */
.panel-content::-webkit-scrollbar,
.form-content::-webkit-scrollbar,
.methods-grid::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track,
.form-content::-webkit-scrollbar-track,
.methods-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb,
.form-content::-webkit-scrollbar-thumb,
.methods-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
.form-content::-webkit-scrollbar-thumb:hover,
.methods-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

/* Model Info Badges */
.model-info {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-price {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.badge-info {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.4;
}

.model-description {
    display: block;
    font-size: 13px;
    padding: 8px 12px;
}

/* Style Selection Modal */
.style-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.style-selection-modal.show {
    opacity: 1;
}

.style-selection-content {
    background: var(--modal-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.style-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.style-selection-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.style-selection-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.style-selection-close:hover {
    color: var(--text-primary);
}

.style-categories {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.style-category {
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
}

.style-category-header {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.style-category-header:hover {
    background: rgba(102, 126, 234, 0.05);
}

.style-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.style-category-icon i {
    font-size: 18px;
    color: white;
}

.style-category-info {
    flex: 1;
}

.style-category-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.style-category-description {
    font-size: 13px;
    color: var(--text-secondary);
}

.style-category-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.style-category-toggle.expanded {
    transform: rotate(90deg);
}

.style-category-toggle i {
    color: var(--text-secondary);
}

.style-category-styles {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.style-category-styles.expanded {
    max-height: 500px;
    border-top: 1px solid var(--border-color);
}

.style-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px;
}

.style-item {
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--modal-bg);
}

.style-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.style-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.style-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.style-item-icon i {
    font-size: 24px;
    color: white;
}

.style-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.style-item-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.style-selection-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-style-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.style-selection-buttons {
    display: flex;
    gap: 12px;
}

.btn-style-cancel,
.btn-style-apply {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-style-cancel {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-style-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-style-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-style-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-style-apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.style-selection-container {
    margin-top: 8px;
}

.style-selection-placeholder {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.style-selection-placeholder:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.style-selection-placeholder i {
    color: #667eea;
}

.style-selection-preview {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #667eea;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(102, 126, 234, 0.05);
    position: relative;
}

.style-selection-preview:hover {
    background: rgba(102, 126, 234, 0.1);
}

.style-selection-preview-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.style-selection-preview-icon i {
    font-size: 24px;
    color: white;
}

.style-selection-preview-info {
    flex: 1;
}

.style-selection-preview-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.style-selection-preview-description {
    font-size: 12px;
    color: var(--text-secondary);
}

.style-selection-preview-remove {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.style-selection-preview-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.style-selection-preview-remove i {
    color: #ef4444;
}

.badge-layers {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.badge-style {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Upload/Library Toggle */
.upload-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.upload-toggle .toggle-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    color: #999;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.upload-toggle .toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.upload-toggle .toggle-btn.active {
    background: linear-gradient(135deg, #00d4ff, #667eea);
    color: #fff;
    border-color: transparent;
}

.upload-toggle .toggle-btn i {
    font-size: 14px;
}

/* Upload Area */
.upload-container {
    margin-bottom: 16px;
}

.upload-area {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: rgba(0, 212, 255, 0.5);
    background: rgba(0, 212, 255, 0.05);
}

.upload-area.drag-over {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    transform: scale(1.02);
}

.upload-area.file-selected {
    border-style: solid;
    border-color: rgba(0, 212, 255, 0.5);
}

.upload-placeholder {
    color: #999;
}

.upload-placeholder i {
    font-size: 48px;
    color: rgba(0, 212, 255, 0.5);
    margin-bottom: 16px;
    display: block;
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #fff;
}

.upload-subtext {
    font-size: 13px;
    color: #999;
}

.file-input-hidden {
    display: none;
}

/* Upload Preview */
.upload-preview {
    width: 100%;
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
}

.upload-preview .remove-preview {
    position: absolute;
    top: -12px;
    right: -12px;
    background: rgba(255, 107, 107, 0.9);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.upload-preview .remove-preview:hover {
    background: #ff6b6b;
    transform: scale(1.1);
}

.preview-images-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.preview-image-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #2a2a3e;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.preview-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-image-wrapper .image-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 212, 255, 0.9);
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Library Section */
.library-section {
    margin-bottom: 16px;
}

.library-browse-btn {
    width: 100%;
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    border: 2px dashed rgba(0, 212, 255, 0.3);
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.library-browse-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.library-browse-btn i {
    font-size: 18px;
}

.selected-library-preview {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    position: relative;
}

.selected-library-preview .remove-library-selection {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 107, 107, 0.9);
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.selected-library-preview .remove-library-selection:hover {
    background: #ff6b6b;
    transform: scale(1.1);
}

/* Library Modal Hover Effects */
.library-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.library-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.library-select-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-label .required {
    color: #ff6b6b;
    margin-left: 4px;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Base styles for all form elements */
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Select-specific styles with dropdown arrow */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* Textarea-specific styles (no dropdown arrow needed) */
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Make prompt textareas taller for better UX */
textarea[data-prompt="true"],
textarea.form-textarea[data-prompt="true"] {
    min-height: 160px;
    resize: vertical;
}

/* Focus states */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(0, 212, 255, 0.5);
    background: var(--bg-secondary);
}

/* Select option styles */
.form-group select option {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 12px;
}

.form-group select option:hover {
    background: var(--bg-secondary);
}

.form-group select option:checked {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

/* Additional dropdown styling for better browser support */
.form-group select::-ms-expand {
    display: none;
}

.form-group select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.5);
}

/* Ensure dropdown arrow is visible */
.form-group select:not([multiple]):not([size]) {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
}

/* Required field indicators */
.form-group label .required {
    color: #ff6b6b;
    margin-left: 4px;
}

/* Model price info */
.model-price-info {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-price-info i {
    color: #00d4ff;
}

/* Error message styling */
.error-message {
    text-align: center;
    padding: 20px;
    color: #ff6b6b;
}

.error-message i {
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
}

.error-message h4 {
    color: #ff6b6b;
    font-size: 16px;
    margin-bottom: 8px;
}

.error-message p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Loading States */
.loading-form {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-form i {
    font-size: 24px;
    margin-bottom: 16px;
    color: #00d4ff;
}

/* Result Content */
.result-content {
    text-align: center;
    width: 100%;
}

.result-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.result-info h4 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 8px;
}

.result-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Error Content */
.error-content {
    text-align: center;
    color: #ff6b6b;
}

.error-content i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ff6b6b;
}

.error-content h4 {
    color: #ff6b6b;
    font-size: 18px;
    margin-bottom: 8px;
}

.error-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Range/Slider Inputs */
.form-range {
    width: calc(100% - 60px);
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    padding: 0;
    border: none;
    vertical-align: middle;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #00d4ff, #667eea);
    cursor: pointer;
    border-radius: 50%;
}

.form-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #00d4ff, #667eea);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.range-value {
    display: inline-block;
    margin-left: 12px;
    color: #00d4ff;
    font-weight: 600;
    font-size: 14px;
    min-width: 40px;
    text-align: right;
}

/* Checkbox Inputs */
.form-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #00d4ff;
}

/* Form Help Text */
.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
}

.empty-state h4 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Result Success */
.result-success {
    text-align: center;
}

.result-success i {
    font-size: 64px;
    color: #4caf50;
    margin-bottom: 20px;
}

.result-success h4 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 12px;
}

.result-success p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Minimized Modal Box - Bottom Left Corner */
.minimized-modal-box {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: none;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(0, 212, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    min-width: 280px;
}

.minimized-modal-box.show {
    opacity: 1;
    transform: translateY(0);
}

.minimized-modal-box:hover {
    border-color: var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6),
                0 0 30px rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.minimized-icon {
    width: 48px;
    height: 48px;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.minimized-icon i {
    font-size: 24px;
    color: var(--text-primary);
}

.minimized-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.minimized-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.minimized-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.minimized-close {
    width: 32px;
    height: 32px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.minimized-close:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.minimized-close i {
    font-size: 14px;
    color: var(--text-primary);
}

/* Animation for minimized box on click */
.minimized-modal-box:active {
    transform: scale(0.98);
}

/* Insufficient Credits Error - Theme Aware */
.insufficient-credits-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.insufficient-credits-error .coins-icon {
    font-size: 48px;
    color: #ffd700;
    margin-bottom: 8px;
}

.insufficient-credits-error .error-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.insufficient-credits-error .error-message {
    margin: 10px 0;
    color: rgba(255,255,255,0.8);
}

.insufficient-credits-error .error-message p {
    margin: 5px 0;
}

.insufficient-credits-error .error-message .shortfall {
    color: #ff6b6b;
    font-weight: 600;
}

.insufficient-credits-error .error-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.insufficient-credits-error .btn-add-credits {
    padding: 8px 18px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    transform: translateY(0);
}

.insufficient-credits-error .btn-add-credits:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.insufficient-credits-error .btn-add-credits i {
    color: #000;
    margin-bottom: 0;
    font-size: 14px;
}

.insufficient-credits-error .btn-cancel {
    padding: 8px 18px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.insufficient-credits-error .btn-cancel:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}

/* Dark Mode Explicit Styles */
[data-theme="dark"] .insufficient-credits-error .error-title,
body.dark-mode .insufficient-credits-error .error-title {
    color: #fff !important;
}

[data-theme="dark"] .insufficient-credits-error .error-message,
body.dark-mode .insufficient-credits-error .error-message {
    color: rgba(255,255,255,0.8) !important;
}

[data-theme="dark"] .insufficient-credits-error .btn-cancel,
body.dark-mode .insufficient-credits-error .btn-cancel {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.9) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
}

[data-theme="dark"] .insufficient-credits-error .btn-cancel:hover,
body.dark-mode .insufficient-credits-error .btn-cancel:hover {
    background: rgba(255,255,255,0.15) !important;
    border-color: rgba(255,255,255,0.25) !important;
}

/* Light Mode Theme - Support both data-theme and body class */
[data-theme="light"] .insufficient-credits-error .error-title,
body.light-mode .insufficient-credits-error .error-title {
    color: #1a1a1a !important;
}

[data-theme="light"] .insufficient-credits-error .error-message,
body.light-mode .insufficient-credits-error .error-message {
    color: rgba(0,0,0,0.7) !important;
}

[data-theme="light"] .insufficient-credits-error .btn-cancel,
body.light-mode .insufficient-credits-error .btn-cancel {
    background: rgba(0,0,0,0.05) !important;
    color: rgba(0,0,0,0.85) !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
}

[data-theme="light"] .insufficient-credits-error .btn-cancel:hover,
body.light-mode .insufficient-credits-error .btn-cancel:hover {
    background: rgba(0,0,0,0.1) !important;
    border-color: rgba(0,0,0,0.25) !important;
}