/* ==========================================================================
   css/image-to-pdf/image-to-pdf.css
   ========================================================================== */

/* --- HEADER & UPLOAD (Hérité et adapté en Cyan) --- */
.main-header { background: #ffffff; border-bottom: 1px solid #e2e8f0; height: 70px; display: flex; align-items: center; }
.header-container { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.logo-img { height: 36px; object-fit: contain; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-link { color: #334155; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.nav-link:hover, .nav-link.active-link { color: #0ea5e9; } /* Cyan Theme */

.upload-view { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 70px); background: #f8fafc; padding: 2rem; text-align: center; }
.title-badge { background: #e0f2fe; color: #0369a1; padding: 6px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: 800; text-transform: uppercase; margin-bottom: 20px; display: inline-flex; align-items: center; gap: 8px; }
.main-title { font-size: 2.5rem; font-weight: 800; color: #0f172a; margin-top: 0; margin-bottom: 10px; }
.main-subtitle { font-size: 1.1rem; color: #64748b; margin-bottom: 40px; max-width: 650px; }

.upload-zone { background: white; border: 2px dashed #cbd5e1; border-radius: 16px; padding: 60px 20px; width: 100%; max-width: 600px; transition: all 0.3s ease; cursor: pointer; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.upload-zone:hover, .upload-zone.dragover { border-color: #0ea5e9; background: #f0f9ff; }

.icons-group { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 20px; }
.icon-img { font-size: 50px; color: #0ea5e9; }
.icon-arrow { font-size: 24px; color: #cbd5e1; }
.icon-pdf { font-size: 50px; color: #ef4444; } /* Rouge pour symboliser la cible PDF */

.btn-upload { background: #0ea5e9; color: white; border: none; padding: 12px 24px; border-radius: 8px; font-size: 1.1rem; font-weight: 700; cursor: pointer; margin-bottom: 15px; transition: background 0.2s; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2); }
.btn-upload:hover { background: #0284c7; }
.drop-text { color: #94a3b8; font-size: 0.95rem; margin: 0; }

/* --- ESPACE DE TRAVAIL --- */
.workspace-view { display: flex; flex-direction: column; height: calc(100vh - 70px); background: #f1f5f9; }
@media (min-width: 900px) { .workspace-view { flex-direction: row; } }

/* COLONNE GAUCHE (Grille d'images) */
.preview-container { flex: 1; display: flex; flex-direction: column; padding: 2rem; overflow-y: auto; background: #f8fafc; }
.preview-header-area { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; }
.preview-title { font-size: 1.2rem; color: #1e293b; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 10px; }
.preview-title i { color: #0ea5e9; }
.btn-add-more { background: white; border: 1px solid #cbd5e1; color: #475569; padding: 6px 15px; border-radius: 6px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-add-more:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }

/* La grille d'images (Sortable) */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; width: 100%; align-content: start; }
.img-card { position: relative; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); cursor: grab; transition: transform 0.2s, box-shadow 0.2s; border: 2px solid transparent; aspect-ratio: 1 / 1.2; display: flex; align-items: center; justify-content: center; }
.img-card:active { cursor: grabbing; }
.img-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border-color: #0ea5e9; }
.img-card img { width: 100%; height: 100%; object-fit: contain; background: #f1f5f9; padding: 5px; }

.btn-remove-img { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; background: rgba(239, 68, 68, 0.9); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; border: none; opacity: 0; transition: opacity 0.2s, background 0.2s; }
.img-card:hover .btn-remove-img { opacity: 1; }
.btn-remove-img:hover { background: #dc2626; }
.img-number { position: absolute; bottom: 5px; left: 5px; background: rgba(15, 23, 42, 0.7); color: white; font-size: 11px; font-weight: bold; padding: 2px 6px; border-radius: 4px; pointer-events: none; }

/* Ghost class pour le drag and drop */
.sortable-ghost { opacity: 0.4; border: 2px dashed #0ea5e9; background: #e0f2fe; }

/* COLONNE DROITE (Dashboard) */
.action-sidebar { width: 100%; background: white; padding: 2rem; display: flex; flex-direction: column; overflow-y: auto; }
@media (min-width: 900px) { .action-sidebar { width: 380px; border-left: 1px solid #e2e8f0; box-shadow: -4px 0 15px rgba(0,0,0,0.03); } }

.sidebar-title { font-size: 1.3rem; color: #0f172a; font-weight: 800; margin-top: 0; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }
.sidebar-title i { color: #0ea5e9; }
.group-label { font-size: 0.9rem; font-weight: 700; color: #64748b; text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.5px; }
.settings-group { margin-bottom: 25px; transition: opacity 0.3s; }
.mt-auto { margin-top: auto; }

/* Cartes Orientation */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { cursor: pointer; }
.mode-card input { display: none; }
.mode-card-inner { border: 2px solid #e2e8f0; border-radius: 10px; padding: 15px 10px; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.2s; background: #ffffff; }
.mode-card-inner i { color: #94a3b8; transition: color 0.2s; }
.mode-title { font-weight: 700; font-size: 0.95rem; color: #475569; }

.mode-card:hover .mode-card-inner { border-color: #cbd5e1; background: #f8fafc; }
.mode-card input:checked + .mode-card-inner { border-color: #0ea5e9; background: #f0f9ff; }
.mode-card input:checked + .mode-card-inner i { color: #0ea5e9; }
.mode-card input:checked + .mode-card-inner .mode-title { color: #0369a1; }

/* Sélecteurs Segmentés (iOS Style) */
.segmented-control { display: flex; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.segmented-control input { display: none; }
.segmented-control label { flex: 1; text-align: center; padding: 10px 0; font-size: 0.85rem; font-weight: 600; color: #64748b; cursor: pointer; border-radius: 8px; transition: all 0.2s; }
.segmented-control input:checked + label { background: white; color: #0f172a; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Bouton Final */
.btn-action { width: 100%; padding: 1.2rem; background: #0ea5e9; color: white; border: none; border-radius: 12px; font-size: 1.1rem; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.2s; box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3); }
.btn-action:hover { background: #0284c7; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4); }
.btn-action:active { transform: translateY(0); }

/* --- ÉCRAN DE CHARGEMENT PRO --- */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.loading-card { background: white; padding: 40px; border-radius: 16px; text-align: center; max-width: 400px; width: 90%; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.spinner { border: 4px solid #e2e8f0; border-top: 4px solid #0ea5e9; border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-title { font-size: 1.4rem; font-weight: 800; color: #0f172a; margin-bottom: 15px; }
.progress-bar { width: 100%; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-bottom: 15px; }
.progress-fill { width: 0%; height: 100%; background: #0ea5e9; transition: width 0.3s ease; }
.loading-desc { color: #64748b; font-size: 0.95rem; font-weight: 600; }