/* Fix background sur mobile */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        background-size: cover;
        background-position: center center;
    }
}

/* Responsive navbar and small layout helpers */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    z-index: 1200;
    background: transparent;
}
.brand img { height: 40px; }
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
}
.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.nav-links a { text-decoration: none; color: inherit; padding: 0.4rem 0.6rem; }

/* Mobile */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.95);
        flex-direction: column;
        display: none;
        padding: 0.5rem 1rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    .nav-links.open { display: flex; }
    body { padding-top: 56px; }
}

/* Small tweaks for forms and cards */
.container, .registration-form, .login-form { max-width: 95%; }

/* Footer helper */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

footer {
    margin-top: auto;
}

/* Specific tweaks for NousContacter.php */
.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.contact-info img {
    width: 150px;
    height: auto;
}

/* Responsive Cookies*/
@media (max-width: 600px) {
    .cookie-consent {
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
    }

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

    .cookie-buttons {
        flex-direction: column;
    }

    .cookie-button {
        width: 100%;
    }
}

/* =============================================
   PAGE ACCUEIL - responsive
   ============================================= */
@media (max-width: 768px) {

    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Hero box */
    .hero {
        padding: 25px 15px;
        margin: 20px 10px 20px 10px;
        border-radius: 12px;
        box-sizing: border-box;
        width: calc(100% - 20px);
    }

    /* Titres hero */
    .hero h1 { font-size: 22px; }
    .hero h2 { font-size: 18px; }
    .hero h3 { font-size: 16px; }
    .hero p  { font-size: 14px; }

    /* Titre principal */
    .main-content {
        margin-top: 70px;
        padding: 0 10px;
    }
    .main-content h1  { font-size: 28px; }
    .main-content p.lead { font-size: 16px; padding: 0 10px; }

    /* Logos partenaires */
    .partner-logo {
        width: 80px;
        margin: 8px;
    }

    /* Footer pleine largeur */
    .footer-content {
        width: 100%;
        box-sizing: border-box;
        padding: 15px 10px;
        font-size: 13px;
    }
}

/* Responsive Profil.php */
/* ── Tablette (max 768px) ──────────────────────────────────── */
@media (max-width: 768px) {
    .profil-wrapper {
        margin: 1.5rem auto;
    }

    .profil-header {
        padding: 1.5rem;
        gap: 1rem;
    }

    .profil-avatar {
        width: 58px;
        height: 58px;
        font-size: 1.4rem;
    }

    .profil-header-info h1 {
        font-size: 1.15rem;
    }

    .profil-card {
        padding: 1.5rem;
    }
}

/* ── Mobile (max 560px) ────────────────────────────────────── */
@media (max-width: 560px) {
    .profil-header {
        flex-wrap: wrap;
    }

    /* Le bouton déconnexion passe sous l'avatar + infos */
    .btn-deconnexion {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    /* Formulaire : une colonne */
    .form-row {
        grid-template-columns: 1fr;
    }

    .btn-save {
        width: 100%;
        justify-content: center;
    }
}

/* PAGE ADMIN/ADHESION */

/* Tablette */
@media (max-width: 992px) {
    .admin-wrapper {
        padding: 0 15px;
    }
    
    .demandes-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .admin-hero h1 {
        font-size: 2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .admin-wrapper {
        padding: 0 10px;
    }
    
    .admin-hero {
        margin-top: 80px;
        padding: 30px 15px;
    }
    
    .admin-hero h1 {
        font-size: 1.5rem;
    }
    
    .hero .subtitle {
        font-size: 0.95rem;
    }
    
    .stats {
        margin-top: 20px;
    }
    
    .stat {
        padding: 15px 30px;
    }
    
    .stat-num {
        font-size: 2rem;
    }
    
    .demandes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 0;
    }
    
    .demande-card {
        padding: 20px;
        border-radius: 15px;
    }
    
    .demande-header {
        gap: 12px;
    }
    
    .demande-avatar {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .demande-name {
        font-size: 1.1rem;
    }
    
    .demande-date {
        font-size: 0.8rem;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 10px 12px;
    }
    
    .info-value {
        text-align: left;
        width: 100%;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    .empty-state {
        padding: 40px 15px;
        margin: 20px 0;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
    
    .empty-state h3 {
        font-size: 1.2rem;
    }
}

/* Petit mobile */
@media (max-width: 480px) {
    .admin-hero {
        margin-top: 70px;
        padding: 20px 10px;
    }
    
    .admin-hero h1 {
        font-size: 1.3rem;
    }
    
    .stat {
        padding: 12px 25px;
        width: 100%;
    }
    
    .demande-card {
        padding: 15px;
    }
    
    .demande-header {
        flex-direction: column;
        text-align: center;
    }
    
    .demande-name-wrapper {
        text-align: center;
    }
    
    .info-label {
        font-size: 0.85rem;
    }
    
    .info-value {
        font-size: 0.9rem;
    }
}

/* ===========================
   MODAL COMMENTAIRES RESPONSIVE
   =========================== */

/* Tablette */
@media (max-width: 992px) {
    .comments-modal-body {
        max-height: 65vh;
    }
    
    .comments-list {
        max-height: 280px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .card-buttons {
        flex-direction: column;
    }
    
    .card-buttons .btn {
        width: 100%;
    }
    
    .comments-modal-content {
        border-radius: 15px;
        margin: 10px;
    }
    
    .comments-modal-header {
        padding: 15px 20px;
    }
    
    .comments-modal-header .modal-title {
        font-size: 1rem;
    }
    
    .comments-modal-body {
        padding: 15px;
        max-height: 75vh;
    }
    
    .comments-list {
        max-height: 250px;
        padding-right: 5px;
    }
    
    .comment-item {
        padding: 12px;
        gap: 10px;
    }
    
    .comment-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .comment-author {
        font-size: 0.9rem;
    }
    
    .comment-date {
        font-size: 0.75rem;
    }
    
    .comment-text {
        font-size: 0.9rem;
    }
    
    .add-comment-section h6 {
        font-size: 0.95rem;
    }
    
    .comment-textarea {
        min-height: 80px;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .btn-submit-comment {
        width: 100%;
        padding: 12px 20px;
    }
    
    .login-prompt {
        padding: 15px;
    }
    
    .login-prompt p {
        font-size: 0.9rem;
    }
    
    .no-comments {
        padding: 30px 15px;
    }
    
    .no-comments-icon {
        font-size: 2.5rem;
    }
    
    .no-comments p {
        font-size: 1rem;
    }
}

/* Petit mobile */
@media (max-width: 480px) {
    .comment-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .comments-modal-body {
        padding: 12px;
    }
    
    .comment-item {
        flex-direction: column;
        text-align: center;
    }
    
    .comment-avatar {
        margin: 0 auto;
    }
    
    .comment-header {
        align-items: center;
    }
    
    .comment-text {
        text-align: left;
    }
}