/* style.css - Photobooth Editor V13 */
:root {
    --primary: #2196F3;
    --dark: #2c3e50;
    --light: #f5f6fa;
    --border: #dcdde1;
    --sidebar-w: 360px;
}

body { margin:0; padding:0; font-family: 'Open Sans', sans-serif; background: var(--light); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
* { box-sizing: border-box; }

/* HEADER */
#top-bar { height: 50px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 15px; flex-shrink: 0; z-index: 20; }
.logo-area { font-weight: bold; color: var(--dark); font-size: 1.1em; }

.presets-area { display: flex; gap: 10px; }
.btn-pill { background: #eee; border: none; padding: 6px 15px; border-radius: 20px; font-size: 0.85em; cursor: pointer; transition: 0.2s; color: #555; font-weight: 600; }
.btn-pill:hover { background: var(--primary); color: white; }

.btn-save { background: #27ae60; color: white; font-weight: bold; padding: 8px 20px; border-radius: 4px; border: none; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.btn-save:hover { background: #219150; }

/* LAYOUT PRINCIPAL */
.layout { display: flex; flex: 1; overflow: hidden; }

/* SIDEBAR */
.sidebar { width: var(--sidebar-w); background: white; border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; flex-shrink: 0; }
.panel { padding: 15px; border-bottom: 1px solid var(--border); }
.panel h3 { font-weight: bold; color: #95a5a6; text-transform: uppercase; font-size: 0.75em; margin: 0 0 10px 0; letter-spacing: 1px; }

/* Elements Formulaire */
.row { display: flex; gap: 5px; margin-bottom: 8px; align-items: center; }
.input-std { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.btn-icon { width: 36px; height: 36px; border: 1px solid #ccc; background: #f8f9fa; border-radius: 4px; cursor: pointer; font-size: 1.2em; display: flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: #e2e6ea; }

.chk-lbl { font-size: 0.9em; display: flex; align-items: center; gap: 5px; cursor: pointer; color: #333; margin-bottom: 5px; }
.check-label { font-size: 0.85em; display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* Onglets Format */
.tabs { display: flex; margin-bottom: 10px; background: #ecf0f1; border-radius: 5px; padding: 3px; }
.tab-btn { flex: 1; border: none; background: transparent; padding: 8px; cursor: pointer; font-weight: 600; color: #7f8c8d; border-radius: 4px; transition: 0.2s; }
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.hidden { display: none; }

/* Upload buttons */
.file-input { font-size: 0.8em; margin-bottom: 5px; width: 100%; }

/* Style Bar (Ombre/Couleur) */
.style-bar { background: #f1f2f6; padding: 8px; border-radius: 6px; justify-content: space-between; }
.color-dot { width: 30px; height: 30px; padding: 0; border: 2px solid white; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px #ccc; }

/* Carte Texte */
.txt-card { background: #fff; border: 1px solid #e1e1e1; border-radius: 6px; padding: 10px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.card-head { font-size: 0.7em; font-weight: 700; color: #b2bec3; text-transform: uppercase; margin-bottom: 5px; }
textarea { width: 100%; border: 1px solid #ddd; border-radius: 4px; resize: vertical; padding: 5px; font-family: inherit; font-size: 14px; min-height: 40px; }

/* Contrôles Texte (Flèches & Fontes) */
.controls-row { display: flex; gap: 10px; margin-top: 8px; }

.arrows-pad { display: flex; align-items: center; gap: 2px; }
.v-arrows { display: flex; flex-direction: column; gap: 2px; }
.move-btn { width: 28px; height: 28px; border: 1px solid #ced6e0; background: #fff; border-radius: 3px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #555; }
.move-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.font-opts { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.font-sel { flex: 1; padding: 2px; border: 1px solid #ccc; border-radius: 3px; }
.btn-center { width: 100%; font-size: 0.8em; background: #f1f2f6; border: 1px solid #ddd; padding: 3px; cursor: pointer; border-radius: 3px; color: #555; }
.btn-center:hover { background: #dfe4ea; }

.tiny-in { width: 45px; padding: 2px; text-align: center; border: 1px solid #ccc; border-radius: 3px; }
.toggle { font-size: 0.85em; display: flex; align-items: center; gap: 3px; cursor: pointer; margin-right: 8px; font-weight: 600; color: #555; }

/* BAS DE SIDEBAR */
#links { margin-top: 10px; font-size: 0.9em; }
#links a { display: block; color: var(--primary); font-weight: bold; text-decoration: none; margin-bottom: 5px; }
.btn-link { background: none; border: none; color: #7f8c8d; text-decoration: underline; cursor: pointer; font-size: 0.85em; margin-top: 5px; padding: 0; }
#clientLinkBox { background: #e8f5e9; padding: 8px; border-radius: 4px; margin-top: 5px; border: 1px solid #c8e6c9; }

/* ZONE DE TRAVAIL (Droite) */
.workspace-area { flex: 1; background: #c0c5ca; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.canvas-wrapper { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

canvas { 
    background: white; 
    box-shadow: 0 15px 50px rgba(0,0,0,0.3); 
    max-width: 90%; max-height: 85%; 
    touch-action: none; /* CRUCIAL pour le drag tactile */
}

/* MINIATURE */
.mini-view { position: absolute; bottom: 20px; right: 20px; width: 140px; height: auto; border: 4px solid white; box-shadow: 0 5px 15px rgba(0,0,0,0.2); cursor: pointer; transition: transform 0.2s; z-index: 50; background: #fff; border-radius: 4px; overflow: hidden; }
.mini-view:hover { transform: scale(1.05); border-color: var(--primary); }
.mini-view canvas { width: 100%; height: auto; box-shadow: none; pointer-events: none; }
.mini-view span { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.6); color: white; font-size: 0.75em; text-align: center; padding: 3px 0; }

.help-msg { position: absolute; bottom: 15px; background: rgba(255,255,255,0.85); padding: 5px 15px; border-radius: 20px; font-size: 0.85em; color: #555; pointer-events: none; backdrop-filter: blur(2px); }

/* Responsive Mobile */
@media (max-width: 900px) {
    .layout { flex-direction: column-reverse; }
    .sidebar { width: 100%; height: 50%; border-right: none; border-top: 1px solid #ccc; padding-bottom: 60px; /* Espace pour scroll */ }
    .workspace-area { height: 50%; background: #bdc3c7; }
    canvas { max-width: 95%; max-height: 95%; }
    .mini-view { right: 10px; bottom: 10px; width: 80px; }
    #top-bar { padding: 0 10px; }
    .presets-area { display: none; /* Cache presets rapides sur mobile */ }
}