/* ===============================================
   PHARMACIES DE GARDE - STYLES MOBILE-FIRST
   =============================================== */

/* Variables spécifiques aux pharmacies */
:root {
    --pharmacy-green: #28a745;
    --pharmacy-green-dark: #1e7e34;
    --pharmacy-red: #dc3545;
    --pharmacy-orange: #fd7e14;
    --pharmacy-blue: #007bff;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.1);
    --card-shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

/* ===============================================
   HERO SECTION - OPTIMISÉE MOBILE
   =============================================== */

#pharmacies-hero {
    background: linear-gradient(135deg, var(--pharmacy-green) 0%, var(--pharmacy-green-dark) 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.hero-icon {
    margin-bottom: 1.5rem;
}

.hero-icon img {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    padding: 15px;
    backdrop-filter: blur(10px);
}

#pharmacies-hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

#pharmacies-hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ===============================================
   CONTRÔLES DE RECHERCHE - MOBILE FIRST
   =============================================== */

.search-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.location-input {
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    padding: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.location-input input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: white;
    font-size: 16px; /* Évite le zoom sur iOS */
    border-radius: 25px;
}

.location-input input::placeholder {
    color: rgba(255,255,255,0.7);
}

.location-input input:focus {
    outline: none;
}

.geolocate-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.geolocate-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.filter-zone-controls {
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    padding: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.zone-filter-select {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: white;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
}

.zone-filter-select option {
    background: var(--pharmacy-green);
    color: white;
    padding: 8px;
}

.zone-filter-select:focus {
    outline: none;
}

.search-btn {
    background: white;
    color: var(--pharmacy-green);
    border: none;
    padding: 14px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ===============================================
   LOADING STATE
   =============================================== */

.loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-color);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--pharmacy-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===============================================
   SECTION PHARMACIES
   =============================================== */

.pharmacies-section {
    padding: 2rem 1rem;
    background: #f8f9fa;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--heading-color);
    margin: 0;
}

/* ===============================================
   CARTES PHARMACIES - MOBILE OPTIMISÉ
   =============================================== */

.pharmacies-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ===============================================
   SECTIONS PAR ZONE
   =============================================== */

.zone-section {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.zone-header {
    background: linear-gradient(135deg, var(--pharmacy-green) 0%, var(--pharmacy-green-dark) 100%);
    color: white;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zone-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zone-count {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.zone-pharmacies {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pharmacy-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 3px solid var(--pharmacy-green);
    position: relative;
}

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

.pharmacy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.pharmacy-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading-color);
    margin: 0;
    flex: 1;
}

.pharmacy-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open {
    background: #d4edda;
    color: var(--pharmacy-green);
}

.status-closed {
    background: #f8d7da;
    color: var(--pharmacy-red);
}

.status-unknown {
    background: #fff3cd;
    color: var(--pharmacy-orange);
}

.pharmacy-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 14px;
    color: var(--text-color);
}

.info-icon {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Zone supprimée car maintenant affichée dans l'en-tête de section */

.pharmacy-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-call {
    background: var(--pharmacy-green);
    color: white;
}

.btn-call:hover {
    background: var(--pharmacy-green-dark);
    transform: translateY(-1px);
}

.btn-directions {
    background: var(--pharmacy-blue);
    color: white;
}

.btn-directions:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* Bouton WhatsApp supprimé car inutile pour chaque pharmacie */

/* ===============================================
   SECTION URGENCE
   =============================================== */

.emergency-section {
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.emergency-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.emergency-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

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

.emergency-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.emergency-card p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.emergency-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.emergency-btn {
    padding: 14px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.emergency-btn.primary {
    background: white;
    color: #ff6b6b;
}

.emergency-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.emergency-btn.whatsapp {
    background: #25D366;
    color: white;
}

.emergency-btn.whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

/* ===============================================
   ÉTATS VIDES ET ERREURS
   =============================================== */

.empty-state, .error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state-icon, .error-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3, .error-state h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--heading-color);
}

.retry-btn {
    background: var(--pharmacy-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 1rem;
}

/* ===============================================
   RESPONSIVE - TABLETTES ET DESKTOP
   =============================================== */

@media (min-width: 768px) {
    #pharmacies-hero {
        padding: 4rem 2rem;
    }
    
    .hero-content {
        max-width: 500px;
    }
    
    .hero-icon img {
        width: 100px;
        height: 100px;
    }
    
    #pharmacies-hero h1 {
        font-size: 2.8rem;
    }
    
    .search-controls {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        max-width: 700px;
    }
    
    .location-input {
        flex: 2;
        min-width: 250px;
    }
    
    .filter-zone-controls {
        flex: 1;
        min-width: 200px;
    }
    
    .search-btn {
        flex-shrink: 0;
        min-width: 140px;
    }
    
    .pharmacies-section {
        padding: 3rem 2rem;
    }
    
    .zone-pharmacies {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 1rem;
    }
    
    .emergency-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .emergency-btn {
        flex: 0 0 auto;
        min-width: 180px;
    }
}

@media (min-width: 1200px) {
    .zone-pharmacies {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-content {
        max-width: 600px;
    }
    
    .pharmacies-section {
        padding: 4rem;
    }
}

/* ===============================================
   AMÉLIORATIONS TACTILES MOBILE
   =============================================== */

@media (max-width: 767px) {
    /* Zones de toucher plus grandes */
    .action-btn {
        min-height: 44px;
        font-size: 16px;
    }
    
    .geolocate-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .search-btn {
        min-height: 48px;
    }
    
    /* Éviter le zoom sur les inputs iOS */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Marges optimisées pour mobile */
    .pharmacy-card {
        margin: 0 -0.5rem;
        border-radius: 0;
        border-left: none;
        border-top: 4px solid var(--pharmacy-green);
    }
    
    .pharmacies-section {
        padding: 1rem 0.5rem;
    }
}

/* ===============================================
   MODE SOMBRE (OPTIONNEL)
   =============================================== */

@media (prefers-color-scheme: dark) {
    .pharmacy-card {
        background: #2d3748;
        color: #f7fafc;
    }
    
    .pharmacy-name {
        color: #f7fafc;
    }
    
    .info-item {
        color: #cbd5e0;
    }
    
    .pharmacies-section {
        background: #1a202c;
    }
    
    .filter-select {
        background: #2d3748;
        color: #f7fafc;
        border-color: #4a5568;
    }
}
