/* carousel-form.css - Styles du générateur de carrousels */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

.main-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 600px;
    gap: 30px;
}

.form-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.preview-container {
    position: sticky;
    top: 40px;
    height: fit-content;
}

.preview-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.preview-card h2 {
    color: #1e3a8a;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.preview-frame {
    width: 540px;
    height: 675px;
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    font-size: 18px;
    text-align: center;
    padding: 20px;
}

.slide-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding: 10px 0;
}

.slide-selector-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.slide-selector-btn.active {
    background: #60a5fa;
    color: white;
    border-color: #60a5fa;
}

.slide-selector-btn:hover:not(.active) {
    border-color: #60a5fa;
    background: #eff6ff;
}

h1 { 
    color: #1e3a8a; 
    font-size: 36px; 
    margin-bottom: 10px; 
}

.subtitle { 
    color: #64748b; 
    font-size: 16px; 
    margin-bottom: 40px; 
}

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

label { 
    display: block; 
    font-weight: 600; 
    color: #1e293b; 
    margin-bottom: 8px; 
    font-size: 14px; 
}

input[type="text"], 
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.3s ease;
}

input[type="file"]:hover { 
    border-color: #60a5fa; 
    background: #eff6ff; 
}

input[type="text"]:focus, 
textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

textarea { 
    resize: vertical; 
    min-height: 80px; 
}

.slide-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

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

.slide-number {
    background: #60a5fa;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.remove-slide {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s ease;
}

.remove-slide:hover { 
    background: #dc2626; 
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.btn-primary { 
    background: #60a5fa; 
    color: white; 
}

.btn-primary:hover {
    background: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

.btn-secondary { 
    background: #10b981; 
    color: white; 
}

.btn-secondary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.actions { 
    display: flex; 
    gap: 10px; 
    margin-top: 30px; 
    flex-wrap: wrap; 
}

.preview-info {
    background: #dbeafe;
    border-left: 4px solid #60a5fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.preview-info strong { 
    color: #1e40af; 
}

.image-options { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.help-text { 
    color: #64748b; 
    font-size: 12px; 
    margin-top: 5px; 
    display: block; 
}

/* Overlay de chargement */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    border-radius: 20px;
    padding: 50px 60px;
    text-align: center;
    max-width: 500px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid #e2e8f0;
    border-top: 6px solid #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

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

.loading-message {
    color: #1e3a8a;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.loading-submessage {
    color: #64748b;
    font-size: 14px;
}

.char-counter {
    font-size: 12px;
    color: #64748b;
    text-align: right;
    margin-top: 5px;
}

.char-counter.warning {
    color: #f59e0b;
    font-weight: 600;
}

.char-counter.error {
    color: #ef4444;
    font-weight: 600;
}

/* Sélecteur de templates */
.template-selector {
    margin-bottom: 30px;
}

.template-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin: 5px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-option:hover {
    border-color: #60a5fa;
    background: #eff6ff;
}

.template-option input[type="radio"] {
    cursor: pointer;
}

.template-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.template-badge.free {
    background: #d1fae5;
    color: #065f46;
}

.template-badge.premium {
    background: #fef3c7;
    color: #92400e;
}

/* Responsive */
@media (max-width: 1400px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .preview-container {
        position: relative;
        top: 0;
    }
}
