/**
 * Mobile Header Design - Pastel Blue Theme
 * Modern mobile header with pastel blue color scheme
 */

:root {
    /* New Vibrant Blue Color Palette */
    --mobile-blue-primary: #3ACBE8;      /* Bright cyan blue */
    --mobile-blue-secondary: #1E88E5;    /* Medium blue */
    --mobile-blue-accent: #0041C7;       /* Deep royal blue */
    --mobile-blue-dark: #002B8C;         /* Very deep blue */
    --mobile-blue-light: #7DD3F0;        /* Light cyan */
    --mobile-blue-gradient-start: #3ACBE8;
    --mobile-blue-gradient-end: #0041C7;

    /* Text colors for blue background */
    --mobile-text-primary: #FFFFFF;      /* White for text on blue */
    --mobile-text-secondary: #E3F2FD;    /* Light blue for secondary text */
    --mobile-text-white: #FFFFFF;

    /* Shadows */
    --mobile-shadow-sm: 0 2px 8px rgba(0, 65, 199, 0.15);
    --mobile-shadow-md: 0 4px 12px rgba(0, 65, 199, 0.2);
    --mobile-shadow-lg: 0 6px 16px rgba(0, 65, 199, 0.25);
}

/* ===================================
   ANIMATED GRADIENT KEYFRAMES
   =================================== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===================================
   MOBILE HEADER - VIBRANT BLUE DESIGN
   =================================== */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Force mobile header styles with high specificity */
    body header {
        background: linear-gradient(135deg,
            var(--mobile-blue-gradient-start) 0%,
            var(--mobile-blue-secondary) 50%,
            var(--mobile-blue-gradient-end) 100%) !important;
        background-size: 200% 200% !important;
        animation: gradientShift 8s ease infinite !important;
        box-shadow: var(--mobile-shadow-md) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
    }

    /* Scrolled state - slightly darker with continued animation */
    body header.scrolled {
        background: linear-gradient(135deg,
            var(--mobile-blue-secondary) 0%,
            var(--mobile-blue-accent) 50%,
            var(--mobile-blue-dark) 100%) !important;
        background-size: 200% 200% !important;
        animation: gradientShift 8s ease infinite !important;
        box-shadow: var(--mobile-shadow-lg) !important;
    }

    /* Header container - Force horizontal layout with maximum specificity */
    body header .header-container {
        background: transparent !important;
        position: relative !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding: 8px 12px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Ensure nav is hidden on mobile */
    body header .header-container nav {
        display: none !important;
    }

    body header .header-container nav.md\:block {
        display: none !important;
    }

    /* Logo styling for blue background - centered on mobile */
    body header .header-container .logo {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        color: var(--mobile-text-white) !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        font-weight: 600 !important;
        font-size: 15px !important;
        transition: transform 0.3s ease !important;
        z-index: 5 !important;
        pointer-events: all !important;
        margin: 0 !important;
    }

    body header .header-container .logo span:not(.material-icons) {
        color: var(--mobile-text-white) !important;
        white-space: nowrap !important;
    }

    body header .header-container .logo .material-icons {
        color: var(--mobile-text-white) !important;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
        font-size: 24px !important;
    }

    body header .header-container .logo:active {
        transform: translateX(-50%) scale(0.95) !important;
    }

    /* Mobile Menu Trigger Button - Left side, white glass effect */
    body header .header-container .mobile-menu-trigger {
        background: rgba(255, 255, 255, 0.25) !important;
        border: 2px solid rgba(255, 255, 255, 0.4) !important;
        border-radius: 10px !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding: 8px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10 !important;
        order: 1 !important;
        flex-shrink: 0 !important;
    }

    body header .header-container .mobile-menu-trigger:hover {
        background: rgba(255, 255, 255, 0.35) !important;
        border-color: rgba(255, 255, 255, 0.6) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    }

    body header .header-container .mobile-menu-trigger:active {
        background: rgba(255, 255, 255, 0.45) !important;
        transform: scale(0.95) !important;
    }

    body header .header-container .mobile-menu-trigger .material-icons {
        color: var(--mobile-text-white) !important;
        font-size: 22px !important;
        font-weight: 500 !important;
    }

    /* Mobile Login Trigger Button - Right side, matches menu button */
    body header .header-container .mobile-login-trigger {
        background: rgba(255, 255, 255, 0.25) !important;
        border: 2px solid rgba(255, 255, 255, 0.4) !important;
        border-radius: 10px !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        cursor: pointer !important;
        padding: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 40px !important;
        min-height: 40px !important;
        z-index: 10 !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
        order: 3 !important;
        flex-shrink: 0 !important;
    }

    body header .header-container .mobile-login-trigger:hover {
        background: rgba(255, 255, 255, 0.35) !important;
        border-color: rgba(255, 255, 255, 0.6) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    }

    body header .header-container .mobile-login-trigger:active {
        background: rgba(255, 255, 255, 0.45) !important;
        transform: scale(0.95) !important;
    }

    body header .header-container .mobile-login-trigger .material-icons {
        color: var(--mobile-text-white) !important;
        font-size: 22px !important;
        font-weight: 500 !important;
    }

    /* Mobile Menu Overlay - Blue tinted */
    #mobile-menu-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: rgba(58, 203, 232, 0.5) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 9500 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.3s ease, visibility 0.3s ease !important;
    }

    #mobile-menu-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Mobile Menu - Vibrant Blue Gradient Design */
    #mobile-menu {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: linear-gradient(180deg,
            var(--mobile-blue-gradient-start) 0%,
            var(--mobile-blue-secondary) 50%,
            var(--mobile-blue-gradient-end) 100%) !important;
        box-shadow: 4px 0 24px rgba(0, 65, 199, 0.3) !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
    }

    #mobile-menu.active {
        left: 0 !important;
    }

    /* Mobile Menu Header */
    .mobile-menu-header {
        background: linear-gradient(135deg,
            var(--mobile-blue-gradient-start) 0%,
            var(--mobile-blue-secondary) 100%);
        padding: 20px;
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .mobile-menu-header h3 {
        color: var(--mobile-text-white);
        font-size: 18px;
        font-weight: 600;
        margin: 0;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    .mobile-menu-close {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        padding: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .mobile-menu-close .material-icons {
        color: var(--mobile-text-white);
        font-size: 24px;
    }

    /* Mobile Menu Links - White on Blue Gradient */
    .mobile-menu-link {
        color: var(--mobile-text-white) !important;
        background: transparent;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        position: relative;
        overflow: hidden;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        padding: 14px 20px !important;
    }

    /* Hover effect with white gradient */
    .mobile-menu-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }

    .mobile-menu-link:hover::before {
        left: 100%;
    }

    .mobile-menu-link:active {
        background: rgba(255, 255, 255, 0.25);
        transform: translateX(4px);
    }

    .mobile-menu-link .material-icons {
        color: var(--mobile-text-white);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    /* Active link state */
    .mobile-menu-link.active {
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
        border-left: 4px solid var(--mobile-text-white);
        font-weight: 600;
    }

    .mobile-menu-link.active .material-icons {
        color: var(--mobile-text-white);
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    }

    /* Mobile Menu Divider */
    .mobile-menu-divider {
        background: linear-gradient(90deg, transparent 0%, rgba(138, 196, 217, 0.4) 50%, transparent 100%);
        height: 2px;
        margin: 8px 0;
    }

    /* Mobile Menu Action Buttons */
    .mobile-menu-action {
        padding: 20px;
        background: transparent !important;
        border-top: none !important;
    }

    .mobile-menu-action .btn {
        background: linear-gradient(135deg, var(--mobile-blue-accent) 0%, var(--mobile-blue-dark) 100%);
        color: white;
        border: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 12px rgba(74, 143, 163, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-menu-action .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(74, 143, 163, 0.4);
    }

    .mobile-menu-action .btn:active {
        transform: scale(0.98);
    }

    .mobile-menu-action .btn .material-icons {
        color: white;
    }

    /* User info section in mobile menu */
    .mobile-user-info {
        padding: 16px 20px;
        background: rgba(255, 255, 255, 0.15);
        border-bottom: 2px solid rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        gap: 12px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .mobile-user-info .avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--mobile-text-white);
        font-weight: 700;
        font-size: 20px;
        border: 3px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }

    .mobile-user-info .user-name {
        font-weight: 600;
        color: var(--mobile-text-white);
        font-size: 16px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    .mobile-user-info .user-email {
        font-size: 13px;
        color: var(--mobile-text-white);
        opacity: 0.85;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
}

/* ===================================
   BOTTOM NAVIGATION - VIBRANT BLUE GRADIENT
   =================================== */
@media (max-width: 768px) {
    .bottom-nav {
        background: linear-gradient(135deg,
            var(--mobile-blue-gradient-start) 0%,
            var(--mobile-blue-secondary) 50%,
            var(--mobile-blue-gradient-end) 100%) !important;
        background-size: 200% 200% !important;
        animation: gradientShift 8s ease infinite !important;
        border-top: 2px solid rgba(255, 255, 255, 0.3) !important;
        box-shadow: 0 -4px 16px rgba(0, 65, 199, 0.3) !important;
    }

    .bottom-nav-item {
        color: var(--mobile-text-white);
        position: relative;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .bottom-nav-item span:not(.material-icons):not(.badge) {
        color: var(--mobile-text-white) !important;
    }

    /* Ripple effect on tap */
    .bottom-nav-item::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.4s ease, height 0.4s ease;
    }

    .bottom-nav-item:active::after {
        width: 80px;
        height: 80px;
    }

    .bottom-nav-item:active {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

    .bottom-nav-item .material-icons {
        color: var(--mobile-text-white);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    /* Active state - highlighted */
    .bottom-nav-item.active {
        color: var(--mobile-text-white);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
    }

    .bottom-nav-item.active .material-icons {
        color: var(--mobile-text-white);
        transform: scale(1.15);
        filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    }

    .bottom-nav-item.active span:not(.material-icons):not(.badge) {
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }

    /* Badge - updated for blue theme */
    .bottom-nav-item .badge {
        background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
        border: 2px solid white;
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }
}

/* ===================================
   SWIPE INDICATOR - BLUE THEME
   =================================== */
@media (max-width: 768px) {
    .swipe-indicator {
        background: linear-gradient(90deg, var(--mobile-blue-accent) 0%, var(--mobile-blue-secondary) 100%);
        box-shadow: 2px 0 12px rgba(95, 168, 199, 0.4);
        width: 6px;
    }
}

/* ===================================
   PULL TO REFRESH - BLUE THEME
   =================================== */
@media (max-width: 768px) {
    .pull-to-refresh {
        background: linear-gradient(180deg, var(--mobile-blue-light) 0%, white 100%);
        border-bottom: 2px solid var(--mobile-blue-primary);
        box-shadow: 0 4px 12px rgba(138, 196, 217, 0.2);
    }

    .pull-to-refresh .spinner {
        border-color: var(--mobile-blue-secondary);
        border-top-color: transparent;
    }
}

/* ===================================
   SEARCH BAR IN MOBILE HEADER (Optional)
   =================================== */
@media (max-width: 768px) {
    .mobile-search-bar {
        margin: 10px 16px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        padding: 6px 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        border: 2px solid rgba(255, 255, 255, 0.3);
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        cursor: pointer;
    }

    .mobile-search-bar:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.4);
    }

    .mobile-search-bar:focus-within {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .mobile-search-bar .material-icons {
        color: var(--mobile-text-white);
        font-size: 20px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    .mobile-search-bar input {
        border: none;
        background: transparent;
        flex: 1;
        font-size: 14px;
        color: var(--mobile-text-white);
        outline: none;
        cursor: pointer;
    }

    .mobile-search-bar input::placeholder {
        color: var(--mobile-text-white);
        opacity: 0.75;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    /* Mobile menu içindeki arama barı için ekstra küçültme */
    #mobileMenuSearchBar {
        margin: 8px 12px !important;
        padding: 4px 10px !important;
        border-radius: 16px !important;
    }

    #mobileMenuSearchBar .material-icons {
        font-size: 18px !important;
    }

    #mobileMenuSearchBar input {
        font-size: 13px !important;
    }
}

/* ===================================
   SMOOTH ANIMATIONS
   =================================== */
@media (max-width: 768px) {
    /* Fade in animation for menu */
    @keyframes fadeInSlide {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    #mobile-menu.active .mobile-menu-link {
        animation: fadeInSlide 0.3s ease forwards;
    }

    #mobile-menu.active .mobile-menu-link:nth-child(1) { animation-delay: 0.05s; }
    #mobile-menu.active .mobile-menu-link:nth-child(2) { animation-delay: 0.1s; }
    #mobile-menu.active .mobile-menu-link:nth-child(3) { animation-delay: 0.15s; }
    #mobile-menu.active .mobile-menu-link:nth-child(4) { animation-delay: 0.2s; }
    #mobile-menu.active .mobile-menu-link:nth-child(5) { animation-delay: 0.25s; }
    #mobile-menu.active .mobile-menu-link:nth-child(6) { animation-delay: 0.3s; }

    /* Pulse animation for notifications badge */
    @keyframes pulse {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.1);
        }
    }

    .bottom-nav-item .badge {
        animation: pulse 2s ease-in-out infinite;
    }
}

/* ===================================
   GLASS MORPHISM EFFECTS
   =================================== */
@media (max-width: 768px) {
    .glass-effect {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */
@media (max-width: 768px) {
    /* Focus states for keyboard navigation */
    .mobile-menu-trigger:focus-visible {
        outline: 3px solid var(--mobile-blue-accent);
        outline-offset: 2px;
    }

    .mobile-menu-link:focus-visible {
        outline: 2px solid var(--mobile-blue-accent);
        outline-offset: -2px;
        background: rgba(95, 168, 199, 0.15);
    }

    .bottom-nav-item:focus-visible {
        outline: 2px solid var(--mobile-blue-accent);
        outline-offset: 2px;
        z-index: 1;
    }
}

/* ===================================
   FILTER DRAWER - MOBILE BLUE THEME
   =================================== */
@media (max-width: 768px) {
    /* Filter drawer içindeki butonlar */
    .filter-drawer .btn-primary,
    .filter-drawer button[type="submit"] {
        background: linear-gradient(135deg, var(--mobile-blue-gradient-start) 0%, var(--mobile-blue-accent) 100%) !important;
        color: white !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        box-shadow: 0 2px 8px rgba(0, 65, 199, 0.3) !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
    }

    .filter-drawer .btn-primary:hover,
    .filter-drawer button[type="submit"]:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(0, 65, 199, 0.4) !important;
    }

    .filter-drawer .btn-primary:active,
    .filter-drawer button[type="submit"]:active {
        transform: scale(0.98) !important;
    }

    /* Temizle butonu */
    .filter-drawer .btn-secondary,
    .filter-drawer button[type="reset"] {
        background: rgba(58, 203, 232, 0.1) !important;
        color: var(--mobile-blue-accent) !important;
        border: 2px solid var(--mobile-blue-primary) !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
    }

    .filter-drawer .btn-secondary:hover,
    .filter-drawer button[type="reset"]:hover {
        background: rgba(58, 203, 232, 0.2) !important;
    }

    /* Filter drawer form inputs */
    .filter-drawer input[type="text"],
    .filter-drawer input[type="number"],
    .filter-drawer select {
        border: 2px solid rgba(58, 203, 232, 0.3) !important;
        transition: all 0.3s ease !important;
    }

    .filter-drawer input[type="text"]:focus,
    .filter-drawer input[type="number"]:focus,
    .filter-drawer select:focus {
        border-color: var(--mobile-blue-accent) !important;
        box-shadow: 0 0 0 3px rgba(58, 203, 232, 0.1) !important;
        outline: none !important;
    }

    /* Filter drawer labels */
    .filter-drawer label {
        color: var(--mobile-blue-dark) !important;
        font-weight: 600 !important;
    }

    /* Filter drawer checkboxes ve radio buttons */
    .filter-drawer input[type="checkbox"]:checked,
    .filter-drawer input[type="radio"]:checked {
        background-color: var(--mobile-blue-accent) !important;
        border-color: var(--mobile-blue-accent) !important;
    }
}

/* ===================================
   DARK MODE SUPPORT (Future)
   =================================== */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    :root {
        --mobile-blue-primary: #2C5F7F;
        --mobile-blue-secondary: #1E4A5F;
        --mobile-blue-accent: #5FA8C7;
        --mobile-blue-dark: #4A8FA3;
        --mobile-blue-light: #1A3A4F;
        --mobile-text-primary: #E5F3F8;
        --mobile-text-secondary: #B8D8E8;
    }
}
