/* ============================================
   RESPONSIVE DESIGN
   Mobile-First Approach
   ============================================ */

/* ---- Max 1280px ---- */
@media (max-width: 1280px) {
    :root { --container-padding: 24px; }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Max 1024px ---- */
@media (max-width: 1024px) {
    :root {
        --font-size-hero: 2.5rem;
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.625rem;
    }

    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }

    .footer-grid { grid-template-columns: repeat(2, 1fr); }

    /* Header nav hide on tablet */
    .header-nav { display: none; }
    .header-search { max-width: 300px; }
    .mobile-toggle { display: flex; }

    .section { padding: var(--space-3xl) 0; }
    .section-lg { padding: var(--space-4xl) 0; }
}

/* ---- Max 768px ---- */
@media (max-width: 768px) {
    :root {
        --font-size-hero: 2rem;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.625rem;
        --font-size-3xl: 1.375rem;
        --font-size-2xl: 1.25rem;
        --space-4xl: 64px;
        --space-3xl: 48px;
    }

    .grid-4 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }

    .footer-brand { grid-column: 1 / -1; }

    /* Mobile navigation overlay */
    .mobile-nav {
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        z-index: var(--z-fixed);
        display: flex;
        flex-direction: column;
        padding: 80px 30px 30px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .mobile-nav.active { transform: translateX(0); }

    .mobile-nav a {
        display: block;
        padding: 16px 0;
        font-size: var(--font-size-lg);
        font-weight: 600;
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border-secondary);
        transition: color var(--transition-base);
    }

    .mobile-nav a:hover,
    .mobile-nav a.active { color: var(--accent-primary); }

    .mobile-nav-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-primary);
        font-size: 24px;
        border-radius: var(--radius-md);
    }

    /* Header adjustments */
    .header-search { display: none; }

    /* Hero adjustments */
    .hero-search { padding: 0 10px; }
    .hero-search input { font-size: var(--font-size-base); }

    /* Cards go full width */
    .complaint-card .card-footer { flex-wrap: wrap; gap: var(--space-sm); }

    /* Stats grid */
    .stats-grid { grid-template-columns: 1fr 1fr; }

    /* Table responsive */
    .table-wrapper { margin: 0 -20px; border-radius: 0; }

    /* Modal fullscreen on mobile */
    .modal {
        width: 100%;
        max-height: 100vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
    }
    .modal.active { transform: translateY(0); }

    .section { padding: var(--space-2xl) 0; }
}

/* ---- Max 480px ---- */
@media (max-width: 480px) {
    :root {
        --font-size-hero: 1.625rem;
        --font-size-5xl: 1.625rem;
        --font-size-4xl: 1.375rem;
        --font-size-3xl: 1.25rem;
        --container-padding: 16px;
    }

    .grid-4 { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr; }

    .footer-bottom { flex-direction: column; gap: var(--space-sm); text-align: center; }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
    .stat-card { padding: var(--space-md); }
    .stat-card .stat-number { font-size: var(--font-size-2xl); }

    /* Buttons full width */
    .btn-lg,
    .btn-xl { width: 100%; }

    /* Card adjustments */
    .card { padding: var(--space-md); border-radius: var(--radius-lg); }

    /* Pagination compact */
    .page-link { min-width: 36px; height: 36px; font-size: var(--font-size-xs); }
}

/* ============================================
   MOBILE STICKY BAR (Şikayet Yaz)
   ============================================ */
.mobile-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-secondary);
    box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
}

.mobile-sticky-bar .btn { width: 100%; }

@media (max-width: 768px) {
    .mobile-sticky-bar { display: block; }
    .page-content { padding-bottom: 80px; }
}

/* ============================================
   MOBILE SEARCH OVERLAY
   ============================================ */
.mobile-search-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    padding: 20px;
    display: none;
}

.mobile-search-overlay.active { display: block; }

.mobile-search-overlay .search-input-lg {
    width: 100%;
    padding: 16px 20px;
    font-size: var(--font-size-lg);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-xl);
    background: white;
    color: var(--text-primary);
    margin-top: 60px;
}

.mobile-search-overlay .search-input-lg:focus {
    outline: none;
    box-shadow: 0 0 30px var(--accent-glow);
}

/* ============================================
   HORIZONTAL SCROLL CARDS (Mobile Trend)
   ============================================ */
.scroll-cards {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-md);
    scrollbar-width: none;
}

.scroll-cards::-webkit-scrollbar { display: none; }

.scroll-cards .card {
    flex-shrink: 0;
    scroll-snap-align: start;
    min-width: 280px;
}

@media (min-width: 769px) {
    .scroll-cards {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        overflow: visible;
    }
    .scroll-cards .card { min-width: unset; }
}

/* ============================================
   FILTER DRAWER (Mobile)
   ============================================ */
.filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: var(--z-modal);
    background: white;
    border-left: 1px solid var(--border-secondary);
    padding: var(--space-xl);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    box-shadow: -5px 0 30px rgba(0,0,0,0.06);
}

.filter-drawer.active { transform: translateX(0); }

.filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.filter-drawer-backdrop.active { opacity: 1; visibility: visible; }

/* ============================================
   TOUCH-FRIENDLY SIZES
   ============================================ */
@media (max-width: 768px) {
    /* Min 44px touch targets */
    .btn-sm { min-height: 44px; padding: 10px 16px; }
    .tab-link { padding: 14px 16px; }
    .dropdown-item { padding: 14px; }
    .page-link { min-height: 44px; }
    .form-control { padding: 14px 16px; }
    .form-check { min-height: 44px; padding: 8px 0; }

    /* Reduce heavy animations on mobile */
    .hero-glow-1,
    .hero-glow-2,
    .hero-glow-3 {
        animation-duration: 0s;
    }

    .hover-lift:hover { transform: none; }
    .hover-tilt:hover { transform: none; }
}

/* ---- Prefer reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}
