@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', -apple-system, sans-serif;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
    color: #111827;
    line-height: 1.6;
    min-height: 100vh;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 100px;
    min-height: 100vh;
}

/* HEADER - BLANC COMME AVANT */
header {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

header h1 {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-back {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #10b981;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 12px;
}

/* MAIN - CARDS AVEC OMBRES */
main {
    padding: 24px;
}

/* DASHBOARD CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid rgba(16, 185, 129, 0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

.stat-card .icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.stat-card .value {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.stat-card .label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}

/* BUTTONS - GRADIENTS PREMIUM */
.btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
}

/* ACTION BUTTONS */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.action-btn {
    background: white;
    border: 2px solid #10b981;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: #059669;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.action-btn:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.action-btn .icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

/* FORMS - MODERN */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    font-size: 15px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* MEAL TYPES */
.meal-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.meal-type {
    padding: 16px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.meal-type:hover {
    border-color: #10b981;
    background: #f0fdf4;
    transform: translateY(-2px);
}

.meal-type.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: #059669;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

/* CHIPS - COLORÉS */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 10px 16px;
    border-radius: 10px;
    border: 2px solid #d1d5db;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    color: #374151;
}

.chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.chip:active {
    transform: scale(0.95);
}

/* INTENSITY SLIDER */
.intensity-slider {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444);
    outline: none;
    -webkit-appearance: none;
}

.intensity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 3px solid #10b981;
}

.intensity-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 3px solid #10b981;
}

/* CHECKBOXES */
.checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    font-weight: 500;
}

.checkbox-label:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #10b981;
}

/* TIMELINE */
.timeline-item {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid #10b981;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-item.symptom {
    border-left-color: #f59e0b;
}

/* BOTTOM NAV - GRADIENT SUBTIL */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.98) 100%);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 12px 8px;
    border-top: 2px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    text-decoration: none;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    border-radius: 12px;
}

.nav-item:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.nav-item.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ALERT */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.alert-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

/* RECENT ACTIVITY */
.recent-activity {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border: 2px solid rgba(16, 185, 129, 0.1);
}

.recent-activity h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
    color: #111827;
}

.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.activity-item:last-child {
    border-bottom: none;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state .icon {
    font-size: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    font-weight: 600;
}

/* PWA SAFE AREAS */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    header {
        padding-top: calc(20px + env(safe-area-inset-top));
    }
    
    .bottom-nav {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .meal-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* PREVENT PULL TO REFRESH */
body {
    overscroll-behavior-y: contain;
}

/* SMOOTH SCROLLING */
html {
    scroll-behavior: smooth;
}

/* SELECTION COLOR */
::selection {
    background: #d1fae5;
    color: #065f46;
}
