* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #FFF4ED;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Espacement UNIQUEMENT pour PC (> 768px) */
@media (min-width: 769px) {
    .container {
        margin-top: 100px; /* Espace pour le header fixe sur PC */
    }
    
    header {
        padding-top: 40px !important;
    }
}

/* Espacement mobile */
@media (max-width: 768px) {
    .container {
        margin-top: 0;
        padding-top: 90px !important;
    }
    
    header {
        padding-top: 30px !important;
        margin-top: 0 !important;
    }
}

header {
    text-align: center;
    color: #2d2d2d;
    margin-bottom: 40px;
    padding: 20px;
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    height: 120px;
    width: auto;
    object-fit: contain;
}

header h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
    color: #1A202C;
}

.title-primary {
    color: var(--text-primary);
    display: block;
}

.title-accent {
    color: var(--primary);
    display: block;
}

.subtitle-bicolor {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.subtitle-primary {
    color: #1A202C;
    display: inline !important;
    visibility: visible !important;
    font-weight: 700;
}

.subtitle-accent {
    color: #FF6B35;
    display: inline !important;
    visibility: visible !important;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    color: #2d2d2d;
    opacity: 1;
    margin-bottom: 15px;
    font-weight: 500;
}

.limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #FF6B35;
    color: #2d2d2d;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.limit-badge .gift-icon {
    font-size: 1.3rem;
}

.limit-badge .number {
    color: #FF6B35;
    font-weight: 700;
    font-size: 1.1rem;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.upload-zone {
    border: 3px dashed #FF6B35;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.upload-zone:hover {
    border-color: #ff8c5a;
    background: #fffaf7;
    transform: translateY(-2px);
}

.upload-zone.drag-over {
    border-color: #ff8c5a;
    background: #fff0e8;
    transform: scale(1.02);
}

.upload-zone.drag-disabled {
    border-color: #ff3b30;
    background: #ffe5e5;
    cursor: not-allowed;
}

.upload-zone.drag-disabled:hover {
    transform: none;
    border-color: #ff3b30;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    color: #FF6B35;
    margin-bottom: 20px;
}

.upload-zone h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.upload-zone p {
    color: #2d2d2d;
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.formats {
    color: #4A5568 !important;
    font-size: 0.9rem !important;
    margin-top: 15px;
    font-weight: 500;
}

.preview-section {
    margin-top: 30px;
}

.preview-section h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-section h3 span {
    background: #FF6B35;
    color: white;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 1rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    opacity: 0;
}

.preview-item:hover .remove-btn {
    opacity: 1;
}

.preview-item .remove-btn:hover {
    background: rgba(255, 59, 48, 1);
    transform: scale(1.1);
}

/* Badges de statut IA */
.ai-status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.ai-status-badge.processing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.ai-status-badge.success {
    background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
}

.ai-status-badge.error {
    background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 15px 35px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #FF6B35;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    background: #ff8c5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: white;
    color: #FF6B35;
    border: 2px solid #FF6B35;
}

.btn-secondary:hover {
    background: #fffaf7;
    transform: translateY(-2px);
}

.btn-primary svg,
.btn-secondary svg {
    flex-shrink: 0;
}

/* Carte "Ajouter des images" dans la grille */
.add-more-card {
    background: #F7FAFC;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed #CBD5E0;
    transition: all 0.3s ease;
}

.add-more-card:hover {
    transform: translateY(-5px);
    background: #EDF2F7;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #FF6B35;
}

.add-more-content {
    text-align: center;
    color: #4A5568;
    pointer-events: none;
}

.add-more-content svg {
    margin-bottom: 10px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.add-more-card:hover .add-more-content svg {
    opacity: 1;
    stroke: #FF6B35;
}

.add-more-content p {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    opacity: 0.8;
}

.add-more-card:hover .add-more-content p {
    opacity: 1;
    color: #FF6B35;
}

/* ===================================
   RESPONSIVE MOBILE OPTIMISÉ
   =================================== */
@media (max-width: 768px) {

    /* Body - padding-top pour compenser header fixe */
    body {
        padding: 0;
        padding-top: 60px;
        overflow-x: hidden;
    }

    /* Container */
    .container {
        padding: 16px;
        margin-top: 0 !important;
    }

    /* Header texte */
    header {
        padding: 20px 0 12px !important;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.6rem !important;
        margin-bottom: 6px;
    }

    .subtitle-bicolor {
        font-size: 1.2rem !important;
        margin-bottom: 12px;
    }

    header p {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .limit-badge {
        padding: 8px 16px;
        font-size: 0.85rem;
        gap: 8px;
    }

    .limit-badge .gift-icon {
        font-size: 1.1rem;
    }

    /* Main card */
    main {
        padding: 20px 16px;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    }

    /* Upload zone mobile */
    .upload-zone {
        padding: 32px 16px;
        min-height: 200px;
        border-radius: 12px;
    }

    .upload-zone svg.upload-icon {
        width: 52px !important;
        height: 52px !important;
        margin-bottom: 12px;
    }

    .upload-zone h2 {
        font-size: 1.2rem !important;
        margin-bottom: 6px;
    }

    .upload-zone p {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }

    .formats {
        font-size: 0.8rem !important;
        margin-top: 10px;
    }

    /* Preview section */
    .preview-section {
        margin-top: 20px;
    }

    .preview-section h3 {
        font-size: 1.1rem;
        margin-bottom: 14px;
    }

    /* Preview grid : 2 colonnes sur mobile */
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    /* Remove btn : toujours visible sur mobile (pas de hover) */
    .preview-item .remove-btn {
        opacity: 1;
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: 6px;
        right: 6px;
    }

    /* Boutons actions mobile */
    .actions {
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
        justify-content: center;
        border-radius: 10px;
    }

    /* Nav links */
    .nav-links {
        display: none;
    }

    /* Footer mobile */
    .footer {
        padding: 24px 16px;
        font-size: 13px;
        text-align: center;
    }
}

/* Très petit mobile */
@media (max-width: 400px) {
    body {
        padding-top: 60px;
    }

    header h1 {
        font-size: 1.4rem !important;
    }

    .subtitle-bicolor {
        font-size: 1rem !important;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

    main {
        padding: 16px 12px;
    }

    .upload-zone {
        padding: 24px 12px;
    }
}
