/* ====================================
   Home Layout - Homepage Conversationnelle
   PHILOSOPHIE : Bootstrap 5 utility classes + Offcanvas pour 95% du design
   ==================================== */

.home-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ====================================
   Styles Custom Minimaux
   ==================================== */

/* Navigation Section - Style pill custom */
.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title-pill {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-section-title-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 1);
}

.nav-section-title-pill i.bi-chevron-down {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.nav-section-title-pill[aria-expanded='true'] i.bi-chevron-down {
    transform: rotate(180deg);
}

/* Navigation Links - Hover effect custom */
.nav-link {
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--theme-sidebar-hover);
}

/* Sidebar Links (footer) - Hover effect custom */
.sidebar-link {
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Icônes Hamburger et Fermeture - Suppression totale des styles Bootstrap */
.sidebar-header .btn-link,
.sidebar-header .btn-link:hover,
.sidebar-header .btn-link:focus,
.sidebar-header .btn-link:active {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
    padding: 0 !important;
}

/* ====================================
   Sidebar - Rétractable (mode icônes)
   ==================================== */
.home-sidebar {
    transition: width 0.3s ease;
    overflow: hidden;
}

.home-sidebar.sidebar-collapsed {
    width: 60px !important;
}

/* Masquer les éléments en mode rétracté */
.home-sidebar.sidebar-collapsed span:not(.sidebar-header span),
.home-sidebar.sidebar-collapsed .collapse,
.home-sidebar.sidebar-collapsed .bi-chevron-down,
.home-sidebar.sidebar-collapsed .bi-arrow-left-circle {
    display: none !important;
}

/* Header en mode rétracté : hamburger centré */
.home-sidebar.sidebar-collapsed .sidebar-header {
    justify-content: center !important;
}

/* Ajuster le padding et supprimer le fond/bordure des pills en mode rétracté */
.home-sidebar.sidebar-collapsed .nav-section-title-pill {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: transparent !important;
    border: none !important;
}

.home-sidebar.sidebar-collapsed .nav-link,
.home-sidebar.sidebar-collapsed .sidebar-link {
    padding: 0.75rem;
}

/* Note: justify-content-center est ajouté dynamiquement via Bootstrap classes en JS */

/* ====================================
   Main Content Area - Flexbox 3 zones
   ==================================== */
.home-main {
    margin-left: 0;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Empêche le scroll sur le main, uniquement sur .home-content */
}

/* Sur desktop, décaler pour la sidebar permanente */
@media (min-width: 992px) {
    .home-main {
        margin-left: 280px;
    }
}

/* ====================================
   CONTAINER 1 : Header + Nav Tabs sticky en haut
   ==================================== */
.sticky-top-container {
    position: sticky;
    top: 0;
    flex-shrink: 0; /* Ne pas rétrécir */
    z-index: 100;
    background-color: var(--theme-bg);
}

.home-header {
    background-color: transparent;
}

.header-logo-picto {
    width: 37px;
    height: 40px;
}

.header-logo {
    width: auto;
    max-width: 180px;
    height: 55px;
}

/* Adaptation des couleurs du logo selon le thème */
/* Logo texte : blanc en SVG, donc doit être converti en bleu pour thème light */
.theme-light .header-logo {
    filter: brightness(0) saturate(100%) invert(23%) sepia(73%) saturate(1647%) hue-rotate(203deg) brightness(93%)
        contrast(94%);
}

/* Logo picto : on utilise les bons SVG directement (logo_picto.svg en light, assistant-picto.svg en dark) */
/* Les deux SVG ont maintenant le même ratio viewBox (~0.9) pour une taille uniforme */

/* ====================================
   CONTAINER 2 : Contenu scrollable
   ==================================== */
.home-content {
    flex: 1; /* Occupe tout l'espace disponible entre header et input */
    overflow-y: auto; /* Scroll uniquement sur ce container */
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Par défaut centré pour la page d'accueil */
}

/* Page chat : contenu aligné en haut pour le scroll des messages */
.home-content.chat-page {
    justify-content: flex-start;
}

/* Page profile : contenu aligné en haut (pas centré verticalement) */
.home-content.profile-page {
    justify-content: flex-start;
}

/* Page settings : contenu aligné en haut (pas centré verticalement) */
.home-content.settings-page {
    justify-content: flex-start;
}

/* Page marketing : contenu aligné en haut (pas centré verticalement) */
.home-content.marketing-page {
    justify-content: flex-start;
    padding-top: 1rem; /* Éviter que le contenu soit caché sous le header */
}

/* ====================================
   CONTAINER 3 : Input sticky en bas (seulement pages chat)
   ==================================== */
.sticky-bottom-container {
    flex-shrink: 0; /* Ne pas rétrécir */
    z-index: 50;
    background-color: var(--theme-bg);
}

@media (max-width: 768px) {
    .header-logo {
        max-width: 150px;
        height: 40px;
    }

    .home-content {
        padding: 1rem;
    }
}
