/* Full height layout */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
#main {
    flex: 1 0 auto;
    position: relative;
}

#content-container {
    position: relative;
    width: 100%;
}

#footer {
    flex-shrink: 0;
}

.statistique-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

.toggle-menu-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #666;
    transition: all 0.3s ease;
}

.toggle-menu-btn span:nth-child(1),
.toggle-menu-btn span:nth-child(2) {
    margin-bottom: 5px;
}

@media (max-width: 1087px) {
    .sidebar-full-content {
        display: flex;
        flex-direction: column;
    }

    .sidebar-content {
        flex-grow: 1;
        overflow-y: auto;
        font-size: 14px;
    }

    .sidebar-compact-header svg{
        display: flex;
    }
}

@media (min-width: 1088px) {
    .sidebar-compact-header svg {
        display: none !important;
    }

    .toggle-menu-btn {
        display: none;
    }
}

/* Map styling */
#map {
    width: 100%;
    position: relative;
    z-index: 0;
    transition: padding-left 0.3s ease;
    flex-grow: 1;
    height: 98vh;
}

/* Modal styling */
.modal {
    z-index: 1200 !important;
}

.modal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("") center center/cover no-repeat;
    opacity: 0.6;
    z-index: -1;
}

.modal-content {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.modal-content-add-crime {
    box-shadow: 2px 4px 25px #6C3B8C !important;
}
#crimeModalDetailsGrid .modal-content {
    box-shadow: 2px 4px 25px #6C3B8C !important;
}
#source-details-modal .modal-content {
    box-shadow: 2px 4px 25px #6C3B8C !important;
}
  .group label {
    margin: 0;
    white-space: nowrap;
  }

  .group input {
    flex: 1;
  }

.modal-header {
    background: #6C3B8C;
    color: #fff;
    border-radius: 15px 15px 0 0;
}

.modal-title {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

/* Loading screen styling */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1200;
    transition: opacity 0.3s ease;
}

#loadingScreen.hidden {
    opacity: 0;
    pointer-events: none;
}

#loadingScreen.hidden-loading {
    display: none !important;
}

.loadingCircle {
    border: 8px solid #f3f3f0;
    border-top: 8px solid #6C3B8C;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dropdown menu */
.dropdown-menu {
    display: none;
}

.dropdown-menu:not(.hidden) {
    display: block;
}

/* Scrolling text animation */
@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.animate-marquee {
    animation: marquee 40s linear infinite;
}

#statistique {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background-color: #6C3B8C;
    border: 1px solid #6C3B8C;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Filter Buttons */
.filter-nav .filter-tab-btn {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: #00000008;
    border: 1px solid #ccc;
    border-radius: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.grid-item {
    border-radius : 30px;
}
.grid-item button {
    border-radius : 30px !important
}

.filter-nav .active-filter-tab {
    background-color: #6C3B8C;
    color: #fff;
    border-color: #6C3B8C;
    border-radius: 10px;
}

.filter-nav .filter-tab-btn:hover:not(.active-filter-tab) {
    background-color: #f0f0f0;
}

/* Filter Content */
.filter-content {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1rem;
    background-color: #fff;
    font-family: 'Inter', sans-serif;
}
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #666;
    margin-bottom: 1rem;
}
.region-list {
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: #222;
}
.custom-checkbox input[type="checkbox"] {
    display: none;
}

/* Custom Checkbox Style */
.custom-checkbox label {
    position: relative;
    padding-left: 28px;
    cursor: pointer;
}

.custom-checkbox label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #ccc;
    background-color: #fff;
    transition: 0.2s;
}

.custom-checkbox input[type="checkbox"]:checked + label::before {
    background-color: #6C3B8C;
    border-color: #6C3B8C;
}

.custom-checkbox input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    left: 4px;
    top: 0px;
    font-size: 16px;
    color: white;
}

/* Buttons */
.button-group {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom : 1rem;
}
.btn-primary {
    background-color: #6C3B8C;
    border-color: #6C3B8C;
}

.btn-primary:hover {
    background-color: #6C3B8C;
    border-color: #6C3B8C;
}

.btn-secondary {
    background-color: #fff;
    border-color: #6C3B8C;
    color: #6C3B8C;
}
.add-cas-btn {
    background: #6C3B8C; 
    color: #fff;
}
.add-cas-btn:hover {
    background: rgba(90, 47, 115, 0.566) ;
    color: #fff;
}
/* Animations du modal */
.transform {
    transition-property: transform, opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

.scale-95 {
    transform: scale(0.95);
}

.scale-100 {
    transform: scale(1);
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

/* Styles pour les appareils mobiles */
@media (max-width: 1087px) {
    #modalContent {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    #modalContent .p-4.max-h-\[70vh\] {
        max-height: none;
        flex-grow: 1;
    }
}
.btn-secondary:hover {
    background-color: #f0f0f0;
    border-color: #6C3B8C;
    color: #6C3B8C;
}

.form-check-input:checked {
    background-color: #6C3B8C;
    border-color: #6C3B8C;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}
#toggleSidebarBtn {
    background-color: #6C3B8C;
    border-color: #6C3B8C;
    color: #fff;
    border-radius: 10px;
}
#toggleSidebarBtn:hover {
    background-color: #f0f0f0;
    border-color: #6C3B8C;
    color: #6C3B8C;
}
/* Custom styles for sidebar behavior */
.sidebar-closed {
    height: auto !important; /* Auto height to fit content */
    min-height: 10vh;         /* Minimum visible height */
    max-height: 90vh;         /* Prevent too tall on large screens */
    overflow: hidden !important;
}
.sidebar-closed #sidebar-content {
    overflow-y: hidden !important;
}
.sidebar-closed #sidebarContent {
    display: none;
}
.sidebar-closed #floating-div-content {
    display: none;
}
.sidebar-closed .button-group {
    display: none;
}

.sidebar-closed #floating-div-content-hide {
    display: flex !important;
    min-height: -webkit-fill-available;
}


.sidebar-open #floating-div-content-hide {
    display: none !important;
}

.sidebar-content {
    transition: height 0.3s ease;
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
}

.filter-section:not(.hidden) {
    display: block;
}
.floating-sidebar-statistique {
    position: absolute;
    top: 10px;
    background-color: #fff;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 99%;
    max-height: calc(100% - 20px - 120px);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.floating-statistique.hidden {
    transform: translateX(-100%);
}
.floating-sidebar {
    position: absolute;
    top: 12%;
    left: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 30%;
    max-height: calc(100% - 20px - 120px);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.floating-sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.toggle-menu-btn {
    cursor: pointer;
    padding: 5px;
}

.crime-marker {
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-size: 12px;
}
/* Filter View Layout */
#filter-view {
    flex-direction: column;
    height: 100%; /* Take full height of its container */
    flex-grow: 1; /* Allow filter view to grow */
    min-height: 0; /* Necessary for flex children overflow */
}

/* Non-scrolling header part */
#filter-view > .p-4.border-b {
    flex-shrink: 0; /* Prevent header from shrinking */
}

/* Header and Footer */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
}
@media (min-width: 1088px) {
    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1100;
        background-color: #f8f9fa;
    }
}

/* Responsive Design */
@media (max-width: 1087px) {
    #header {
        height: 90px;
    }

    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1100;
        background-color: #f8f9fa;
        font-size: 10px !important;
    }
    .footer img {
        max-width : 100px !important;
    }
}

@media (max-width: 1088px) {
    #header {
        height: 80px;
    }


    .floating-sidebar {
        width: 90% !important;
        left: 6%;
        padding: 10px;
        max-height: calc(100% - 20px - 80px);
    }
}
/* Ajout de styles pour la grille responsive */
.grid-container .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  width: 100%;
}

@media (max-width: 1088px) {
  .grid-container .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .grid-container .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 769px) and (max-width: 1087px) {
  .grid-container .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1088px) {
  .grid-container .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Style pour les éléments de la grille */
.grid-item {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Assurer que les boutons de détails sont bien alignés en bas */
.grid-details-btn {
  margin-top: auto;
}

.active>.page-link, .page-link.active {
 color:#6C3B8C !important;
}
#detail-source-btn{
     background-color:#6C3B8C !important;
}
.custom-desktop-nav {
    display: none;
}

.custom-mobile-nav {
    display: flex;
}

@media screen and (min-width: 1088px) {
    .custom-desktop-nav {
        display: flex;
        justify-content:space-between;
    }

    .custom-mobile-nav {
        display: none;
    }
}