html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.container-fluid {
    height: 100%;
    padding: 0;
    padding-top: 60px; /* Add padding for fixed header */
    position: relative;
}

.row.flex-grow-1 {
    height: calc(100% - 60px); /* Account for header height */
    margin: 0;
}

#map {
    height: 100%;
    width: 100%;
    position: relative;
}

#sidebar {
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    height: 100%;
    overflow-y: auto;
    width: 280px; /* Fixed width for desktop */
}

#city-list {
    padding-bottom: 60px;
}

#city-list .list-group-item {
    cursor: pointer;
    border-radius: 0;
}

#city-list .list-group-item:hover {
    background-color: #f0f0f0;
}

.country-item > span {
    font-weight: bold;
}

.city-sublist {
    list-style-type: none;
    padding-left: 1.5rem;
    display: none;
}

.country-item.open .city-sublist {
    display: block;
}

#stats {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

#stats p {
    margin: 0;
    font-size: 16px;
}

header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important; /* Çok yüksek bir değer veriyoruz */
    background-color: #212529 !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    transform: translate3d(0, 0, 0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    -webkit-perspective: 1000 !important;
    perspective: 1000 !important;
    margin: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
}

/* Header içindeki öğelere tıklama özelliğini geri ver */
header * {
    pointer-events: auto;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 40px; /* Space for menu toggle */
}

.menu-toggle {
    position: absolute !important;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1003;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    margin: 0;
}

/* Mobile styles */
@media (max-width: 767.98px) {
    html, body {
        height: 100%;
        width: 100%;
        overflow: hidden;
        position: fixed;
        touch-action: manipulation;
        -webkit-overflow-scrolling: touch;
    }
    
    .container-fluid {
        padding-top: 60px; /* Match header height */
        height: 100%;
        position: relative;
        overflow: hidden;
    }
    
    .row.flex-grow-1 {
        height: calc(100vh - 60px);
        margin-top: 0;
        position: relative;
    }
    
    #map {
        height: 100%;
        margin-top: 0;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        z-index: 1;
    }
    
    #sidebar {
        position: fixed;
        left: 0;
        top: 60px; /* Header height */
        bottom: 0;
        transform: translateX(-100%);
        width: 280px;
        max-width: 100%;
        z-index: 1001;
        height: calc(100vh - 60px);
        -webkit-overflow-scrolling: touch;
    }
    
    #sidebar.show {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block !important;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent text selection on tap */
    * {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-tap-highlight-color: transparent;
    }
}
