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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.logo-container {
    max-width: 600px;
    margin: 0 auto 20px auto;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#aag-logo {
    max-width: 100%;
    max-height: 120px;
    height: auto;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex-direction: column;
    padding: 30px 20px;
    flex: 1;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 28px;
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #718096;
    font-size: 16px;
    margin-top: 5px;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    flex: 1;
    margin-bottom: 20px;
}

.tool-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 25px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-align: left;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tool-button-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tool-button-description {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.4;
}

.theme-button,
.population-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 25px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-align: center;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-button:hover,
.theme-button:hover,
.population-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.tool-button:active,
.theme-button:active,
.population-button:active {
    transform: translateY(0);
}

.back-button {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    margin-bottom: 10px;
}

.back-button:hover {
    background: #cbd5e0;
}

.primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.measures-container {
    flex: 1;
    margin-bottom: 20px;
}

.measure-card {
    background: #f7fafc;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.measure-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.measure-description {
    font-size: 16px;
    color: #4a5568;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.events-container {
    flex: 1;
    margin-bottom: 20px;
}

.event-card {
    background: #f7fafc;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.event-type-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-type-name {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
    line-height: 1.4;
}

.event-date-time,
.event-time,
.event-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 8px;
    line-height: 1.5;
}

.event-address-link {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.event-address-link:hover {
    border-bottom-color: #3498db;
    color: #2980b9;
}

.event-date-icon,
.event-time-icon,
.event-address-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Styles pour le covoiturage */
.form-container {
    flex: 1;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

.form-input:invalid {
    border-color: #e53e3e;
}

.carpooling-container {
    flex: 1;
    margin-bottom: 20px;
}

.carpooling-card {
    background: #f7fafc;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carpooling-event-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.carpooling-info {
    margin-bottom: 15px;
}

.carpooling-driver,
.carpooling-address,
.carpooling-seats {
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 8px;
    line-height: 1.5;
}

.carpooling-passengers {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.carpooling-passengers-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.carpooling-passengers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.passenger-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.join-carpooling-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.join-carpooling-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.event-date-time {
    font-weight: 600;
    color: #2d3748;
}

/* Responsive pour tablettes et plus grands écrans */
@media (min-width: 768px) {
    .button-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    h1 {
        font-size: 32px;
    }
    
    .container {
        min-height: auto;
        height: auto;
    }
}

/* Amélioration pour très petits écrans */
@media (max-width: 375px) {
    body {
        padding: 10px;
    }
    
    .logo-container {
        padding: 10px;
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    #aag-logo {
        max-height: 80px;
    }
    
    .container {
        border-radius: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .tool-button {
        padding: 20px;
        min-height: 85px;
    }
    
    .tool-button-title {
        font-size: 18px;
    }
    
    .tool-button-description {
        font-size: 13px;
    }
    
    .theme-button,
    .population-button {
        padding: 18px 20px;
        font-size: 16px;
        min-height: 65px;
    }
}
