/* ===================================
   SMARTGAZ - STYLES GLOBAUX
   Fichier: main.css
   Description: Styles communs à toute l'application
   =================================== */

/* --- RESET ET BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs principales */
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --secondary-color: #4CAF50;
    --accent-color: #FF9800;
    --danger-color: #F44336;
    
    /* Couleurs neutres */
    --text-dark: #212121;
    --text-light: #757575;
    --bg-light: #F5F5F5;
    --white: #FFFFFF;
    --border-color: #E0E0E0;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    
    /* Espacements */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- TYPOGRAPHIE --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* --- BOUTONS --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-success {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-full {
    width: 100%;
}

/* --- CARTES --- */
.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* --- BADGES --- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.badge-danger {
    background-color: #FFEBEE;
    color: #C62828;
}

.badge-warning {
    background-color: #FFF3E0;
    color: #E65100;
}

.badge-info {
    background-color: #E3F2FD;
    color: #1565C0;
}

/* --- FORMULAIRES --- */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background-color: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* --- ALERTES --- */
.alert {
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.6s; /* Pour l'effet de fondu */
}

.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }

.close-btn {
    margin-left: 15px;
    color: currentColor;
    font-weight: bold;
    font-size: 22px;
    line-height: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover { color: black; }

.alert-info {
    background-color: #E3F2FD;
    border-color: #2196F3;
    color: #1565C0;
}

.alert-warning {
    background-color: #FFF3E0;
    border-color: #FF9800;
    color: #E65100;
}

.alert-danger {
    background-color: #FFEBEE;
    border-color: #F44336;
    color: #C62828;
}

.alert-success {
    background-color: #E8F5E9;
    border-color: #4CAF50;
    color: #2E7D32;
}

/* Définition de l'animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px); /* Commence 20px plus haut */
    }
    to {
        opacity: 1;
        transform: translateY(0); /* Finit à sa place réelle */
    }
}

/* Application de l'animation sur le conteneur ou les alertes */
.alert-animation {
    animation: slideIn 0.5s ease-out forwards;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Petit bonus : une ombre pour le relief */
}



/* --- CONTAINER --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* --- PAGE D'ACCUEIL --- */
.welcome-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.welcome-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
}

.logo-section {
    margin-bottom: var(--spacing-xl);
}

.logo {
    margin-bottom: var(--spacing-md);
}

.app-name {
    font-size: 3rem;
    color: var(--white);
    font-weight: 700;
    text-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.welcome-message {
    max-width: 600px;
    margin-bottom: var(--spacing-xl);
    color: var(--white);
}

.welcome-message h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.welcome-message p {
    font-size: 1.125rem;
    opacity: 0.95;
}

.action-buttons {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    justify-content: center;
}

.action-buttons .btn {
    min-width: 160px;
    font-size: 1.125rem;
    padding: 14px 32px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    max-width: 800px;
    width: 100%;
}

.feature {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    color: var(--white);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.feature h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
}

.feature p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.welcome-footer {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--white);
    text-align: center;
    padding: var(--spacing-md);
}

.welcome-footer p {
    margin: 0;
    opacity: 0.8;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .app-name {
        font-size: 2.5rem;
    }
    
    .welcome-message h2 {
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .app-name {
        font-size: 2rem;
    }
    
    .welcome-message h2 {
        font-size: 1.25rem;
    }
    
    .welcome-message p {
        font-size: 1rem;
    }
}
