/* ---------- Réglages de base Bootstrap ---------- */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

/* Pas de footer fixe ? pas besoin d’un gros margin-bottom */
body {
    margin: 0;
    padding: 0;
}

/* ---------- Layout global (sidebar + contenu) ---------- */
:root {
    --mx-blue: #9fd0e6; /* fond général */
    --mx-sidebar: #007bff; /* fond de la barre latérale */
}

body {
    background-color: var(--mx-blue);
    min-height: 100vh;
}

/* Zone principale */
.main-content {
    flex: 1 1 auto;
    padding: 0 20px 24px 20px;
}

/* ---------- En-tête (logo + titre + zone utilisateur) ---------- */
header.mx-header {
    position: relative;
    text-align: center;
    padding: 18px 0 8px 0;
}

.mx-logo {
    height: 72px;
    width: 72px;
    object-fit: contain;
}

.mx-userbar {
    position: absolute;
    top: 12px;
    right: 12px;
}

.mx-titlebar {
    background: #fff;
    border-radius: 4px;
    padding: 6px 10px;
    margin: 8px auto 10px;
    max-width: 1100px;
}

footer.mx-footer {
    color: #333;
    text-align: center;
    margin-top: 24px;
}

/* ---------- Barre latérale verticale ---------- */
.sidebar {
    width: 80px;
    background-color: var(--mx-sidebar);
    min-height: 100vh;
    display: flex; /* colonne verticale */
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
}

    /* Bouton-image de la sidebar */
    .sidebar a.sidebar-button {
        width: 60px;
        height: 60px;
        display: block;
        background-size: cover;
        background-position: center;
        border-radius: 10px;
        transition: transform .2s;
        text-indent: -9999px; /* uniquement l’icône */
        position: relative;
    }

        .sidebar a.sidebar-button:hover {
            transform: scale(1.05);
        }

        /* État actif (page courante) */
        .sidebar a.sidebar-button.is-active {
            outline: 2px solid #fff;
            outline-offset: 2px;
        }

/* Images de fond : fichiers dans wwwroot/img/ */

.btn-retour{
    background-image: url('/img/retourk82.png')
}

.btn-bassins {
    background-image: url('/img/bassin1.png');
}

.btn-ouvrages {
    background-image: url('/img/oa1.png');
}

.btn-stations {
    background-image: url('/img/statarbres1.png');
}

.btn-signalements {
    background-image: url('/img/signal1.png');
}
/* Évite les accents si possible ; sinon garde exactement le même nom de fichier */
.btn-releves {
    background-image: url('/img/relevé.png');
}
/* ou /img/releve.png */
.btn-patrouilles {
    background-image: url('/img/patrouilles.png');
}

/* Accessibilité : texte masqué visuellement mais lu par les lecteurs d’écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Gros boutons illustrés (si utilisés dans des pages) ---------- */
.btn-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 250px;
    padding: 0;
    border: none;
    border-radius: .5rem;
    overflow: hidden;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-color: transparent !important;
    color: #fff;
    font-weight: 700;
    text-shadow: 1px 1px 4px rgba(0,0,0,.6);
}

    .btn-image:hover {
        opacity: .9;
    }

/* ---------- Sidebar figée (bureau) ---------- */
@media (min-width: 992px) {
    .with-sidebar .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 80px;
        min-height: 100vh;
        overflow-y: auto;
        z-index: 1000;
    }

    .with-sidebar .main-content {
        margin-left: 80px;
    }
}

/* ---------- Responsive (mobile/tablette) ---------- */
@media (max-width: 768px) {
    /* La sidebar devient un bandeau horizontal */
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
    }

    .main-content {
        padding: 10px;
        margin-left: 0;
    }
}
/* ----- Barre horizontale (Portail) ----- */
.topbar {
    background-color: var(--mx-sidebar, #007bff);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px auto 12px;
    max-width: 1100px;
}

    /* on réutilise le style d'icône des boutons de la sidebar */
    .topbar .sidebar-button {
        width: 60px;
        height: 60px;
        display: block;
        background-size: cover;
        background-position: center;
        border-radius: 10px;
        transition: transform .2s;
        text-indent: -9999px;
    }

        .topbar .sidebar-button:hover {
            transform: scale(1.05);
        }

/* --- Portail : bannière + titre --- */
.portal-hero img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.portal-title {
    text-align: center;
    margin: 12px 0 8px;
    font-weight: 700;
}

/* --- Portail : barre horizontale en gros tuiles --- */
.topbar--tiles {
    background: transparent;
    padding: 8px 0 16px;
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 auto 8px;
    max-width: 1200px;
}

    .topbar--tiles .nav-tile {
        width: 150px; /* largeur de chaque tuile */
        text-decoration: none;
        color: #111;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

        .topbar--tiles .nav-tile .icon {
            width: 120px; /* taille des icônes (gros boutons) */
            height: 120px;
            border-radius: 16px;
            background-size: cover;
            background-position: center;
            box-shadow: 0 4px 14px rgba(0,0,0,.12);
            transition: transform .2s, box-shadow .2s;
        }

        .topbar--tiles .nav-tile .txt {
            margin-top: 8px;
            font-weight: 600;
            text-align: center;
        }

        .topbar--tiles .nav-tile:hover .icon {
            transform: translateY(-2px);
            box-shadow: 0 8px 22px rgba(0,0,0,.18);
        }

/* Option responsive : un peu plus petit sur écrans étroits */
@media (max-width: 576px) {
    .topbar--tiles .nav-tile {
        width: 120px;
    }

        .topbar--tiles .nav-tile .icon {
            width: 96px;
            height: 96px;
        }
}

