/* style.css */

/* --- 1. VARIABLES & RESET --- */
:root {
    /* Palette Corporate (Slate) */
    --bg-app: #f1f5f9;          /* Gris très clair pour le fond */
    --bg-surface: #ffffff;      /* Blanc pour les cartes */
    --bg-sidebar: #0f172a;      /* Bleu nuit très sombre pour le menu */
    
    --text-main: #1e293b;       /* Texte principal */
    --text-muted: #64748b;      /* Texte secondaire */
    
    --primary: #2563eb;         /* Bleu action (Standard web) */
    --primary-hover: #1d4ed8;
    
    --border: #e2e8f0;          /* Bordures subtiles */
    
    /* Dimensions */
    --sidebar-width-collapsed: 64px;
    --sidebar-width-expanded: 240px;
    --header-height: 60px;
    
    --radius: 6px;              /* Arrondi faible pour faire "Pro" */
}

* { box-sizing: border-box; outline: none; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    font-size: 14px;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- 2. LAYOUT GÉNÉRAL --- */
.main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.page-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 24px; /* Espace autour du contenu */
}

/* --- 3. SIDEBAR (MENU) --- */
.sidebar {
    width: var(--sidebar-width-collapsed);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    padding-top: 10px;
}

.sidebar:hover {
    width: var(--sidebar-width-expanded);
}

.sidebar a {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #94a3b8; /* Gris clair */
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.sidebar a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-left-color: var(--primary);
}

.sidebar-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    margin-right: 16px;
}

.nav-label {
    opacity: 0;
    transition: opacity 0.2s;
    font-weight: 500;
}

.sidebar:hover .nav-label {
    opacity: 1;
}

/* --- 4. FORMULAIRES & INPUTS --- */
.form-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.row { display: flex; gap: 20px; margin-bottom: 16px; }
.col { flex: 1; }

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

input[type="text"], 
input[type="password"], 
input[type="date"], 
input[type="time"], 
input[type="url"], 
select, 
textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.code-area {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    background: #1e293b; /* Dark theme pour le code */
    color: #e2e8f0;
    border: 1px solid #334155;
}

/* --- 5. BOUTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: #fff; border: 1px solid var(--border); color: var(--text-main); }
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-danger { color: #ef4444; background: transparent; }
.btn-danger:hover { background: #fef2f2; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* --- 6. TABLEAUX --- */
.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 12px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

tr:last-child td { border-bottom: none; }
tr:hover { background-color: #f8fafc; }

/* --- 7. ELEMENTS SPECIFIQUES --- */
.badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-blue { background: #eff6ff; color: #1e40af; border: 1px solid #dbeafe; }
.badge-gray { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* --- 8. PREVIEW EMAIL (ZONE GRISÉE) --- */
.preview-wrapper {
    background: #e2e8f0; /* Fond gris pour contraster avec le papier blanc */
    border-left: 1px solid var(--border);
    display: flex;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

.email-paper {
    background: white;
    width: 600px;
    min-height: 800px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Modale */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: center; justify-content: center; z-index: 100;
    backdrop-filter: blur(2px);
}
.modal-box {
    background: white; padding: 24px; border-radius: 8px; width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* style.css */

/* --- MODIFICATION : BLOCS D'INFORMATION (Email & App) --- */

/* Style pour l'application (Admin) - On garde un fond léger */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: flex-start; /* Alignement en haut pour le texte long */
    gap: 12px;
    line-height: 1.5;
}
.alert-info {
    background: #f8fafc; /* Fond gris très clair, plus neutre */
    color: var(--text-main);
    border: 1px solid var(--border); /* Bordure grise subtile */
}

/* NOUVEAU : Style spécifique pour l'intérieur de l'email (Preview) */
/* Ces styles seront injectés directement dans le <head> de l'email généré */
.email-block {
    padding: 15px 0; /* Padding vertical uniquement */
    margin-bottom: 20px;
    border-top: 1px solid #e2e8f0; /* Séparateur fin en haut */
    border-bottom: 1px solid #e2e8f0; /* Séparateur fin en bas */
    color: #334155;
    font-size: 15px;
    line-height: 1.6;
}

.email-block-title {
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 16px;
}

/* style.css (Ajoutez ceci à la fin) */

/* --- 9. MODE ÉCRAN SCINDÉ (Pour Master Template) --- */
.workspace-split {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - var(--header-height));
}

/* Zone Code (Gauche) */
.pane-code {
    width: 50%;
    background: #0f172a; /* Bleu nuit */
    display: flex;
    flex-direction: column;
    border-right: 1px solid #334155;
}

.code-toolbar {
    height: 40px;
    padding: 0 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.full-editor {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    background: transparent;
    color: #e2e8f0;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 20px;
}

/* Zone Preview (Droite) */
.pane-preview {
    width: 50%;
    background: #e2e8f0;
    display: flex;
    flex-direction: column;
}

.preview-toolbar {
    height: 40px;
    background: #cbd5e1;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #94a3b8;
}

.preview-iframe-container {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

.preview-iframe {
    width: 600px;
    height: 800px;
    background: white;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}