/* Adıyaman Transit - Ana Stil */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: pan-y;
}

.container {
    max-width: 100%;
    margin: 0;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Hamburger Menü Butonu */
.hamburger-menu-btn {
    position: fixed !important;
    top: 220px;
    left: 20px;
    z-index: 999999 !important;
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    pointer-events: auto !important;
}

/* Menü açıkken hamburger'ı sağa kaydır */
.hamburger-menu-btn.active {
    left: 370px !important;
}

/* Tam ekran modunda hamburger'ın görünürlüğünü garanti et */
body:fullscreen .hamburger-menu-btn,
body:-webkit-full-screen .hamburger-menu-btn,
body:-moz-full-screen .hamburger-menu-btn,
.fullscreen-mode .hamburger-menu-btn,
:fullscreen .hamburger-menu-btn,
:-webkit-full-screen .hamburger-menu-btn,
:-moz-full-screen .hamburger-menu-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 999999 !important;
    position: fixed !important;
    pointer-events: auto !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
    border: 3px solid #667eea !important;
}

.hamburger-menu-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.hamburger-menu-btn:active {
    transform: scale(0.95);
}

.hamburger-menu-btn span {
    width: 24px;
    height: 3px;
    background: #667eea;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translateY(9px);
}

.hamburger-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-9px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999997 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.sidebar-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Tam ekran modunda overlay görünsün */
body:fullscreen .sidebar-overlay,
body:-webkit-full-screen .sidebar-overlay,
body:-moz-full-screen .sidebar-overlay,
.fullscreen-mode .sidebar-overlay,
:fullscreen .sidebar-overlay,
:-webkit-full-screen .sidebar-overlay,
:-moz-full-screen .sidebar-overlay {
    z-index: 999997 !important;
    position: fixed !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.main-content {
    display: block;
    width: 100%;
    height: 100vh;
}
    min-height: 600px;
    transition: transform 0.3s ease;
}

.main-content.mobile-menu-open {
    transform: translateX(0);
}

.main-content.mobile-menu-open .sidebar {
    display: flex;
}

/* Mobile Menu Toggle Button - Hidden, using map buttons instead */
.mobile-menu-toggle {
    display: none;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* Tablet Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 320px 1fr;
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
        height: 100vh;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        min-height: 100vh;
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 380px;
        height: 100vh;
        z-index: 1000;
        background: white;
        border-right: 1px solid #e0e0e0;
        padding: 20px;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .mobile-overlay {
        display: block;
        pointer-events: none;
    }
    
    .mobile-overlay.active {
        pointer-events: auto;
    }
    
    .map-container {
        border-left: none;
        height: 100vh;
        width: 100%;
    }
    
    #map {
        height: calc(100vh - 60px) !important;
    }
    
    .map-header img {
        height: 45px !important;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .sidebar {
        width: 90%;
        padding: 15px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .map-header {
        padding: 10px;
        flex-wrap: wrap;
    }
    
    .map-header-title {
        font-size: 11px;
        order: 2;
        width: 100%;
        margin-top: 8px;
    }
    
    .map-header > div:nth-child(2) {
        order: 1;
        flex: 0 0 auto;
    }
    
    .map-header img {
        height: 40px !important;
    }
    
    .map-controls {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 4px;
        margin-top: 8px;
    }
    
    #map {
        height: calc(100vh - 140px) !important;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 900px) and (orientation: landscape) {
    .sidebar {
        width: 60%;
        max-width: 400px;
    }
    
    #map {
        height: calc(100vh - 60px) !important;
    }
    
    .map-header {
        padding: 8px 12px;
    }
    
    .map-header img {
        height: 35px !important;
    }
}

.sidebar {
    background: #f8f9fa;
    padding: 25px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    height: 100vh;
    max-height: 100vh;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Modluk Modu */
.main-content.compact {
    grid-template-columns: 1fr;
}

.main-content.compact .sidebar {
    display: none;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    
    .container {
        min-height: -webkit-fill-available;
    }
    
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
}

/* Fullscreen Mode */
body.fullscreen-mode {
    padding: 0;
}

.container.fullscreen-mode {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
}

.container.fullscreen-mode .header {
    display: none;
}

.container.fullscreen-mode .main-content {
    min-height: 100vh;
}
