/* Render IA - Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
}

/* Main Container */
.render-ia-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 80px);
}

/* API Config Panel */
.api-config-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    border-bottom: 1px solid #e0e0e0;
}

.config-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    color: #333;
}

.config-header h3 i {
    color: #667eea;
}

.config-body {
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.config-body.collapsed {
    display: none;
}

.config-body .form-group {
    flex: 1;
    min-width: 300px;
}

/* Render Parameters Panel */
.render-params-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.render-params-panel h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.render-params-panel h3 i {
    color: #764ba2;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-group small {
    font-size: 11px;
    color: #999;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

/* Drop Zone */
.upload-section {
    margin-bottom: 24px;
}

.drop-zone {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ebf0 100%);
    border: 3px dashed #c5cdd8;
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ebf0 100%);
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: linear-gradient(135deg, #e8ebff 0%, #dde3f5 100%);
    transform: scale(1.01);
}

.drop-zone-content i {
    font-size: 64px;
    color: #667eea;
    margin-bottom: 16px;
}

.drop-zone-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #333;
}

.drop-zone-content p {
    margin: 0 0 12px 0;
    color: #666;
}

.supported-formats {
    font-size: 12px;
    color: #999;
    background: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 20px;
}

/* Preview Section */
.preview-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

.preview-container {
    display: flex;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.preview-box {
    flex: 1;
    background: #f9fafb;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.preview-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    border-bottom: 1px solid #e5e7eb;
}

.preview-header h4 {
    margin: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
}

.preview-header h4 i {
    font-size: 18px;
    color: #667eea;
}

.result-box .preview-header h4 i {
    color: #38ef7d;
}

.preview-image-container {
    padding: 16px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.preview-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.preview-arrow i {
    font-size: 40px;
    color: #667eea;
}

/* Loading Placeholder */
.loading-placeholder {
    text-align: center;
    color: #999;
}

.loading-placeholder .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-placeholder p {
    margin: 0;
    font-size: 14px;
}

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

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}

.btn-secondary {
    background: #f0f2f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e4e6e9;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    padding: 8px;
    background: transparent;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Progress Container */
.progress-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Access Denied Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-icon.error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.modal-icon i {
    font-size: 40px;
    color: white;
}

.modal-content h2 {
    margin: 0 0 16px 0;
    color: #333;
}

.modal-content p {
    margin: 0 0 12px 0;
    color: #666;
    line-height: 1.6;
}

.modal-content .btn {
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .preview-container {
        flex-direction: column;
    }

    .preview-arrow {
        transform: rotate(90deg);
        padding: 10px 0;
    }

    .params-grid {
        grid-template-columns: 1fr;
    }

    .config-body {
        flex-direction: column;
    }

    .config-body .form-group {
        min-width: 100%;
    }
}

@media (max-width: 600px) {
    .render-ia-container {
        padding: 16px;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .drop-zone-content i {
        font-size: 48px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
        justify-content: center;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.notification-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.notification-error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.notification-warning {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.notification-info {
    background: var(--primary-gradient);
}

.notification.hide {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Creative Mode Panel */
.creative-panel {
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.creative-panel.active {
    border-color: #f093fb;
}

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

.creative-header h3 {
    margin: 0;
}

.creative-header h3 i {
    color: #f093fb;
}

.creative-description {
    color: #777;
    font-size: 13px;
    margin: 0 0 16px 0;
}

.creative-options {
    padding-top: 16px;
    border-top: 1px solid #eee;
    animation: fadeIn 0.3s ease;
}

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

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Creativity Slider */
.slider-container {
    padding: 8px 0;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e0e0e0 0%, #f093fb 50%, #f5576c 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    border: 3px solid #f093fb;
    transition: transform 0.2s;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    border: 3px solid #f093fb;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #999;
}

/* Creative Badge on Button */
.btn-primary.creative-active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-primary.creative-active:hover {
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

/* Provider Config Sections */
.provider-config {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
}

.provider-config .form-group {
    flex: 1;
    min-width: 200px;
}

.config-body .form-group:first-child {
    flex: 0 0 180px;
    min-width: 180px;
}

/* Provider indicator */
.api-config-panel[data-provider="gemini"] .config-header h3::after {
    content: " (Gemini)";
    font-size: 12px;
    color: #667eea;
    font-weight: normal;
}

.api-config-panel[data-provider="qwen"] .config-header h3::after {
    content: " (Qwen)";
    font-size: 12px;
    color: #ff6b35;
    font-weight: normal;
}

/* Qwen accent color */
.api-config-panel[data-provider="qwen"] .config-header h3 i {
    color: #ff6b35;
}

/* Provider badge on button */
.btn-qwen {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%) !important;
}

.btn-qwen:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4) !important;
}

/* OpenRouter styles */
.api-config-panel[data-provider="openrouter"] .config-header h3::after {
    content: " (OpenRouter)";
    font-size: 12px;
    color: #6366f1;
    font-weight: normal;
}

.api-config-panel[data-provider="openrouter"] .config-header h3 i {
    color: #6366f1;
}

.btn-openrouter {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
}

.btn-openrouter:hover {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
}

/* Watermark Panel */
.watermark-panel {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.watermark-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.watermark-info {
    flex: 1;
}

.watermark-info h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
}

.watermark-info h3 i {
    color: #667eea;
    font-size: 18px;
    vertical-align: middle;
    margin-right: 4px;
}

.watermark-description {
    color: #888;
    font-size: 12px;
    margin: 0;
}

.toggle-slider.watermark-slider {
    background-color: #667eea;
}

.toggle-switch input:checked + .toggle-slider.watermark-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:not(:checked) + .toggle-slider.watermark-slider {
    background-color: #ccc;
}
