/* Reset et base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2C3E50;
    background: #F7F9FC;
}

/* Layout conteneur */
.wendy-saisie {
    max-width: 1200px;
    padding: 20px;
    margin: 0 auto;
}

/* Grille de boutons */
.wendy-saisie-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Style des boutons */
.wendy-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 20px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.wendy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: currentColor;
    opacity: 0.8;
}

.wendy-button i {
    font-size: 40px;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.wendy-button span {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #2C3E50;
}

.wendy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.wendy-button:hover i {
    transform: scale(1.1);
}

/* Couleurs des boutons */
.wendy-button.medicaments { color: #4CAF50; }
.wendy-button.crises { color: #FF5722; }
.wendy-button.sommeil { color: #2196F3; }
.wendy-button.autre_evenement { color: #9C27B0; }

/* Formulaires */
.wendy-saisie-form {
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 5px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: none;
}

.wendy-saisie-form.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.wendy-saisie-form h3 {
    color: #2C3E50;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
}

/* Champs de formulaire */
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 6px 10px;
    margin: 2px 0;
    border: 1px solid #E5E9F2;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #F8FAFC;
}

input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2196F3;
    background: white;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Pills médicaments */
.meds-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.med-pill {
    background: #f0f4f8;
    border: 1px solid #e5e9f2;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
}

.med-pill.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.med-pill input[type="checkbox"] {
    display: none;
}

.med-pill i {
    margin-left: 6px;
    font-size: 12px;
}

/* Pills de choix pour crises et sommeil */
.pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.choice-pill {
    background: #f0f4f8;
    border: 1px solid #e5e9f2;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.choice-pill input[type="radio"] {
    display: none;
}

.choice-pill:has(input:checked) {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

label {
    display: flex;
    align-items: center;
    margin: 2px 0;
    font-size: 14px;
    color: #2C3E50;
    line-height: 1.2;
}

/* Bouton de soumission */
.button-primary {
    width: 100%;
    padding: 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 25px;
}

.button-secondary {
    padding: 15px;
    background: #FF5722;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-secondary:hover {
    background: #F4511E;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 87, 34, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .wendy-saisie {
        padding: 15px;
        max-width: 100%;
    }

    .wendy-saisie-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .wendy-button {
        min-height: 100px;
        padding: 12px;
    }

    .wendy-button i {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .wendy-button span {
        font-size: 14px;
    }

    .mobile-form {
        padding: 15px;
    }

    .pills-container {
        gap: 6px;
    }

    .choice-pill, .med-pill {
        padding: 6px 12px;
        font-size: 13px;
    }

    .button-primary,
    .button-secondary {
        padding: 12px;
        font-size: 15px;
    }

    .button-group {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* Styles pour le nouveau sélecteur */
.datetime-container {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    margin: 10px 0;
}

.date-input, .time-input-container {
    flex: 1;
}

.date-input label, .time-input-container label {
    display: block;
    margin-bottom: 5px;
}

.mobile-date, .time-input {
    padding: 10px;
    font-size: 16px;
    border: 2px solid #E5E9F2;
    border-radius: 8px;
    background: white;
    color: #2C3E50;
    width: auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-input:hover {
    border-color: #2196F3;
}

.time-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* Front historique styles */
.wendy-historique {
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 1200px;
    margin: 20px auto;
}

.wendy-historique h2 {
    margin-bottom: 30px;
    color: #2C3E50;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
}

.wendy-historique form {
    background: #F8FAFC;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.wendy-historique .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wendy-historique label {
    font-weight: 500;
    color: #4A5568;
}

.wendy-historique input[type="date"],
.wendy-historique select {
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.wendy-historique .button {
    padding: 10px 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.wendy-historique .button-primary {
    background: #4CAF50;
}

.wendy-historique table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
}

.wendy-historique th {
    background: #F8FAFC;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2D3748;
    border-bottom: 2px solid #E2E8F0;
}

.wendy-historique td {
    padding: 12px;
    border-bottom: 1px solid #E2E8F0;
    color: #4A5568;
}

.wendy-historique tr:last-child td {
    border-bottom: none;
}

.wendy-historique tr:hover {
    background: #F8FAFC;
}

.wendy-historique .empty-message {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

.wendy-historique h2 {
    margin-bottom: 20px;
    color: #2C3E50;
}

.wendy-historique .button {
    display: inline-block;
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.wendy-historique .button-primary {
    background: #4CAF50;
}

.wendy-historique .button:hover {
    opacity: 0.9;
}

.wendy-historique form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.wendy-historique input[type="date"],
.wendy-historique select {
    padding: 6px 10px;
    border: 1px solid #E5E9F2;
    border-radius: 4px;
}
