/* ==========================================
   PRESTATAIRE DASHBOARD STYLES - MODERN DESIGN
   Styles spécifiques à l'espace prestataire
   Basé sur Bootstrap 5 et personnalisé
   ========================================== */

/* Mobile Top Navigation */
.mobile-top-nav {
    background: linear-gradient(180deg, var(--primary-violet, rgb(75, 0, 130)) 0%, var(--dark-violet, rgb(22, 33, 62)) 100%) !important;
    border-bottom: none !important;
    z-index: 1052 !important;
    /* Lower than offcanvas (1055) */
}

.mobile-top-nav-inner {
    padding: 0 1.5rem;
}

.mobile-logo-img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mobile-top-nav .sidebar-toggle-mobile {
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-top-nav .sidebar-toggle-mobile:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.mobile-top-nav .sidebar-toggle-mobile i {
    font-size: 1.5rem;
}

.user-avatar-mobile {
    font-weight: 600;
    transition: all 0.3s ease;
}

.user-avatar-mobile:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Adjust the bottom nav item for logo */
.prest-nav-item:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

/* Profile Offcanvas */
.offcanvas {
    backdrop-filter: blur(10px);
}

.offcanvas-header {
    padding: 1rem 1.5rem;
}

.offcanvas-title {
    font-weight: 700;
}

:root {
    --primary-color: #6c63ff;
    --primary-dark: #5649e6;
    --secondary-color: #4a45b1;
    --accent-color: #ff6584;
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
}

/* Layout Principal */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-light);
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-violet) 0%, var(--dark-violet) 100%);
    -webkit-background-clip: padding-box;
    -moz-background-clip: padding-box;
    background-clip: padding-box;
    color: white;
    position: fixed;
    height: 100vh;
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--accent-color);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #fff 0%, #cbd5e0 100%);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* Fallback pour les navigateurs qui ne supportent pas background-clip: text */
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    position: relative;
    /* overflow: hidden; */
    border-radius: var(--border-radius);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.nav-icon {
    width: 24px;
    display: inline-flex;
    justify-content: center;
    margin-right: 12px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}

.nav-text {
    font-weight: 500;
    transition: var(--transition);
}

.nav-item.active .nav-link {
    background: rgba(108, 99, 255, 0.2);
    color: white;
}

.nav-item.active .nav-icon {
    color: var(--accent-color);
}

.nav-item:hover .nav-link {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-links .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 3px solid white;
}

.badge {
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

/* Styles de base pour les avatars */
.avatar,
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin: 0;
    flex-shrink: 0;
    line-height: 1;
    margin-right: 10px;
}

.user-details h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.user-details small {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Main Content Styles */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: var(--transition);
}

/* Top Navigation */
.top-nav {
    /* background: var(--bg-white); */
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Augmenté pour s'assurer que la navbar est au-dessus du contenu mais en dessous des menus déroulants */
    position: relative;
    /* Nécessaire pour le positionnement des menus déroulants */
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-toggle-mobile {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Navigation Items - Reset all spacing */
.nav-item.dropdown {
    position: relative;
    margin: 0;
}

/* Notification Icon */
.notification-icon {
    position: relative;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.notification-icon:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* User Menu */
.user-menu .nav-link {
    padding: 0;
    line-height: 1;
}

/* Les styles de .user-avatar sont hérités de .avatar */

/* Masquer la flèche du dropdown-toggle après l'avatar */
.user-menu .dropdown-toggle::after {
    display: none !important;
}


.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--danger);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid var(--card-bg);
    line-height: 1;
    padding: 0 0.25rem;
    z-index: 1;
}

.notification-dropdown {
    width: 320px;
    padding: 0;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: visible;
    margin-top: 0.5rem;
    z-index: 1050;
    position: absolute;
    right: 0;
    left: auto;
}

.notification-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.notification-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.mark-all-read {
    font-size: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-item.unread {
    background: rgba(108, 99, 255, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* margin-right: 0.75rem; */
    flex-shrink: 0;
    color: white;
    font-size: 1rem;
}

.notification-content {
    flex: 1;
}

.notification-content p {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.notification-content small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notification-footer {
    padding: 0.75rem 1.25rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.view-all {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Dropdown Menus */
.dropdown-menu {
    margin-top: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    z-index: 1100;
    /* Au-dessus de la navbar */
    min-width: 12rem;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

/* User Menu */
.user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.user-menu .dropdown-toggle:hover {
    background-color: var(--bg-light);
}

/* Notification Dropdown */
.notification-dropdown {
    width: 320px;
    padding: 0;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    z-index: 1100;
    /* Assure que le menu est au-dessus des autres éléments */
    margin-top: 0.5rem;
}

.user-avatar {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Content Container */
.content-container {
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
}

/* Responsive Styles */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle-mobile {
        display: block;
    }
}

/* Collapsed Sidebar */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

.sidebar-collapsed .sidebar .nav-text,
.sidebar-collapsed .sidebar .logo-text,
.sidebar-collapsed .sidebar .user-details,
.sidebar-collapsed .sidebar .btn-logout span {
    display: none;
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
}

.sidebar-collapsed .sidebar .logo-wrapper {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .sidebar .sidebar-toggle {
    margin: 0 auto;
}

/* Animation de l'icône */
.dashboard-wrapper.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Styles pour afficher la sidebar sur mobile */
@media (max-width: 991.98px) {
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        transition: opacity 0.3s ease;
        opacity: 0;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    /* Style pour la sidebar ouverte en mode mobile */
    .dashboard-wrapper.sidebar-mobile-open .sidebar {
        transform: translateX(0) !important;
    }
}

/* Style de l'overlay pour la sidebar mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    transition: opacity 0.3s ease;
    opacity: 0;
}

/* Styles pour mobile */
@media (max-width: 991.98px) {

    /* Sur mobile, le dashboard-wrapper doit être en mode block */
    .dashboard-wrapper {
        display: block;
        flex-direction: column;
    }

    /* Le main-content prend toute la largeur sur mobile */
    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
        padding-bottom: 60px;
        /* Espace pour la navigation mobile en bas */
    }

    /* La sidebar est cachée par défaut sur mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        /* Commence hors écran */
        top: 0;
        bottom: 0;
        width: 280px;
        background: white;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: none;
        padding-top: 15px;
    }

    .dashboard-wrapper.sidebar-mobile-open .sidebar .nav-text {
        display: inline !important;
    }

    /* Améliorer la présentation mobile */
    .dashboard-wrapper.sidebar-mobile-open .sidebar {
        padding-top: 15px;
    }

    /* Renforcer la visibilité des notifications */
    .nav-item .badge {
        font-size: 0.7rem;
        font-weight: bold;
        padding: 0.25em 0.6em;
    }

    /* S'assurer que le content prend toute la largeur */
    .content {
        width: 100%;
        max-width: 100%;
    }
}

/* FIX: Décalage du contenu pour la top-nav sticky */
.main-content>.content {
    padding: 1.5rem;
}

/* Desktop : aligner le contenu avec le padding horizontal de la top-nav (2rem) */
@media (min-width: 992px) {
    .main-content>.content {
        padding: 1.5rem 2rem 0 2rem;
    }
}

/* Mobile : garder un padding plus réduit et réserver l'espace pour la bottom nav */
@media (max-width: 991.98px) {
    .main-content>.content {
        padding: 1.5rem 1.5rem 60px 1.5rem;
    }
}

.nav-links .nav-item {
    margin: 0;
}

.nav-links .nav-link {
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-links .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 3px solid white;
}

.nav-links .nav-link .nav-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.nav-links .nav-link .nav-icon {
    width: 24px;
    text-align: center;
    margin-right: 1rem;
    font-size: 1.1rem;
}

/* ==========================================
   NAVIGATION MOBILE BOTTOM (PRESTATAIRE)
   ========================================== */

/* Styles pour le menu bottom simplifié des prestataires */
.mobile-bottom-nav-prestataire {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    z-index: 1000;
    background: linear-gradient(180deg, var(--primary-violet, rgb(75, 0, 130)) 0%, var(--dark-violet, rgb(22, 33, 62)) 100%);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Ajustement du wrapper pour le contenu principal */
.dashboard-wrapper {
    padding-bottom: 0 !important;
}

/* Ajustement du footer pour mobile */
@media (max-width: 991.98px) {
    .prestataire-footer {
        margin-bottom: 0;
    }
}

/* Ajustement pour éviter l'espace blanc en bas du contenu */
@media (max-width: 991.98px) {
    .main-content {
        margin-bottom: 0;
    }
}

/* Ajustement du contenu pour mobile */
@media (max-width: 991.98px) {
    .content {
        margin-bottom: 0;
    }
}

.mobile-bottom-nav-prestataire .mobile-logo-img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.prest-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 8px 0;
    flex: 1;
    max-width: 100px;
}

.prest-nav-item:first-child {
    flex: 0 0 auto;
    padding: 8px 12px;
}

.prest-nav-item.active {
    color: white;
    font-weight: 600;
}

.prest-nav-item.appointments {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    margin: 0 5px;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
    flex: 1;
    max-width: 120px;
}

.prest-nav-item.appointments .prest-nav-icon {
    font-size: 1.6rem;
    color: white;
}

.prest-nav-item.appointments .prest-nav-text {
    font-weight: 600;
    color: white;
}

.prest-nav-icon {
    font-size: 1.2rem;
    margin-bottom: 3px;
    transition: all 0.2s ease;
}

.prest-nav-text {
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Animation du hover */
.prest-nav-item:hover .prest-nav-icon {
    transform: scale(1.1);
}

.prest-nav-item:hover .prest-nav-text {
    transform: scale(1.05);
}

/* Badge de notification */
.prest-nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 12px);
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0 5px;
    font-size: 0.6rem;
    font-weight: bold;
    color: white;
    background: #ff6584;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

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

.prestataire-footer {
    width: 100%;
    margin-top: auto;
}

/* Suppression de la marge en trop sur desktop */
@media (min-width: 992px) {
    .prestataire-footer {
        margin-bottom: 0;
    }

    /* Suppression de l'espace blanc sous le footer sur desktop */
    .main-content>.content {
        padding-bottom: 0;
    }
}

.prestataire-footer .footer-content {
    width: 100%;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-site-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-description {
    font-size: 0.9rem;
    margin-bottom: 0;
}