/* Variables CSS pour la personnalisation */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f8fafc;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    
    /* Tailles d'écran */
    --screen-sm: 640px;
    --screen-md: 768px;
    --screen-lg: 1024px;
    --screen-xl: 1280px;
}

/* Reset et styles de base */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    /* Optimisation de la lisibilité */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Empêcher le défilement horizontal */
    overflow-x: hidden;
    width: 100%;
    /* Amélioration du défilement sur mobile */
    scroll-behavior: smooth;
}

.public-container {
    min-height: 100vh;
    background-color: #f9fafb;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding: 0;
    margin: 0;
}

/* En-tête public */
.public-header {
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Boutons */
.btn-primary {
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    -webkit-border-radius: 0.5rem;
    -moz-border-radius: 0.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: white;
    background-color: var(--primary-color);
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -o-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    width: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

/* Amélioration pour les appareils tactiles */
@media (hover: none) {
    .btn-primary:hover {
        transform: none;
    }
    
    .btn-primary:active {
        background-color: var(--primary-hover);
        transform: scale(0.98);
    }
    
    /* Meilleur espacement pour les éléments tactiles */
    button, a.btn, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Meilleure lisibilité sur petits écrans */
    html {
        /* Taille de police de base */
        font-size: 100%;
    }
    
    body {
        /* Taille de police de base */
        font-size: 1rem;
        /* Hauteur de ligne pour une meilleure lisibilité */
        line-height: 1.5;
        /* Empêcher le défilement horizontal */
        overflow-x: hidden;
        /* Désactiver le redimensionnement automatique du texte sur mobile */
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        /* Prévenir le zoom sur iOS */
        touch-action: manipulation;
    }
    
    /* Conteneur principal pour la mise en page */
    .container {
        /* Forcer le conteneur à s'adapter à la largeur de l'écran */
        max-width: 100%;
        /* Ajouter un padding pour éviter que le contenu ne touche les bords */
        padding-left: 1rem;
        padding-right: 1rem;
        /* Empêcher le débordement horizontal */
        overflow-x: hidden;
    }
    
    /* Meilleure gestion des grilles sur mobile */
    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Taille de police plus grande sur mobile */
@media (max-width: 640px) {
    .btn-primary {
        padding: 1rem 1.5rem;
        font-size: 1.05rem;
    }
    
    /* Ajustement de la grille pour les très petits écrans */
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Cartes */
.public-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Amélioration du contraste pour la lisibilité */
@media (max-width: 640px) {
    .public-card {
        border-radius: 0.5rem;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
        margin: 0 1rem;
        width: calc(100% - 2rem);
    }
    
    /* Ajustements pour les petits écrans */
    body {
        font-size: 16px;
    }
    
    /* Amélioration de la lisibilité sur mobile */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
    }
    
    /* Meilleur espacement pour les éléments tactiles */
    button, a, input, .btn-primary {
        min-height: 44px;
    }
}

/* .public-card:hover {
    box-shadow: 0 4px 12px -1px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.15);
} */

/* Badges d'état */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
}

/* Styles pour les notifications */
.notification-alert {
    animation: slideIn 0.5s ease-out;
    transition: all 0.3s ease;
    border-left-width: 4px;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 1.5rem;
    padding: 1rem;
    position: relative;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.notification-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.notification-success {
    background-color: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.notification-error {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.notification-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

.notification-content {
    padding-right: 1.5rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-alert .notification-content {
    position: relative;
    padding-right: 2.5rem;
}

.notification-alert .notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.notification-alert .notification-close:hover {
    opacity: 1;
}

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

/* Styles pour les différents types de notifications */
.notification-warning {
    background-color: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.notification-success {
    background-color: #ecfdf5;
    border-left-color: #10b981;
    color: #065f46;
}

.notification-error {
    background-color: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.status-open {
    background-color: #dcfce7;
    color: #166534;
}

.status-paused {
    background-color: #fef9c3;
    color: #854d0e;
}

.status-closed {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Formulaire */
.public-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.2s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
}

.public-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* Amélioration de l'expérience mobile */
@media (max-width: 640px) {
    .public-input {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    /* Éviter le zoom sur iOS */
    @supports (-webkit-touch-callout: none) {
        .public-input {
            font-size: 16px;
        }
    }
}

/* Animation de chargement */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Utilitaires */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }

/* Responsive */
@media (max-width: 640px) {
    .public-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
