html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Empêche les barres de défilement indésirables */
    font-family: sans-serif;
}

body {
    display: flex;
    /* Active Flexbox */
    flex-direction: column;
    /* Organise les enfants (top-bar, map) verticalement */
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

#map {
    flex-grow: 1;
    /* C'est la clé : cela dit à Flexbox de donner tout l'espace restant à #map */
    min-height: 0;
    /* Important pour le bon fonctionnement de flex-grow */
    width: 100%;
}

/* Left panel styles */
.left-panel {
    position: absolute;
    top: 0px; /* below topbar */
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 80%;
    background-color: #3F51B5;
    color: #ffffff;
    z-index: 100000 !important;
}
.left-panel.collapsed {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}
.left-panel .panel-content {
    padding: 12px;
    margin: 0;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

/* Restos list: scrollable area inside the panel; grow to fill available space */
#favorites-list {
    margin-top: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    padding-right: 8px;
}
.poi-item {
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    margin-bottom: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.poi-item h4 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
    flex: 1;
}

.delete-btn {
    background: transparent;
    transition: background 0.2s;
    color: white;
    border:0px;
}

.delete-btn:hover {
    transform: scale(1.05);
    color:#ff0000
}

.delete-btn i {
    pointer-events: none;
}

/* Fixed logout button */
.logout-btn-panel {
    bottom: 12px;
    transform: translateX(-3px);
    z-index: 220000;
    padding: 8px 12px;
    border-radius: 6px;
    display: none;
}

/* Show the logout button centered at the bottom when the panel is open */
body.panel-open .logout-btn-panel {
    display: inline-block;
}
/* Toggle button */
.panel-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    left: auto;
    transform: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.85);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    z-index: 200000 !important;
}
.panel-toggle:focus { outline: 3px solid rgba(255,152,0,0.9) }

.panel-dots {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 8px 0 white, 0 -8px 0 white;
}

/* Panel actions (button group) */
.panel-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.panel-actions .search-button { flex: 1 1 auto }

/* Map area adjusts when panel is visible */
body.panel-open #map {
    margin-left: 300px;
    width: calc(100% - 300px);
}
body.panel-open #content {
    margin-left: 300px;
    width: calc(100% - 300px);
}

.topbar-container {
    width: 100%;
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #3F51B5;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 50;
    transition: opacity 0.3s ease-in-out;
    opacity: 1.0;
}

.topbar-container:hover {
    opacity: 1.0 !important;
}

.logo-img {
    height: 40px;
    /* Taille du logo */
    width: auto;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.user-info {
    font-size: 0.9rem;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    display: block;
}

.search-group {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
}

.search-input {
    padding: 8px 12px;
    border: none;
    font-size: 1rem;
    flex-grow: 1;
    min-width: 150px;
}

.search-button {
    padding: 8px 12px;
    border: none;
    background-color: #ff9800;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
    border-radius: 5px;
}

.search-button:hover {
    background-color: #e65100;
    transform: translateY(-3px);
}

#content {
    flex-grow: 1;
    min-height: 0;
    width: 100%; /* calc(100vh - 60px); */
    padding: 2em;
}


.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

.popup-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    position: relative;
    text-align: center;
}

/* 3. Close Button */
.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    line-height: 1;
    padding: 5px 10px;
    transition: color 0.2s;
}

.close-button:hover {
    color: #ff0000;
}
/* DataTable styling */
#poiTable {
    width: 100% !important;
    border-collapse: collapse;
}

#poiTable thead th {
    background-color: #3F51B5;
    color: white;
    text-align: center !important;
    padding: 12px 8px;
    font-weight: 600;
    border: 1px solid #303F9F;
}

#poiTable tbody td {
    padding: 10px 8px;
    border: 1px solid #e0e0e0;
}

#poiTable tbody tr {
    background-color: #fafafa;
}

#poiTable tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

#poiTable tbody tr:hover {
    background-color: #e8eaf6;
    cursor: pointer;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 0 8px;
}

.dataTables_wrapper .dataTables_info {
    color: #666;
    padding-top: 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 4px 10px;
    margin: 0 2px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #3F51B5;
    color: white !important;
    border-color: #3F51B5;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: #3F51B5;
    color: white !important;
    border-color: #3F51B5;
}

/* Popup search button */
.popup-search-btn {
    padding: 8px 16px;
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
}

.popup-search-btn:hover {
    background-color: #e65100;
    transform: translateY(-2px);
}

.popup-search-btn:active {
    transform: translateY(0);
}
