/* --- GLOBAL RESET & VARIABLES --- */
:root {
    --primary: #1a237e; /* Bleu Nuit */
    --secondary: #ff7043; /* Corail */
    --secondary-dark: #e64a19; /* Corail foncé pour les hovers */
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #263238;
    --text-light: #78909c;
    --border: #e0e0e0;
    --success: #43a047;
    --danger: #e53935;
    --gold: #ffb300; /* Doré pour le bouton Pro */
}

/* Règle d'or pour le dimensionnement */
html { box-sizing: border-box; overflow-x: hidden; }
*, *::before, *::after { box-sizing: inherit; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0; padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex; flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

/* --- HEADER --- */
header {
    background: var(--surface); padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 100;
    width: 100%;
}
.brand { display: flex; align-items: center; gap: 10px; }

.app-logo {
    height: 40px;
    width: auto;
    max-width: 50px;
    object-fit: contain;
    display: block;
}

.brand h1 { margin: 0; color: var(--primary); font-size: 1.5rem; font-weight: 800; }
.tagline {
    font-size: 0.9rem; color: var(--text-light);
    display: none; white-space: nowrap;
}
.privacy-badge { 
    font-size: 0.75rem; background: transparent; color: var(--text-light); 
    padding: 3px 10px; border-radius: 20px; 
    font-weight: 600; cursor: default; display: flex; align-items: center; gap: 5px;
}

/* --- CONTROLS --- */
.controls { display: flex; gap: 10px; }
button { cursor: pointer; border: none; padding: 8px 16px; border-radius: 6px; font-weight: 600; transition: all 0.2s; font-size: 0.9rem; }

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

/* Bouton d'action principale (ex: Ouvrir la séance) en Corail */
.btn-action { 
    background: var(--secondary); 
    color: white; 
    box-shadow: 0 4px 6px rgba(255, 112, 67, 0.3); 
}
.btn-action:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
}

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f5f5f5; }

/* RETOUR ARRIÈRE : Bouton Pro en Doré (Gold) pour contraste avec la couronne */
.btn-pro { 
    background: var(--gold); 
    color: #3e2723; /* Texte brun foncé pour lisibilité sur jaune */
    display: flex; 
    align-items: center; 
    gap: 5px;
    box-shadow: 0 2px 5px rgba(255, 179, 0, 0.3);
}
.btn-pro:hover {
    background: #ffca28; /* Doré légèrement plus clair au survol */
    transform: translateY(-1px);
}

.btn-add-row {
    width: 100%; padding: 15px; border: 2px dashed #90a4ae; background: #ffffff; color: #546e7a;
    font-weight: 700; font-size: 1rem; border-radius: 8px; margin-bottom: 20px;
    transition: all 0.2s ease; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-add-row:hover { border-color: var(--primary); color: var(--primary); background: #e8eaf6; transform: translateY(-2px); }

/* --- MAIN CONTAINER --- */
main {
    flex: 1; max-width: 950px; margin: 2rem auto; width: 95%;
    background: var(--surface); border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 2rem; position: relative; overflow: hidden;
}

/* --- HERO LANDING --- */
.hero-section { text-align: center; padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid #eee; }
.hero-title { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin: 0 0 10px 0; line-height: 1.2; }
.hero-subtitle { font-size: 1.2rem; color: var(--text-light); max-width: 600px; margin: 0 auto 30px auto; }

.value-props { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
.prop-badge {
    display: flex; align-items: center; gap: 8px;
    background: transparent; color: var(--text-light);
    padding: 5px 0; font-size: 0.95rem; font-weight: 500;
    border: none; cursor: default;
}
.prop-badge .prop-icon { 
    color: var(--success); font-size: 1.2rem;
}

/* --- SETUP PANEL --- */
.templates { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.templates button {
    background: white; border: 1px solid var(--primary); color: var(--primary);
    padding: 10px 20px; border-radius: 50px; font-weight: 600;
    box-shadow: 0 2px 5px rgba(26, 35, 126, 0.1); transition: all 0.2s ease;
}
.templates button:hover {
    background: var(--primary); color: white;
    transform: translateY(-2px); box-shadow: 0 4px 8px rgba(26, 35, 126, 0.2);
}

.meeting-meta { 
    background: #e3f2fd; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    border: 1px solid #bbdefb;
    width: 100%;
}
.time-input { padding: 8px; border: 1px solid #90caf9; border-radius: 4px; font-size: 1rem; font-weight: bold; }

.agenda-builder { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.agenda-builder th { text-align: left; color: var(--text-light); border-bottom: 2px solid var(--border); padding: 10px; }
.agenda-builder td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
.agenda-builder input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 1rem; }
.calculated-time { color: var(--primary); font-weight: 600; background: #e8eaf6; padding: 4px 8px; border-radius: 4px; font-size: 0.9rem; }
.summary-bar { background: #fafafa; padding: 15px; border-radius: 8px; display: flex; justify-content: space-between; font-weight: 600; color: var(--text); border: 1px solid #eee; margin-bottom: 20px; }

/* --- ACTIVE PANEL --- */
#active-panel { display: none; text-align: center; }
.focus-header { margin-bottom: 2rem; }
.timer-display { font-size: 6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--primary); margin: 1rem 0; }
.timer-display.danger { color: var(--danger); }
.current-step-title { font-size: 2rem; margin: 0; color: var(--text); }

.focus-list { list-style: none; padding: 0; margin-top: 3rem; text-align: left; border-top: 1px solid var(--border); }
.focus-item { padding: 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; transition: all 0.3s; }
.focus-item.active { opacity: 1; background: white; transform: scale(1.02); box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-left: 5px solid var(--secondary); font-weight: bold; }
.focus-item.past { opacity: 0.4; } .focus-item.future { opacity: 0.5; }

.focus-time { 
    font-weight: 700; color: var(--primary); background: #e8eaf6; 
    padding: 4px 10px; border-radius: 4px; margin-right: 15px; font-size: 0.95rem; min-width: 60px; text-align: center;
}

.edit-duration-input { width: 50px; padding: 4px; border: 1px solid #ccc; border-radius: 4px; font-weight: bold; color: var(--text); text-align: center; font-size: 0.9rem; }
.btn-delete-mini { background: #ffebee; color: var(--danger); border: 1px solid #ffcdd2; border-radius: 4px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem; line-height: 1; margin-left: 5px; }
.btn-delete-mini:hover { background: var(--danger); color: white; }

/* Nouveau bloc de fin de séance */
#meeting-finished-feedback {
    display: none; 
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    max-width: 500px;
    width: 100%;
    animation: fadeIn 1s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- REPORT PANEL --- */
#report-panel { display: none; }
.report-summary-box { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; margin-bottom: 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; text-align: center; }
.summary-item label { display: block; color: var(--text-light); font-size: 0.85rem; margin-bottom: 5px; }
.summary-item .value { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.summary-item .value.gap-bad { color: var(--danger); } .summary-item .value.gap-good { color: var(--success); }

.report-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.report-table th { background: var(--primary); color: white; padding: 12px; text-align: left; }
.report-table td { padding: 12px; border-bottom: 1px solid #eee; }
.report-header { text-align: center; margin-bottom: 30px; border-bottom: 2px solid var(--primary); padding-bottom: 20px; }
.diff-badge { padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.9rem; }
.diff-good { background: #e8f5e9; color: #2e7d32; } .diff-bad { background: #ffebee; color: #c62828; } .diff-neutral { background: #eee; color: #666; }

.progress-container { position: fixed; bottom: 0; left: 0; width: 100%; height: 6px; background: #e0e0e0; z-index: 100; }
.progress-bar { height: 100%; background: var(--secondary); width: 0%; transition: width 1s linear; }

/* --- FOOTER --- */
.app-footer {
    background-color: var(--primary);
    color: white;
    padding: 3rem 2rem 2rem 2rem;
    margin-top: auto;
    font-size: 0.9rem;
    width: 100%;
}

.footer-content { max-width: 950px; margin: 0 auto; display: flex; flex-direction: column; gap: 30px; }
.footer-brand-section { text-align: left; max-width: 600px; }
.footer-brand-identity { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.footer-logo-img { height: 40px; width: auto; }
.footer-title { font-size: 1.5rem; font-weight: 800; color: white; line-height: 1; }
.footer-description { font-size: 0.95rem; line-height: 1.6; color: rgba(255, 255, 255, 0.9); margin: 0; }
.footer-bottom-section { display: flex; flex-direction: column; gap: 10px; }
.footer-feedback-row { text-align: left; }
.footer-link { color: white; text-decoration: none; font-weight: 600; opacity: 0.9; transition: opacity 0.2s; border-bottom: 1px dotted rgba(255,255,255,0.5); padding-bottom: 2px; }
.footer-link:hover { opacity: 1; border-bottom-style: solid; }
.footer-legal-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 15px; margin-top: 10px; font-size: 0.85rem; font-weight: 300; color: rgba(255, 255, 255, 0.7); }
.print-footer { display: none; }

/* --- MODALE PRO --- */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.5); 
    display: none; justify-content: center; align-items: center; 
    z-index: 2000; 
}
.modal-overlay.open { display: flex; }
.modal { background: white; padding: 2rem; border-radius: 12px; width: 90%; max-width: 500px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

.switch { position: relative; display: inline-block; width: 40px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(16px); }

/* --- ZONE ACHAT (CREEM) --- */
.modal-sales-area {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background-color: #fff3e0; /* Fond orange très pâle */
    border: 1px dashed var(--secondary);
    border-radius: 8px;
}

/* Bouton d'achat maintenu en Corail (Validé) */
.btn-buy-creem {
    background-color: var(--secondary);
    color: white;
    padding: 14px 25px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(255, 112, 67, 0.4);
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.btn-buy-creem:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 112, 67, 0.5);
}

.sales-subtext {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 10px;
    margin-bottom: 0;
}

.activation-area {
    margin-top: 25px; 
    border-top: 1px solid #eee; 
    padding-top: 15px;
}

/* --- MOBILE OPTIMIZATION --- */
@media (min-width: 600px) { .tagline { display: inline; } }

@media (max-width: 600px) {
    header { padding: 0.6rem 0.5rem; }
    .app-logo { height: 32px; }
    .brand h1 { font-size: 1.2rem; }
    .privacy-badge { display: none; }
    .btn-outline, .btn-pro { padding: 8px 12px; font-size: 0.8rem; }
    main { width: 100%; padding: 1rem 0.5rem; margin: 0; border-radius: 0; box-shadow: none; min-height: calc(100vh - 60px); }
    .hero-section { padding-bottom: 1rem; margin-bottom: 1rem; }
    .hero-title { font-size: 1.6rem; margin-bottom: 10px; word-wrap: break-word; line-height: 1.2; }
    .hero-subtitle { font-size: 1rem; margin-bottom: 15px; }
    .value-props { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
    .prop-badge { width: 100%; justify-content: center; margin: 0; }
    .meeting-meta { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 100%; max-width: 100%; padding: 15px; box-sizing: border-box; }
    .time-input { width: 100%; max-width: 100%; padding: 12px; font-size: 1.1rem; -webkit-appearance: none; appearance: none; background-color: #fff; border-radius: 4px; margin: 0; box-sizing: border-box; }
    .templates { gap: 8px; } .templates button { width: 100%; margin: 0; }
    
    .agenda-builder { display: block; width: 100%; }
    .agenda-builder thead { display: none; }
    .agenda-builder tbody { display: block; width: 100%; }
    .agenda-builder tr { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid #eee; padding: 8px 0; width: 100%; box-sizing: border-box; }
    .agenda-builder td:nth-child(1) { display: none; }
    .agenda-builder td:nth-child(2) { width: 45px; font-size: 0.75rem; padding: 0; flex-shrink: 0; }
    .agenda-builder td:nth-child(3) { flex: 1; padding: 0; min-width: 0; }
    .agenda-builder td:nth-child(4) { width: 45px; padding: 0; flex-shrink: 0; }
    .agenda-builder td:nth-child(5) { width: 30px; padding: 0; text-align: right; flex-shrink: 0; }
    .agenda-builder input { padding: 8px 5px; font-size: 0.9rem; border-radius: 4px; min-width: 0 !important; width: 100%; }
    .agenda-builder .input-duration { text-align: center; padding: 8px 0; }
    
    .focus-header { margin-bottom: 1rem; }
    .timer-display { font-size: 3.5rem; margin: 1rem 0; }
    .current-step-title { font-size: 1.4rem; line-height: 1.3; margin-bottom: 5px; word-wrap: break-word; }
    #active-controls { gap: 10px; width: 100%; margin-bottom: 1.5rem; }
    #active-controls button { flex: 1; padding: 12px; font-size: 1rem; }
    #meeting-finished-feedback { width: 98%; box-sizing: border-box; padding: 15px; margin: 15px auto; }
    .focus-list { margin-top: 1.5rem; } .focus-item { padding: 10px 0; }
    .focus-time { margin-right: 8px; font-size: 0.8rem; padding: 4px 6px; min-width: 50px; }
    .print-footer { display: none !important; }
    .app-footer { padding: 2rem 1.5rem; text-align: center; }
    .footer-brand-section { margin: 0 auto; text-align: center; }
    .footer-brand-identity { justify-content: center; }
    .footer-feedback-row { text-align: center; margin-top: 10px; }
    .footer-legal-row { flex-direction: column; gap: 8px; justify-content: center; }
}

/* --- PRINT PDF --- */
@media print {
    body { background: white; color: #000 !important; }
    header .controls, .controls, #setup-panel, #active-panel, .progress-container, .hero-section, .no-print, .app-footer { display: none !important; }
    #report-panel { display: block !important; box-shadow: none; margin: 0; width: 100%; padding: 0; }
    .report-header h2, .print-footer strong, span[style*="www.lacadence.app"] { color: var(--primary) !important; -webkit-print-color-adjust: exact; }
    #report-date, .print-footer, .tagline, .privacy-badge, .summary-item label, .summary-item .value, .report-table th, .report-table td, .diff-badge { color: #000 !important; }
    .report-summary-box, .report-table th, .report-table td, .print-footer, .privacy-badge { border-color: #000 !important; }
    .report-table th, .report-summary-box, .diff-badge { background: none !important; }
    .print-footer { display: block !important; position: fixed; bottom: 0; left: 0; width: 100%; }
}