﻿.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; /* S'adapte à la largeur du parent */
    padding: 10px; /* Espacement autour */
    padding: 16px; /* Espacement autour du logo */
    border-bottom: 1px solid #ddd; /* Séparateur (optionnel) */
}

.logo-image {
    max-width: 100%; /* Taille maximale du logo */
    height: auto;
}

/* Do NOT hide all Mud toolbars globally, it breaks grid pagers.
   Limit this rule to the app bar toolbar only. */
.mud-appbar .mud-toolbar {
    display: none;
}

/* Full-height layout components */
.full-height-layout {
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.full-height-drawer {
    min-height: 100vh;
    height: auto;
    position: sticky;
    top: 0;
    flex-shrink: 0;
}

.full-height-main {
    min-height: 100vh;
    height: auto;
    display: flex !important;
    flex-direction: column !important;
    margin-left: 0 !important;
    transition: margin-left 0.3s ease !important;
}

.full-height-appbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1200 !important;
    flex-shrink: 0 !important;
}

.full-height-container {
    flex: 1 !important;
    min-height: 100%;
    height: auto;
    padding: 16px !important;
}

/* Responsive behavior for drawer */
@media (min-width: 960px) {
    .full-height-drawer {
        position: sticky !important;
        height: auto !important;
        min-height: 100% !important;
        width: 256px !important;
    }
}

@media (max-width: 959px) {
    .full-height-main {
        margin-left: 0 !important;
    }
    
    .full-height-drawer {
        position: fixed !important;
        width: 256px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease !important;
    }
    
    .full-height-drawer.mud-drawer-open {
        transform: translateX(0) !important;
    }
}

/* Full-height navigation menu */
.mud-navmenu-full-height {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure at least viewport height */
    height: auto; /* Allow growth beyond first viewport */
}

/* Main content area that grows to fill space */
.navmenu-content {
    margin-top: 1.5rem;
    flex: 1; /* Takes up remaining space */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Scroll if content overflows */
}

/* Footer section */
.navmenu-footer {
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

/* Centered section within footer (for language buttons and copyright) */
.navmenu-footer-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Adjust version text styling */
.version-text {
    margin-top: 1rem;
    text-align: center;
    color: #fff;
}

/* Loading container styling */
.loading-container {
    display: flex;
    align-items: center;
    padding: 0.5rem;
}

.loading-text {
    margin-left: 0.5rem;
    color: #6c757d;
}

/* No conversations message styling */
.no-conversations {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
}

/* Optional: Style for navigation links */
.nav-link {
    margin-bottom: 0.5rem;
}

.nav-link-dense {
    padding: 0px 0px; /* Reduced padding */
    font-size: 0.775rem; /* Smaller font size */
    line-height: .5; /* Adjust line height if necessary */
    /* Optionally adjust margins */
    margin: 0px 0;
    /* If you need to adjust hover or active states */
    transition: padding 0.2s, font-size 0.2s;
}

    .nav-link-dense:hover {
        /* Example: slightly increase padding on hover */
        padding: 5px 10px;
    }

    .nav-link-dense.active {
        /* Example: different styling for active link */
        font-weight: bold;
    }


.mud-card-content, .mud-expand-panel-content, .mud-expand-panel-gutters {
    background-color: #fff !important;
}

.mud-tabs-tabbar {
    background-color: #fff !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Webkit scrollbar styling for tab bar */
.mud-tabs-tabbar::-webkit-scrollbar {
    height: 4px;
}

.mud-tabs-tabbar::-webkit-scrollbar-track {
    background: transparent;
}

.mud-tabs-tabbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.mud-tabs-tabbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

.mud-table {
    background-color: #fff !important;
}

.mud-paper, .mud-input-control-input-container {
    background-color: #fff !important;
    outline: none !important;
    border: none !important;
}

.upload-chip {
    z-index: 9999;
    pointer-events: auto !important;
}

.modal-bg {
    background-color: #fff !important
}

.mud-dialog {
    background-color: #fff !important
}

/* OCR Document Display Styles */
.ocr-document-container {
    overflow: auto;
    max-height: 70vh;
    max-width: 100%;
    border: none;
    border-radius: 4px;
    background-color: #fafafa;
}

.ocr-canvas-wrapper {
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ocr-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Scrollbar styling for better UX */
.ocr-document-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ocr-document-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ocr-document-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ocr-document-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive design for different screen sizes */
@media (max-width: 768px) {
    .ocr-document-container {
        max-height: 60vh;
    }
    
    .ocr-canvas-wrapper {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .ocr-document-container {
        max-height: 50vh;
    }
}

/* Zoom indicator styles */
#zoom-indicator {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced canvas interaction styles */

/* MudTabs and MudStepper specific overrides to remove black borders */
.mud-tabs,
.mud-tabs-rounded,
.mud-tabs-tabbar,
.mud-tabs-panels,
.mud-tabs-panel,
.mud-stepper,
.mud-stepper-content,
.mud-stepper-nav-connector {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.mud-tabs .mud-tabs-tabbar,
.mud-tabs .mud-tabs-panels,
.mud-tabs .mud-tabs-panel,
.mud-stepper .mud-stepper-content {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Remove borders from tab content and panels */
.mud-tabs-panel {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Remove borders from stepper content */
.mud-stepper-content {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Remove borders from stepper navigation */
.mud-stepper-nav-connector {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Ensure tabs don't wrap and maintain horizontal layout */
.mud-tab {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.mud-tabs-tabbar .mud-tab {
    min-width: fit-content !important;
    max-width: none !important;
}

/* Container wrapper for tabs to prevent viewport expansion */
.tabs-container-wrapper {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    position: relative !important;
}

/* Ensure stepper content doesn't expand viewport */
.mud-stepper-content {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 64px - 32px) !important; /* Subtract appbar height and padding */
}

/* Constrain page container and content to prevent vertical overflow */
.page-container {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.page-container .content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Ensure MudStepper doesn't exceed container height */
.mud-stepper {
    max-height: 100% !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Ensure MudTabs container respects width constraints for scrollable tabs */
.mud-tabs {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.mud-tabs .mud-tabs-tabbar {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

/* Critical: Constrain the tabbar inner containers to enable MudBlazor scroll detection */
.mud-tabs-tabbar-inner {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

/* This is the key - tabbar-content must be constrained to viewport width for MudBlazor scroll detection */
/* MudBlazor needs a fixed max-width (not percentage) to detect overflow */
.mud-tabs-tabbar-content {
    width: 100% !important;
    /* Account for drawer (256px on desktop), container padding/gutters (~64px), stepper spacing, and extra safety buffer */
    max-width: calc(100vw - 256px - 64px - 150px) !important;
    overflow: hidden !important;
    position: relative !important;
}

/* On mobile/tablet, drawer is overlay so no drawer width to subtract */
@media (max-width: 959px) {
    .mud-tabs-tabbar-content {
        max-width: calc(100vw - 64px - 150px) !important;
    }
}

/* Additional constraint: ensure tabbar doesn't exceed its container */
.mud-tabs-tabbar {
    box-sizing: border-box !important;
}

/* Ensure stepper content area is also constrained */
.mud-stepper-content {
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Allow tabbar-wrapper to expand beyond content width - this triggers scroll detection */
.mud-tabs-tabbar-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    min-width: 100% !important;
}

/* Hide the tab slider/underline */
.mud-tab-slider {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
}

/* Style tabs with bounding box contours only (no background) - slightly translucent borders */
.mud-tabs-tabbar .mud-tab {
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 4px 4px 0 0 !important;
    margin: 0 4px 0 0 !important;
    padding: 8px 16px !important;
    background-color: transparent !important;
    transition: all 0.2s ease-in-out !important;
}

/* Active tab styling - highlighted border only (slightly translucent) */
.mud-tabs-tabbar .mud-tab.mud-tab-active {
    background-color: transparent !important;
    border: 2px solid var(--mud-palette-primary) !important;
    border-color: var(--mud-palette-primary) !important;
    font-weight: 500 !important;
    color: var(--mud-palette-primary) !important;
}

/* Hover effect for tabs - slightly darker border */
.mud-tabs-tabbar .mud-tab:hover:not(.mud-tab-active) {
    background-color: transparent !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Ensure the tabbar has proper spacing */
.mud-tabs-tabbar {
    position: relative !important;
    overflow: hidden !important;
    padding: 8px 0 0 0 !important;
}

/* Make sure the slider is positioned relative to the tab, not the entire tabbar */
.mud-tabs-tabbar-wrapper {
    position: relative !important;
    overflow: visible !important;
}

.ocr-canvas {
    cursor: default;
}

/* Smooth scrolling for document containers */
.ocr-document-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Loading state for zoom operations */
.ocr-canvas.zooming {
    pointer-events: none;
    opacity: 0.8;
}

/* Focus indicator for accessibility - removed to prevent black borders */
.ocr-canvas:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ocr-canvas {
        border: none;
    }
    
    #zoom-indicator {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ocr-canvas {
        transition: none;
    }
    
    .ocr-document-container {
        scroll-behavior: auto;
    }
    
    #zoom-indicator {
        transition: none;
    }
}

/* Remove all outlines and borders during zoom operations */
.ocr-document-container:focus,
.ocr-canvas-wrapper:focus,
.mud-paper:focus,
.mud-tabs:focus,
.mud-tabs-tabbar:focus,
.mud-tab:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure no borders appear on any container elements */
.mud-paper,
.mud-stack,
.mud-item,
.mud-tabs,
.mud-tabs-tabbar,
.mud-tab {
    outline: none !important;
    border: none !important;
}

/* Remove any focus indicators that might appear */
*:focus {
    outline: none !important;
}

/* Specific override for canvas elements */
canvas:focus {
    outline: none !important;
    border: none !important;
}

/* Remove borders from MudBlazor tabs and containers */
.mud-tabs-tabbar,
.mud-tabs-panels,
.mud-tab-panel {
    border: none !important;
    outline: none !important;
}

/* Remove any borders that might appear during zoom operations */
.mud-container,
.mud-grid,
.mud-item {
    border: none !important;
    outline: none !important;
}

/* Remove all possible borders and outlines during zoom */
* {
    outline: none !important;
}

/* Prevent browser zoom on keyboard shortcuts */
html, body {
    zoom: 1 !important;
    transform: scale(1) !important;
}

/* Prevent any zoom behavior on document */
document, document.documentElement {
    zoom: 1 !important;
    transform: scale(1) !important;
}

/* Specific overrides for zoom operations */
.mud-paper,
.mud-card,
.mud-expansion-panels,
.mud-expansion-panel,
.mud-expansion-panel-header,
.mud-expansion-panel-content {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Keep focus styles minimal but visible for accessibility */
.mud-tabs-tabbar .mud-tab:focus {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
}

/* Ensure no borders appear on any MudBlazor components */
.mud-component {
    border: none !important;
    outline: none !important;
}

/* Remove any borders that might be added by the browser during focus */
*:focus-visible {
    outline: none !important;
    border: none !important;
}

/* Enhanced Stat Cards Styles */
.stat-card {
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.stat-icon {
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-value {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--mud-palette-text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 4px;
}

.stat-card .mud-progress-linear {
    height: 4px !important;
    border-radius: 2px;
}

/* Responsive adjustments for stat cards */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 16px;
    }

    .stat-value {
        font-size: 1.8rem !important;
    }

    .stat-label {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 16px !important;
    }

    .stat-value {
        font-size: 1.6rem !important;
    }
}

/* Responsive user management table styling */
@media (max-width: 959px) {
    /* Medium screens and below - improve table spacing */
    .users-table .mud-table-cell {
        padding: 8px 6px;
    }
    
    /* Adjust action buttons spacing on mobile */
    .mobile-actions .d-flex {
        gap: 4px;
    }
    
    /* Make chips smaller on medium screens */
    .users-table .mud-chip {
        font-size: 0.75rem;
    }
}

/* Mobile table improvements */
@media (max-width: 599px) {
    /* Small screens - make table more compact */
    .users-table .mud-table-cell {
        padding: 6px 4px;
        font-size: 0.875rem;
    }
    
    .users-table .mud-chip {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    /* Adjust email column on mobile */
    .users-table .mud-table-cell:first-child {
        min-width: 140px;
        max-width: 180px;
    }
    
    .users-table .mud-table-cell:first-child .mud-text {
        font-size: 0.8rem;
        word-break: break-word;
    }
    
    /* Make icon buttons smaller on mobile */
    .mobile-actions .mud-icon-button {
        width: 32px;
        height: 32px;
    }
    
    .mobile-actions .mud-icon-button .mud-icon-root {
        font-size: 1rem;
    }
}

/* ------------------------------------- */
/* Settings (Paramètres) panel styling   */
/* ------------------------------------- */
.settings-card {
    border-radius: 12px;
}

.settings-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-box {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px;
}

.settings-aside {
    border: 1px solid rgba(25,118,210,.12);
    border-radius: 10px;
}

.chip-list .mud-chip {
    margin-right: 6px;
    margin-bottom: 6px;
}
