/* Responsive Fixes & Improvements */
/* İkbal Kocaeli - Mobil ve tablet uyumluluğu */

/* ============================================
   MOBILE FIRST APPROACH
   ============================================ */

/* Base styles (Mobile - 320px+) */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   NAVIGATION - Responsive
   ============================================ */

/* Mobile Navigation */
@media (max-width: 768px) {
    nav .hidden.md\\:flex {
        display: none !important;
    }

    /* CRITICAL: Ensure nav doesn't block anything */
    nav {
        pointer-events: none !important;
    }

    nav * {
        pointer-events: auto !important;
    }

    /* Mobile menu button - ABSOLUTE PRIORITY */
    #mobileMenuToggle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 24px !important;
        padding: 12px !important;
        margin: 0 !important;
        cursor: pointer !important;
        color: #fb923c !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        position: relative !important;
        z-index: 99999 !important; /* Maximum priority */
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(251, 146, 60, 0.5) !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }

    #mobileMenuToggle:active {
        background: rgba(251, 146, 60, 0.2) !important;
        transform: scale(0.95) !important;
    }

    #mobileMenuToggle i {
        display: block !important;
        font-size: 24px !important;
        color: #fb923c !important;
        pointer-events: none !important;
    }

    /* Hide desktop "Teklif Al" button on mobile */
    button.hidden.md\\:block {
        display: none !important;
    }

    /* Mobile menu logo - daha büyük */
    #mobileMenu .header-logo {
        height: 80px !important;
        width: auto !important;
    }
    
    /* Hamburger menü arka plan rengi - light/dark mode'a göre */
    .dark-mode #mobileMenu {
        background: rgba(0, 0, 0, 0.95) !important;
    }
    
    body:not(.dark-mode) #mobileMenu {
        background: rgba(255, 255, 255, 0.95) !important;
    }
    
    /* Hamburger menü içindeki yazılar - light/dark mode'a göre */
    .dark-mode #mobileMenu a {
        color: #ffffff !important;
        border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    body:not(.dark-mode) #mobileMenu a {
        color: #1a1a1a !important;
        border-bottom-color: rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Hamburger menü başlık ve border */
    .dark-mode #mobileMenu .border-gray-700 {
        border-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    body:not(.dark-mode) #mobileMenu .border-gray-700 {
        border-color: rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Hamburger menüdeki close button */
    .dark-mode #mobileMenuClose {
        color: #fb923c !important;
    }
    
    body:not(.dark-mode) #mobileMenuClose {
        color: #ea580c !important;
    }
    
    /* Mobile menu sidebar */
    #mobileMenu {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        z-index: 99998 !important;
        transform: translateX(100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
        pointer-events: auto !important;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5) !important;
    }
    
    #mobileMenu.active {
        transform: translateX(0) !important;
    }
    
    /* Mobile menu overlay */
    #mobileMenuOverlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.6) !important;
        z-index: 99997 !important;
        display: none !important;
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    
    #mobileMenuOverlay.active {
        display: block !important;
    }
    
    #mobileMenu a {
        display: block !important;
        padding: 15px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        font-size: 16px !important;
        color: #ffffff !important;
        text-decoration: none !important;
    }
    
    #mobileMenu a:active {
        background: rgba(251, 146, 60, 0.3) !important;
    }
    
    #mobileMenuClose {
        font-size: 28px !important;
        color: #fb923c !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        padding: 8px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    #mobileMenuClose:active {
        background: rgba(251, 146, 60, 0.2) !important;
        transform: scale(0.95) !important;
    }
}

/* ============================================
   HERO SECTION - Responsive
   ============================================ */

@media (max-width: 768px) {
    .hero-text {
        font-size: 2.5rem !important; /* 40px */
        line-height: 1.35;
    }
    
    #hero-title {
        font-size: 2.5rem !important;
        margin-bottom: 1.5rem;
    }
    
    #hero-subtitle {
        font-size: 1rem !important; /* 16px */
        line-height: 1.6;
        padding: 0 10px;
    }
    
    .hero-video-container {
        height: 100vh;
    }
    
    .hero-video {
        object-fit: cover;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .hero-text {
        font-size: 2rem !important; /* 32px */
    }
    
    #hero-title {
        font-size: 2rem !important;
    }
    
    #hero-subtitle {
        font-size: 0.875rem !important; /* 14px */
    }
}

/* ============================================
   BUTTONS - Responsive
   ============================================ */

@media (max-width: 768px) {
    button,
    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .flex.flex-col.sm\\:flex-row {
        flex-direction: column !important;
        gap: 12px;
    }
    
    .flex.flex-col.sm\\:flex-row button,
    .flex.flex-col.sm\\:flex-row a {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   CARDS & GRID - Responsive
   ============================================ */

@media (max-width: 1024px) {
    .grid.md\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .grid.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .grid.md\\:grid-cols-2,
    .grid.md\\:grid-cols-3,
    .grid.md\\:grid-cols-4,
    .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    .cargo-card {
        padding: 20px;
    }
    
    .cargo-card h3 {
        font-size: 1.25rem;
    }
    
    .cargo-card p {
        font-size: 0.875rem;
    }
}

/* ============================================
   STATS SECTION - Responsive
   ============================================ */

@media (max-width: 768px) {
    .grid.grid-cols-2.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }
    
    .stats-card {
        padding: 16px;
    }
    
    .stats-card .text-4xl {
        font-size: 2rem !important;
    }
    
    .stats-card .text-lg {
        font-size: 0.875rem !important;
    }
}

@media (max-width: 480px) {
    .grid.grid-cols-2.md\\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   FORMS - Responsive
   ============================================ */

@media (max-width: 768px) {
    input,
    textarea,
    select {
        font-size: 16px !important; /* iOS zoom önleme */
        padding: 12px;
    }
    
    textarea {
        min-height: 120px;
    }
    
    form .space-y-4 {
        gap: 12px;
    }
}

/* ============================================
   FOOTER - Responsive
   ============================================ */

@media (max-width: 768px) {
    footer .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 32px;
    }
    
    footer .text-center.md\\:text-left,
    footer .text-center.md\\:text-right {
        text-align: center !important;
    }
    
    footer .flex.justify-center.md\\:justify-start {
        justify-content: center !important;
    }
    
    footer img {
        margin: 0 auto !important;
    }
}

/* ============================================
   SPACING - Responsive
   ============================================ */

@media (max-width: 768px) {
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .max-w-7xl {
        max-width: 100% !important;
    }
    
    section {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ============================================
   TYPOGRAPHY - Responsive
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    h4 {
        font-size: 1.25rem !important;
    }
    
    .text-6xl {
        font-size: 2.5rem !important;
    }
    
    .text-5xl {
        font-size: 2rem !important;
    }
    
    .text-4xl {
        font-size: 1.75rem !important;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
    }
    
    .text-xl {
        font-size: 1.125rem !important;
    }
}

/* ============================================
   IMAGES & MEDIA - Responsive
   ============================================ */

@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    video {
        max-width: 100%;
        height: auto;
    }
    
    iframe {
        max-width: 100%;
    }
}

/* ============================================
   TABLES - Responsive
   ============================================ */

@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    thead {
        display: none;
    }
    
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }
    
    tr {
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 12px;
    }
    
    td {
        text-align: left;
        padding: 8px 0;
        border: none;
    }
    
    td:before {
        content: attr(data-label);
        font-weight: bold;
        display: inline-block;
        width: 120px;
        color: var(--text-primary);
    }
}

/* ============================================
   WHATSAPP WIDGET - Responsive
   ============================================ */

/* Force visibility on all screen sizes */
.whatsapp-widget, #whatsapp-widget {
    position: fixed !important;
    bottom: 40px !important;
    right: 20px !important;
    z-index: 99999 !important;
}

.whatsapp-button, .wa-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 60px !important;
    height: 60px !important;
}

@media (max-width: 768px) {
    .whatsapp-widget, #whatsapp-widget {
        bottom: 40px !important;
        right: 20px !important;
        z-index: 99999 !important;
    }
    
    .whatsapp-button, .wa-btn {
        width: 56px !important;
        height: 56px !important;
    }
    
    .whatsapp-popup, .wa-popup {
        width: calc(100vw - 30px) !important;
        right: -7.5px !important;
        bottom: 75px !important;
    }
}


/* ============================================
   BACK TO TOP BUTTON - Responsive
   ============================================ */

@media (max-width: 768px) {
    .back-to-top {
        bottom: 180px !important; /* WhatsApp widget'ten uzak */
        right: 1.25rem !important; /* 20px - Ana sayfa ile aynı */
        width: 3rem !important; /* 48px */
        height: 3rem !important; /* 48px */
        z-index: 99998 !important;
    }
}

/* WhatsApp Widget Priority */
.whatsapp-widget {
    z-index: 99999 !important; /* En üstte her zaman WP olsun */
}


/* ============================================
   LANDSCAPE MODE (Mobile)
   ============================================ */

@media (max-width: 768px) and (orientation: landscape) {
    .hero-video-container {
        height: 100vh;
    }
    
    #hero-title {
        font-size: 2rem !important;
    }
    
    #hero-subtitle {
        font-size: 0.875rem !important;
    }
    
    .py-20 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* ============================================
   TABLET (768px - 1024px)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .hero-text {
        font-size: 3.5rem !important;
    }
    
    #hero-title {
        font-size: 3.5rem !important;
    }
    
    #hero-subtitle {
        font-size: 1.125rem !important;
    }
    
    .cargo-card {
        padding: 24px;
    }
    
    .grid.md\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   LARGE SCREENS (1920px+)
   ============================================ */

@media (min-width: 1920px) {
    .max-w-7xl {
        max-width: 1400px !important;
    }
    
    .hero-text {
        font-size: 6rem !important;
    }
    
    #hero-title {
        font-size: 6rem !important;
    }
    
    #hero-subtitle {
        font-size: 1.5rem !important;
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Touch-friendly button sizes */
    button,
    a,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch */
    .hover-lift:hover {
        transform: none;
    }
    
    /* Tap highlight */
    * {
        -webkit-tap-highlight-color: rgba(184, 115, 51, 0.2);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    nav,
    footer,
    .whatsapp-widget,
    .back-to-top,
    button,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .cargo-card {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: currentColor;
    }
    
    .cargo-card,
    .tracking-widget {
        border-width: 2px;
    }
}

/* ============================================
   MAP PAGE - Responsive (Harita büyük, yazı ortalı)
   ============================================ */

/* Desktop - Harita büyük, yazı üstte ortalı */
#map-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1 !important;
}

#map-container svg {
    width: 100% !important;
    height: 90% !important;
    max-width: 1400px !important;
}

/* Hero section yazıları üstte ortalı */
section.relative.min-h-screen {
    position: relative !important;
    min-height: 100vh !important;
}

section.relative.min-h-screen .relative.z-10 {
    position: relative !important;
    z-index: 10 !important;
    padding-top: 100px !important;
}

/* Tablet */
@media (max-width: 1024px) {
}

/* Mobil - Harita küçük ama hala yazıdan büyük */
@media (max-width: 768px) {
    #map-container svg {
        height: 70% !important;
    }
    
    section.relative.min-h-screen .relative.z-10 {
        padding-top: 80px !important;
    }
}

@media (max-width: 480px) {
}

@media (max-width: 375px) {
}

/* ============================================
   BACK TO TOP BUTTON - Base Styles
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 12rem; /* 192px - Ana sayfa ile aynı (bottom-48) */
    right: 1.25rem; /* 20px - Ana sayfa ile aynı (right-5) */
    width: 3rem; /* 48px */
    height: 3rem; /* 48px */
    background: #ea580c;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 99997;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4);
}

.back-to-top:hover {
    background: #c2410c;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.6);
}
