/* Styles améliorés pour les formulaires de création */

/* Structure du formulaire */
.creative-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .creative-form {
        grid-template-columns: 1fr 1fr;
    }
    
    .creative-form .full-width,
    .creative-form .campaign-options.full-width,
    .creative-form .form-actions {
        grid-column: 1 / -1;
    }
}

/* Brief créatif */
.campaign-brief {
    background: linear-gradient(135deg, rgba(58, 109, 240, 0.1), rgba(255, 122, 90, 0.1));
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.campaign-brief::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.brief-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.brief-tag {
    background-color: var(--primary);
    color: white;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-weight: 500;
}

/* Téléchargement de fichiers amélioré */
.file-upload-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-input {
    position: relative;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.file-input:hover {
    border-color: var(--primary-light);
    background-color: rgba(58, 109, 240, 0.05);
}

/* Style pour le drag & drop */
.file-input.highlight {
    border-color: var(--primary);
    background-color: rgba(58, 109, 240, 0.1);
    transform: scale(1.01);
    box-shadow: 0 0 15px rgba(58, 109, 240, 0.2);
}

.file-input input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-preview {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--gray);
    transition: all 0.3s ease;
}

.file-preview.has-image {
    background-color: rgba(0, 0, 0, 0.1);
}

.file-preview span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.file-preview strong {
    font-size: 1.1rem;
    color: var(--light);
    margin-top: 0.5rem;
}

.file-preview small {
    font-size: 0.85rem;
    opacity: 0.7;
}

.file-preview i {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

/* Styles pour la grille d'images de prévisualisation */
.preview-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
    padding: 10px;
}

.preview-image-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.preview-image-item:hover {
    transform: scale(1.05);
    z-index: 2;
}

.preview-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Styles pour le bouton "voir plus" */
.more-images {
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.more-images:hover {
    background-color: var(--primary);
}

.more-images-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.more-count {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.more-text {
    font-size: 0.85rem;
    opacity: 0.8;
}

.file-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Liste des fichiers sélectionnés */
.selected-files {
    margin-top: 1rem;
}

.files-list {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.files-list p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #4CAF50; /* Couleur verte */
    font-weight: 500;
}

.files-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.files-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.files-list li:last-child {
    border-bottom: none;
}

.files-list li i {
    color: var(--primary-light);
}

/* Textarea amélioré */
.form-group textarea {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    color: var(--light);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    width: 100%;
    resize: vertical;
    min-height: 200px;
    transition: all 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58, 109, 240, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Options de campagne */
.campaign-options {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid var(--border);
}

/* Infobulle */
[data-tooltip] {
    position: relative;
    cursor: help;
    margin-left: 5px;
    color: var(--primary-light);
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: normal;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: max-content;
    max-width: 300px;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    z-index: 10;
}

/* Information sur le nombre total d'images */
.total-output-info {
    margin-top: 10px;
    font-size: 0.9rem;
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-output-info strong {
    color: #4CAF50;
    font-size: 1.1rem;
}

/* Style pour l'estimation de coût */
.cost-estimate {
    color: #FF9800;
    font-size: 0.85rem;
    padding: 4px 8px;
    background-color: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
    margin-left: 10px;
}

.cost-estimate strong {
    color: #FF9800;
    font-weight: 600;
}

/* Styles pour les étapes de génération */
.generation-steps {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    position: relative;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.generation-steps::before {
    content: "";
    position: absolute;
    top: 25px;
    left: 50px;
    right: 50px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 33.33%;
    transition: all 0.3s ease;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    color: var(--gray);
    font-size: 1.2rem;
}

.step-content {
    text-align: center;
    padding: 0 1rem;
}

.step-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--gray);
    transition: all 0.3s ease;
}

.step-description {
    font-size: 0.85rem;
    color: var(--gray);
    opacity: 0.7;
    transition: all 0.3s ease;
}

/* États des étapes */
.step.active .step-icon {
    background-color: rgba(58, 109, 240, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(58, 109, 240, 0.3);
}

.step.active .step-title {
    color: var(--primary);
}

.step.active .step-description {
    color: var(--light);
    opacity: 0.9;
}

.step.completed .step-icon {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step.completed .step-title {
    color: var(--primary);
}

/* Animation de la barre de progression */
.task-progress-container {
    margin: 2rem 0;
    position: relative;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-progress-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    flex-grow: 1;
}

.task-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percentage {
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
    text-align: right;
}

/* Animation de fade-in */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

.campaign-options h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: white;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-item label {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.3rem;
}

.form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: white;
    font-family: 'Inter', sans-serif;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58, 109, 240, 0.2);
}

/* Actions du formulaire */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
}

.form-actions .btn.primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    box-shadow: 0 4px 15px rgba(58, 109, 240, 0.3);
}

.form-actions .btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 109, 240, 0.4);
}

/* Overlay de chargement amélioré */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(31, 31, 43, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-container {
    background-color: var(--dark-light);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(58, 109, 240, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

.loading-container h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-container p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.campaign-stats {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.campaign-stats .stat-item {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.campaign-stats .stat-item i {
    color: var(--accent);
    font-size: 1.2rem;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
