/* ============================================
   REENTECH ANNUAIRE - DESIGN ÉPURÉ
   ============================================ */

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

:root {
    --primary-color: #15803d;
    --secondary-color: #166534;
    --accent-color: #22c55e;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links .nav-chip {
    border: 1px solid #d1d5db;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #374151;
    background: #fff;
}

.nav-links .nav-chip:hover {
    border-color: var(--primary-color);
    background: #f0fdf4;
    color: #166534;
}

.btn-account {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-light);
    color: var(--text-dark) !important;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-account:hover {
    background: var(--primary-color);
    color: #fff !important;
}

/* User Menu Dropdown */
.user-menu-container {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Fallback sans JS: ouvrir le dropdown au hover/focus clavier/souris */
.user-menu-container:hover .user-dropdown,
.user-menu-container:focus-within .user-dropdown,
.user-menu-container .btn-account:focus + .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 1.25rem 1.25rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid var(--border-color);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.user-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, #f0fdf4 0%, #f8f9fa 100%);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    padding-left: calc(1.25rem + 3px);
}

.dropdown-item i {
    width: 1.3rem;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.8;
}

.dropdown-item:hover i {
    opacity: 1;
}

.logout-item {
    color: #ef4444;
    margin-top: 0.25rem;
}

.logout-item:hover {
    background: linear-gradient(90deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border-left-color: #dc2626;
}

/* ============================================
   HERO SEARCH
   ============================================ */

.hero-search {
    background: transparent;
    padding: 6rem 0 3rem;
    text-align: center;
    color: var(--text-dark);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.search-box {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    display: flex;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-hover);
}

.search-medicament {
    max-width: 500px;
    margin: 0 auto 1rem;
    display: flex;
    background: rgba(255,255,255,0.95);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    outline: none;
}

.search-button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-button:hover {
    background: var(--secondary-color);
    transform: scale(1.02);
}

.quick-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-filter {
    background: transparent;
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    border: 2px solid rgba(0,0,0,0.2);
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.quick-filter.reset-btn {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.2);
}

.quick-filter:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ============================================
   STRUCTURES GRID
   ============================================ */

.recent-section,
.results-container {
    padding: 3rem 0;
}

.recent-section h2,
.results-container h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.structures-grid,
#results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1200px) {
    .structures-grid,
    #results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .structures-grid,
    #results-grid {
        grid-template-columns: 1fr;
    }
}

.structure-card,
.structure-item {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.structure-card:hover,
.structure-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.structure-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.structure-main {
    flex: 1;
}

.structure-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.structure-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-type {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
}

.badge-status {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 500;
}

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

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

.badge-verified {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 500;
}

.structure-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #4b5563;
}

.info-item i {
    color: #9ca3af;
    width: 16px;
    text-align: center;
}

.structure-type {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.type-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

.structure-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.structure-location {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.badge-verified {
    display: inline-block;
    background: #10b981;
    color: #fff;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   ABOUT PAGE
   ============================================ */

.about-page {
    padding: 2rem 0;
}

.about-hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    margin-bottom: 3rem;
}

.about-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.3rem;
    opacity: 0.9;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-box {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-item {
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.service-item:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
}

.service-item p {
    color: var(--text-light);
    line-height: 1.6;
}

.cta-section {
    margin-top: 4rem;
}

.cta-box {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 3rem;
    text-align: center;
}

.cta-box h2 {
    color: #fff;
    margin-bottom: 1rem;
}

.cta-box p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    background: var(--bg-light);
}

.auth-container {
    width: 100%;
    max-width: 550px;
    padding: 0 20px;
}

.auth-box {
    background: #fff;
    padding: 3rem;
    box-shadow: var(--shadow);
}

.auth-box h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.auth-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.info-box {
    background: var(--bg-light);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.auth-footer {
    text-align: center;
    color: var(--text-light);
    line-height: 2;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 1rem;
}

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

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

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-outline:hover {
    background: #fff;
    color: var(--primary-color);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background: var(--text-dark);
    color: #fff;
    padding: 3rem 0 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-section h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-link {
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.footer-link:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 20px;
    text-align: center;
}

.footer-bottom p {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* ============================================
   UTILITIES
   ============================================ */

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 1rem;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.card {
    background: #fff;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background: var(--bg-light);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    color: var(--text-dark);
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-button {
        justify-content: center;
    }
    
    .nav-links {
        gap: 0.65rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .structures-grid,
    #results-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        padding: 2rem 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .navbar-content {
        flex-wrap: wrap;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .quick-filters {
        flex-direction: column;
    }
    
    .quick-filter {
        width: 100%;
        max-width: 300px;
    }
}
