/* SPHAERO - Responsive Design */

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding: 0; font-family: 'Segoe UI', Arial, sans-serif; background: #f5f5f5; }
img { max-width: 100%; height: auto; }

/* NAVBAR FIXE */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    display: flex;
    align-items: center;
    padding: 0 30px;
    height: 70px;
    gap: 16px;
}

/* Compensation navbar fixe */
body { padding-top: 70px; }

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.navbar-logo img { height: 48px; width: 48px; object-fit: contain; }
.navbar-nom { font-size: 1.3em; font-weight: 800; color: #C8860A; letter-spacing: 2px; white-space: nowrap; }

/* Barre de recherche */
.navbar-search {
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 6px 16px;
    gap: 8px;
    border: 1.5px solid transparent;
    transition: border-color 0.2s;
}
.navbar-search:focus-within { background: #fff; border-color: #C8860A; }
.navbar-search input { border: none; background: transparent; outline: none; font-size: 0.88em; width: 100%; font-family: inherit; }
.navbar-search button { border: none; background: none; cursor: pointer; color: #C8860A; font-size: 1em; padding: 0; }

/* Liens navbar */
.navbar-liens { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.navbar-lien-texte { color: #555; text-decoration: none; font-size: 0.9em; font-weight: 500; }
.navbar-lien-texte:hover { color: #1a3a6b; }
.btn-connexion { background: #1a3a6b; color: white; padding: 7px 16px; border-radius: 20px; font-weight: 700; font-size: 0.85em; text-decoration: none; white-space: nowrap; }
.btn-connexion:hover { background: #2c5aa0; }
.btn-inscrire, .btn-abonner { background: #C8860A; color: white; padding: 7px 16px; border-radius: 20px; font-weight: 700; font-size: 0.85em; text-decoration: none; white-space: nowrap; }
.btn-inscrire:hover, .btn-abonner:hover { background: #F0A500; }
.langue-form select { border: none; background: transparent; font-size: 0.85em; cursor: pointer; color: #555; font-family: inherit; }

/* Burger */
.menu-burger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 40px; height: 40px; border: none; background: none; cursor: pointer; border-radius: 8px; padding: 6px; }
.menu-burger:hover { background: #f0f0f0; }
.menu-burger span { display: block; width: 22px; height: 2px; background: #333; border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.menu-burger.ouvert span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-burger.ouvert span:nth-child(2) { opacity: 0; }
.menu-burger.ouvert span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu dropdown */
.menu-dropdown { display: none; position: fixed; top: 70px; right: 16px; width: 240px; background: white; border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); z-index: 10000; overflow: hidden; }
.menu-dropdown.actif { display: block; }
.menu-search-mobile { display: none; padding: 12px; border-bottom: 1px solid #f5f5f5; gap: 8px; align-items: center; background: #f8f8f8; }
.menu-search-mobile input { flex: 1; border: 1px solid #e0e0e0; border-radius: 20px; padding: 7px 14px; font-size: 0.85em; outline: none; font-family: inherit; }
.menu-search-mobile button { border: none; background: #C8860A; color: white; padding: 7px 12px; border-radius: 20px; cursor: pointer; }
.menu-dropdown-liens a { display: flex; align-items: center; gap: 10px; padding: 13px 20px; color: #333; text-decoration: none; font-size: 0.92em; font-weight: 500; border-bottom: 1px solid #f5f5f5; transition: background 0.15s; }
.menu-dropdown-liens a:last-child { border-bottom: none; }
.menu-dropdown-liens a:hover { background: #fff8e1; color: #C8860A; }
.menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 9998; }
.menu-overlay.actif { display: block; }

/* Messages */
.messages-container { position: fixed; top: 80px; right: 16px; z-index: 10001; display: flex; flex-direction: column; gap: 8px; max-width: 360px; width: calc(100% - 32px); }
.message { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 10px; font-size: 0.9em; font-weight: 500; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.message-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }
.message-error, .message-danger { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }
.message-warning { background: #fff3e0; color: #e65100; border-left: 4px solid #e65100; }
.message-info { background: #e3f2fd; color: #1565c0; border-left: 4px solid #1565c0; }
.message-close { border: none; background: none; cursor: pointer; color: inherit; opacity: 0.6; font-size: 1em; padding: 0; }

/* Layouts sidebar */
.ep-layout, .bo-layout, .inst-layout { display: grid; min-height: calc(100vh - 70px); }
.ep-layout { grid-template-columns: 250px 1fr; }
.bo-layout { grid-template-columns: 260px 1fr; }
.inst-layout { grid-template-columns: 240px 1fr; }

/* KPI grilles */
.kpi-grid, .stats-grid { display: grid; gap: 15px; }
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.stats-grid { grid-template-columns: repeat(4, 1fr); }

/* Footer */
.footer-principal { background: #1a3a6b; color: rgba(255,255,255,0.85); }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto; padding: 50px 30px 30px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-logo { font-size: 1.6em; font-weight: 800; color: #C8860A; letter-spacing: 2px; }
.footer-col p { font-size: 0.85em; line-height: 1.7; opacity: 0.75; margin: 0; }
.footer-col h4 { font-size: 0.82em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #C8860A; margin: 0 0 4px; }
.footer-col a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.88em; }
.footer-col a:hover { color: white; }
.footer-bas { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 16px 30px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.82em; opacity: 0.7; flex-wrap: wrap; gap: 10px; }
.footer-badges { display: flex; gap: 8px; }
.badge-oa, .badge-doi, .badge-oai { padding: 3px 10px; border-radius: 10px; font-size: 0.8em; font-weight: 700; border: 1px solid rgba(255,255,255,0.3); }

/* LAPTOP (768-1024px) */
@media (max-width: 1024px) {
    .navbar { padding: 0 20px; }
    .navbar-search { max-width: 300px; }
    .ep-layout { grid-template-columns: 220px 1fr; }
    .bo-layout { grid-template-columns: 230px 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 30px; }
    .footer-brand { grid-column: 1 / -1; }
}

/* TABLETTE (576-768px) */
@media (max-width: 768px) {
    body { padding-top: 120px; overflow-x: hidden; }
    .navbar { padding: 0 12px; height: auto; min-height: 60px; flex-wrap: wrap; }
    .navbar-logo img { height: 40px; width: 40px; }
    .navbar-nom { font-size: 1em; letter-spacing: 1px; }
    .navbar-search { display: none; }
    .navbar-lien-texte { display: none; }
    .btn-inscrire { display: none; }
    .menu-burger { display: flex; }
    .menu-dropdown { top: 60px; right: 0; left: 0; width: 100%; border-radius: 0 0 14px 14px; }
    .menu-search-mobile { display: flex; }
    .ep-layout, .bo-layout, .inst-layout { grid-template-columns: 1fr; }
    .ep-sidebar, .bo-sidebar, .inst-sidebar { display: none; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; padding: 30px 20px 20px; }
    .footer-brand { grid-column: 1 / -1; }
    table { display: block; overflow-x: auto; }
}

/* MOBILE (<576px) */
@media (max-width: 576px) {
    body { padding-top: 115px; }
    .navbar { padding: 0 10px; min-height: 56px; }
    .navbar-logo img { height: 36px; width: 36px; }
    .navbar-nom { font-size: 0.95em; }
    .btn-abonner { padding: 5px 10px; font-size: 0.78em; }
    .btn-connexion { padding: 5px 10px; font-size: 0.78em; }
    .langue-form { display: none; }
    .menu-dropdown { top: 56px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .footer-inner { grid-template-columns: 1fr; padding: 24px 16px 16px; }
    .footer-bas { flex-direction: column; align-items: flex-start; }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .form-group input, .form-group select, .form-group textarea { font-size: 16px; min-height: 44px; }
    .menu-dropdown-liens a { padding: 16px 20px; }
    .btn-connexion, .btn-inscrire, .btn-abonner { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Impression */
@media print {
    .navbar, .menu-dropdown, .menu-overlay, .messages-container, footer { display: none; }
    body { background: white; padding-top: 0; }
}
.stat-item {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
}
.stat-item {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
}
