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

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-bottom: 80px;
    color: #333;
}

/* Container principal */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Titres */
h1 {
    font-size: 2em;
    text-align: center;
    color: #fff;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    animation: bounce 0.5s ease;
}

h2 {
    font-size: 1.5em;
    color: #333;
    margin: 20px 0 15px 0;
}

h3 {
    font-size: 1.2em;
    margin: 10px 0;
}

.subtitle {
    text-align: center;
    color: #fff;
    font-size: 1.1em;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Menu de navigation */
.main-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 10px 5px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    border-top: 4px solid #764ba2;
}

.menu-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-size: 0.85em;
    padding: 8px 5px;
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: bold;
}

.menu-item:hover,
.menu-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    transform: translateY(-3px);
}

.menu-item.logout {
    flex: 0.5;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-family: inherit;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
}

.btn-secondary {
    background: #ddd;
    color: #666;
}

.btn-edit {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.btn-delete {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #fff;
}

.btn-nav {
    background: #fff;
    color: #764ba2;
    padding: 8px 16px;
    font-size: 1.2em;
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    margin: 10px 0;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.9em;
    border-radius: 15px;
}

/* Cards et boxes */
.card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 3px solid #764ba2;
}

.form-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 3px solid #f5576c;
}

.suggestion-box {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 4px solid #ff9a9e;
    animation: pulse 2s infinite;
}

.suggestion-restaurant {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    margin: 15px 0;
}

.suggestion-restaurant .emoji {
    font-size: 1.5em;
}

.suggestion-info {
    color: #666;
    font-size: 1em;
    margin-top: 10px;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-bottom: 0;
}

.login-box {
    background: #fff;
    border-radius: 25px;
    padding: 40px 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    border: 4px solid #764ba2;
    width: 100%;
    max-width: 400px;
}

/* Formulaires */
.form-group {
    margin: 15px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.restaurant-select {
    width: 100%;
    padding: 12px 15px;
    border: 3px solid #ddd;
    border-radius: 15px;
    font-family: inherit;
    font-size: 1em;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.restaurant-select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(118, 75, 162, 0.3);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.form-buttons .btn {
    flex: 1;
}

/* Messages */
.success-message,
.error-message,
.info-message {
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
    font-weight: bold;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 3px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 3px solid #f5c6cb;
}

.info-message {
    background: #d1ecf1;
    color: #0c5460;
    border: 3px solid #bee5eb;
}

/* Stats home */
.stats-home {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border: 3px solid #667eea;
}

.stat-number {
    font-size: 3em;
    font-weight: bold;
    color: #764ba2;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.stat-card-large {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 4px solid #667eea;
}

.stat-number-large {
    font-size: 4em;
    font-weight: bold;
    color: #764ba2;
}

/* Last lunch */
.last-lunch {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border: 3px solid #4facfe;
}

.last-lunch .date {
    font-size: 1.1em;
    color: #764ba2;
    font-weight: bold;
    margin: 10px 0;
}

/* Navigation de date */
.date-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0;
}

.date-display {
    flex: 1;
    text-align: center;
    background: #fff;
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 3px solid #764ba2;
    color: #333;
}

/* Person section */
.person-section {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border: 3px solid #f093fb;
}

/* Restaurants list */
.restaurants-list {
    margin: 20px 0;
}

.restaurants-list.archived {
    margin-top: 40px;
}

.info-text {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

.restaurant-item {
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid #ddd;
}

.restaurant-item.archived-item {
    background: #f5f5f5;
    border: 2px solid #ccc;
    opacity: 0.8;
}

.archived-badge {
    display: inline-block;
    background: #ff9a9e;
    color: #fff;
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: bold;
}

.restaurant-info {
    flex: 1;
}

.restaurant-stats {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

.restaurant-actions {
    display: flex;
    gap: 8px;
}

/* Historique */
.year-section {
    margin: 30px 0;
}

.year-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 15px;
}

.lunch-item {
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid #ddd;
}

.lunch-date {
    font-weight: bold;
    color: #764ba2;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.lunch-details {
    margin: 10px 0;
}

.lunch-person {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}

.person-icon {
    font-size: 1.2em;
}

.person-name {
    font-weight: bold;
    min-width: 60px;
}

.lunch-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* Stats */
.stats-period {
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    margin: 15px 0;
    border: 2px solid #ddd;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.stats-section {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border: 3px solid #4facfe;
}

.top-list {
    margin-top: 15px;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 10px;
}

.rank {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.resto-name {
    flex: 1;
}

.count {
    font-weight: bold;
    color: #764ba2;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chip {
    background: #e9ecef;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 2px solid #ddd;
}

/* Restaurant stats table */
.restaurant-stats-table {
    margin-top: 15px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-row-name {
    min-width: 120px;
    font-weight: bold;
    font-size: 0.9em;
}

.stat-row-bars {
    flex: 1;
}

.stat-bar-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 3px 0;
}

.stat-label-small {
    font-size: 0.8em;
    min-width: 50px;
}

.stat-bar {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    transition: width 0.5s;
}

.stat-bar-fill.steph {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.stat-bar-fill.elena {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.stat-row-total {
    min-width: 40px;
    text-align: right;
    font-weight: bold;
    color: #764ba2;
}

/* États vides */
.empty-state {
    text-align: center;
    color: #999;
    padding: 30px;
    font-style: italic;
}

.total-count {
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    margin: 15px 0;
    border: 2px solid #ddd;
}

.action-buttons {
    margin: 20px 0;
}

.period-form {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border: 3px solid #667eea;
}

/* Animations */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .stat-row-name {
        min-width: 80px;
        font-size: 0.85em;
    }
}