/* ============================================
   public/css/style.css
   Design : dark, doux, mobile-first
   ============================================ */

/* ── Reset & variables ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-deep:      #0f1117;
    --bg-card:      #1a1d27;
    --bg-card-alt:  #222636;
    --text-primary: #eef0f4;
    --text-muted:   #7a7f8e;
    --accent-left:  #e88fa2;   /* rose – sein gauche */
    --accent-right: #7db8e8;   /* bleu – sein droite */
    --accent-green: #6fcf97;   /* validation */
    --accent-weight:#c9a96e;   /* or – poids */
    --accent-danger:#e06c6c;
    --radius:       12px;
    --radius-sm:    8px;
    --nav-height:   64px;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ── Layout de base ── */
.page-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px;
    padding-bottom: calc(var(--nav-height) + 24px); /* espace pour la nav */
    min-height: 100vh;
}

/* ── Navigation bas d'écran ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--accent-green);
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ── Titre de page ── */
.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    letter-spacing: -0.3px;
}

/* ============================================
   HOME – Résumé + Formulaire tétée
   ============================================ */

/* Carte résumé */
.summary-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.summary-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-item.summary-weight {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(201,169,110,0.12), rgba(201,169,110,0.04));
    border: 1px solid rgba(201,169,110,0.2);
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Sélecteur sein gauche/droite */
.side-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.side-btn {
    flex: 1;
    cursor: pointer;
}

.side-btn input[type="radio"] {
    display: none;   /* caché, on style le label */
}

.side-btn-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 12px;
    border-radius: var(--radius);
    border: 2px solid rgba(255,255,255,0.07);
    background: var(--bg-card);
    transition: all 0.2s ease;
}

.side-icon {
    font-size: 32px;
    transition: transform 0.2s;
}

.side-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.2s;
}

/* État sélectionné – Gauche */
#label-left input:checked + .side-btn-inner {
    border-color: var(--accent-left);
    background: rgba(232,143,162,0.1);
    box-shadow: 0 0 18px rgba(232,143,162,0.15);
}
#label-left input:checked + .side-btn-inner .side-text {
    color: var(--accent-left);
}
#label-left input:checked + .side-btn-inner .side-icon {
    transform: scale(1.15);
}

/* État sélectionné – Droite */
#label-right input:checked + .side-btn-inner {
    border-color: var(--accent-right);
    background: rgba(125,184,232,0.1);
    box-shadow: 0 0 18px rgba(125,184,232,0.15);
}
#label-right input:checked + .side-btn-inner .side-text {
    color: var(--accent-right);
}
#label-right input:checked + .side-btn-inner .side-icon {
    transform: scale(1.15);
}

/* Ligne date / heure */
.datetime-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.dt-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dt-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dt-group input {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.dt-group input:focus {
    border-color: var(--accent-green);
}

/* Note */
.note-group {
    margin-bottom: 20px;
}

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

.note-group input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
}

.note-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.note-group input:focus {
    border-color: var(--accent-green);
}

/* Bouton valider */
.btn-validate {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #4caf7a, var(--accent-green));
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(111,207,151,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}

.btn-validate:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(111,207,151,0.2);
}

.btn-validate-weight {
    background: linear-gradient(135deg, #b8935a, var(--accent-weight));
    box-shadow: 0 4px 14px rgba(201,169,110,0.3);
}

/* Lien historique */
.link-history {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.link-history:hover { color: var(--text-primary); }

/* ============================================
   HISTORIQUE – Liste tétées
   ============================================ */

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.export-buttons {
    display: flex;
    gap: 8px;
}

.btn-export {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s, opacity 0.15s;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-export:active {
    transform: scale(0.96);
}

.btn-export-excel {
    background: linear-gradient(135deg, #1e7e34, #28a745);
    color: #fff;
}

.btn-export-pdf {
    background: linear-gradient(135deg, #d32f2f, #e53935);
    color: #fff;
}

.day-separator {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: capitalize;
    padding: 12px 0 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
    margin-top: 4px;
}

.feeding-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.feeding-card:active { background: var(--bg-card-alt); }

/* Badge côté */
.side-badge {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.side-badge.left {
    background: rgba(232,143,162,0.15);
    color: var(--accent-left);
}

.side-badge.right {
    background: rgba(125,184,232,0.15);
    color: var(--accent-right);
}

/* Corps de la carte */
.feeding-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feeding-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feeding-side-label {
    font-size: 15px;
    font-weight: 600;
}

.feeding-time {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.feeding-note {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   POIDS – Hero + Liste
   ============================================ */

.weight-hero {
    text-align: center;
    padding: 22px 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.weight-hero-value {
    font-size: 52px;
    font-weight: 800;
    color: var(--accent-weight);
    letter-spacing: -2px;
    line-height: 1;
}

.weight-hero-unit {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.weight-hero-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Formulaire poids */
.weight-form {
    margin-bottom: 28px;
}

.weight-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* Liste pesées */
.weight-list-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.weight-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
}

.weight-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weight-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-weight);
}

.weight-card-date {
    font-size: 13px;
    color: var(--text-muted);
}

.weight-card-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   Bouton supprimer (commun)
   ============================================ */

.delete-form {
    margin: 0;
}

.btn-delete {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(224,108,108,0.1);
    color: var(--accent-danger);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    -webkit-appearance: none;
}

.btn-delete:active {
    background: rgba(224,108,108,0.25);
}

/* Message vide */
.empty-msg {
    color: var(--text-muted);
    font-size: 15px;
    text-align: center;
    margin-top: 40px;
}

/* ── Input date/time – style natif sombre ── */
input[type="date"],
input[type="time"],
input[type="number"] {
    color-scheme: dark;
}

/* ============================================
   BARRE D'EXPORT (Excel + PDF)
   ============================================ */

.export-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-export {
    flex: 1;
    display: block;
    text-align: center;
    padding: 11px 0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-export:active {
    transform: scale(0.96);
}

/* Excel – vert sombre */
.btn-export-xlsx {
    background: linear-gradient(135deg, #1e7a4f, #2ecc71);
    color: #fff;
    box-shadow: 0 3px 10px rgba(46,204,113,0.3);
}

/* PDF – rouge/orange */
.btn-export-pdf {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    box-shadow: 0 3px 10px rgba(231,76,60,0.3);
}

/* ============================================
   BOUTON EDIT (crayon) sur les cartes
   ============================================ */

.card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-edit {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(111,207,151,0.1);
    color: var(--accent-green);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    -webkit-appearance: none;
}

.btn-edit:active {
    background: rgba(111,207,151,0.25);
}

/* ============================================
   DRAWER – Modifier le côté
   ============================================ */

/* Overlay (fond semi-transparent) */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.drawer-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Le drawer lui-même */
.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    padding: 12px 24px 40px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.drawer.visible {
    transform: translateY(0);
}

/* Petit trait en haut du drawer */
.drawer-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: 0 auto 16px;
}

/* Titre */
.drawer-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 20px;
}

/* Deux boutons gauche / droite dans le drawer */
.drawer-side-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.drawer-side-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px 12px;
    border-radius: var(--radius);
    border: 2px solid rgba(255,255,255,0.07);
    background: var(--bg-deep);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

.drawer-side-btn:active {
    transform: scale(0.96);
}

.drawer-side-icon {
    font-size: 28px;
}

.drawer-side-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.2s;
}

/* Gauche – état actif */
.drawer-side-left.active {
    border-color: var(--accent-left);
    background: rgba(232,143,162,0.1);
    box-shadow: 0 0 16px rgba(232,143,162,0.15);
}
.drawer-side-left.active .drawer-side-text { color: var(--accent-left); }

/* Droite – état actif */
.drawer-side-right.active {
    border-color: var(--accent-right);
    background: rgba(125,184,232,0.1);
    box-shadow: 0 0 16px rgba(125,184,232,0.15);
}
.drawer-side-right.active .drawer-side-text { color: var(--accent-right); }

/* Bouton annuler */
.drawer-cancel {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    -webkit-appearance: none;
    transition: background 0.2s;
}

.drawer-cancel:active {
    background: rgba(255,255,255,0.05);
}
