/**
 * Mobile Topbar - Gelişmiş, modern, kullanıcı dostu, eşsiz tasarım
 * Glassmorphism + gradient glow + yumuşak geçişler
 */

.mobile-topbar {
  display: none;
}

@media (max-width: 991px) {
  html {
    overflow-x: clip !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    height: auto !important;
    min-height: 100% !important;
  }
  body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    height: auto !important;
    min-height: 100% !important;
    position: static !important;
    touch-action: pan-y !important;
  }

  .main-header {
    display: none !important;
  }

  /* Ana bar: eşsiz cam efekti, yuvarlatılmış alt köşe, gradient çerçeve */
  .mobile-topbar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    z-index: 9999 !important;
    min-height: 100px !important;
    padding: 10px 14px 12px !important;
    padding-top: max(16px, env(safe-area-inset-top)) !important;
    padding-left: max(14px, env(safe-area-inset-left)) !important;
    padding-right: max(14px, env(safe-area-inset-right)) !important;
    box-sizing: border-box !important;
    transform: translateZ(0) !important;
    -webkit-tap-highlight-color: transparent !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    /* Gelişmiş glassmorphism */
    background: linear-gradient(
      165deg,
      rgba(18, 20, 28, 0.94) 0%,
      rgba(12, 14, 22, 0.92) 50%,
      rgba(18, 20, 28, 0.94) 100%
    ) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-top: none !important;
    border-radius: 0 0 24px 24px !important;
    box-shadow:
      0 4px 0 0 rgba(59, 130, 246, 0.25),
      0 8px 32px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(255, 255, 255, 0.04) inset,
      0 24px 48px -12px rgba(59, 130, 246, 0.15) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease !important;
  }

  .mobile-topbar:active {
    box-shadow:
      0 4px 0 0 rgba(59, 130, 246, 0.2),
      0 6px 24px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.03) inset !important;
  }

  .mobile-topbar-left,
  .mobile-topbar-right {
    width: 26% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .mobile-topbar-left {
    justify-content: flex-start !important;
  }

  .mobile-topbar-right {
    justify-content: flex-end !important;
  }

  .mobile-topbar-center {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px !important;
  }

  /* Hamburger: pill stil, yumuşak glow */
  .mobile-topbar-hamburger {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    cursor: pointer !important;
    border-radius: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }

  .mobile-topbar-hamburger:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
    color: #93c5fd !important;
    transform: scale(1.02) !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25) !important;
  }

  .mobile-topbar-hamburger:active {
    transform: scale(0.97) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }

  .mobile-topbar-icon-hamburger,
  .mobile-topbar-icon-close {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
    transition: opacity 0.2s !important;
  }

  .mobile-topbar-icon-close {
    position: absolute !important;
  }

  .mobile-topbar-icon-close.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .mobile-topbar-icon-hamburger.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .mobile-topbar-icon-close:not(.hidden) {
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* İkon linkler: modern pill, hafif arka plan */
  .mobile-topbar-icon-link {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    border: none !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .mobile-topbar-icon-link:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%) !important;
    color: #93c5fd !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
  }

  .mobile-topbar-icon-link:active {
    transform: scale(0.96) !important;
  }

  .mobile-topbar-icon-link svg {
    width: 24px !important;
    height: 24px !important;
  }

  .mobile-topbar-badge {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    min-width: 20px !important;
    height: 20px !important;
    padding: 0 5px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #fff !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }

  /* Logo alanı: kutusuz, sade */
  .mobile-topbar-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: inherit !important;
    max-width: 100% !important;
    padding: 0 6px !important;
    transition: opacity 0.25s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .mobile-topbar-logo:hover {
    opacity: 0.9 !important;
  }

  .mobile-topbar-logo:active {
    opacity: 0.85 !important;
  }

  /* Logo görseli: %80 büyütülmüş */
  .mobile-topbar-logo img {
    height: 79px !important;
    max-height: 79px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)) !important;
  }

  .mobile-topbar-logo-text {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 200px !important;
    letter-spacing: -0.02em !important;
    background: linear-gradient(135deg, #fff 0%, #93c5fd 50%, #c4b5fd 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
  }

  /* Kullanıcı avatar: modern daire, gradient halka, yumuşak glow */
  .mobile-topbar-user {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    padding: 0 !important;
    border: none !important;
    background: linear-gradient(145deg, rgba(30, 35, 48, 0.95) 0%, rgba(20, 24, 35, 0.98) 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
    box-shadow:
      0 0 0 2px rgba(59, 130, 246, 0.5),
      0 0 0 4px rgba(139, 92, 246, 0.15),
      0 6px 20px rgba(0, 0, 0, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    position: relative !important;
  }

  .mobile-topbar-user:hover {
    transform: scale(1.06) !important;
    box-shadow:
      0 0 0 3px rgba(59, 130, 246, 0.6),
      0 0 28px rgba(59, 130, 246, 0.35),
      0 8px 28px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  }

  .mobile-topbar-user:active {
    transform: scale(0.96) !important;
    box-shadow:
      0 0 0 2px rgba(59, 130, 246, 0.4),
      0 4px 12px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  }

  .mobile-topbar-user img {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25) !important;
  }

  /* Baş harfler (div) ortada */
  .mobile-topbar-user div {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    line-height: 1 !important;
  }

  /* Giriş butonu: gradient, pill */
  .mobile-topbar-login {
    padding: 12px 22px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #fff !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(30, 64, 175, 0.95) 50%, rgba(139, 92, 246, 0.6) 100%) !important;
    border: none !important;
    border-radius: 16px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
  }

  .mobile-topbar-login:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  }

  .mobile-topbar-login:active {
    transform: translateY(0) scale(0.98) !important;
  }

  body {
    padding-top: calc(100px + env(safe-area-inset-top, 0px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

@media (min-width: 992px) {
  .mobile-topbar {
    display: none !important;
  }
  .main-header {
    display: block !important;
  }
}
