/**
 * Mobil uyumluluk - Google Mobile Friendly test
 * 1. Responsive tasarım
 * 2. Mobil font boyutları (min 16px)
 * 3. Dokunma alanları (min 48x48px)
 * 4. Viewport head-seo'da tanımlı
 */

/* Safe area - çentikli ekranlar */
@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== MOBİL FONT BOYUTLARI ===== */
@media (max-width: 768px) {
  html {
    font-size: 100%; /* 16px - zoom önleme, okunabilirlik */
  }
  body {
    font-size: 1rem;
  }
}

/* ===== DOKUNMA ALANLARI (min 48x48px) ===== */
@media (max-width: 768px) {
  .navbar-menu-item {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .match-filter-btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .match-filter-date-arrow {
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
  }
  .btn-tracked-list {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 16px;
  }
  .sidebar-league-item {
    min-height: 48px;
    padding: 12px 0;
  }
  .site-footer-links a {
    min-height: 48px;
    padding: 12px 8px;
    display: inline-flex;
    align-items: center;
  }
  .modal-close {
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
  }
  .match-row {
    min-height: 56px;
    padding: 14px 16px;
  }
  a.match-row {
    -webkit-tap-highlight-color: transparent;
  }
  .breadcrumb-jump-icon {
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
  }
  .detail-similar-item {
    min-height: 48px;
    padding: 10px 14px;
  }
}

/* ===== HAMBURGER MENÜ ===== */
.navbar-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.navbar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
.navbar-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar-toggle.active span:nth-child(2) {
  opacity: 0;
}
.navbar-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .navbar-toggle {
    display: flex;
  }
  .navbar-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #333;
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    z-index: 99;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s, opacity 0.2s;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  }
  .navbar-menu.open {
    max-height: 90vh;
    overflow-y: auto;
    opacity: 1;
  }
  .navbar-menu-item {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 1rem;
  }
  /* Mobil: dropdown inline (accordion) */
  .navbar-dropdown-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .navbar-dropdown {
    position: static;
    transform: none;
    min-width: auto;
    background: rgba(0,0,0,0.2);
    border: none;
    border-radius: 8px;
    margin-top: 4px;
    margin-left: 0;
    padding: 4px 0 4px 12px;
    box-shadow: none;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: max-height 0.3s;
  }
  .navbar-dropdown-wrap.open .navbar-dropdown {
    max-height: 300px;
  }
  .navbar-dropdown-item {
    padding: 10px 12px;
    font-size: 0.95rem;
  }
}

/* ===== RESPONSIVE LAYOUT İYİLEŞTİRMELERİ ===== */
@media (max-width: 768px) {
  .page-layout {
    padding: 0 12px;
  }
  .main-content {
    padding: 12px;
  }
  .match-filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    gap: 12px;
  }
  .match-filter-buttons {
    justify-content: center;
  }
  .match-filter-date-wrap {
    justify-content: center;
  }
  .match-filter-toggles {
    flex-direction: row;
    justify-content: center;
  }
  .match-search-in-filter {
    max-width: none;
    min-width: 0;
  }
}

/* Mobilde Tümü/Canlı/Biten butonları gizle */
@media (max-width: 768px) {
  .match-filter-buttons {
    display: none !important;
  }
  .match-filter-bar {
    padding: 8px 0;
  }
}

/* Mobilde maç tablosu %100, kenar boşluk yok */
@media (max-width: 768px) {
  .page-layout {
    padding: 0 !important;
  }
  .main-content {
    padding: 8px !important;
  }
  .livescore-table,
  .league-block,
  .league-matches {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Mobilde ana sayfa maç tablosu - okunaklı, taşma yok */
@media (max-width: 768px) {
  .livescore .ms-row,
  .livescore .match-row {
    gap: 4px 6px !important;
    padding: 10px 12px !important;
    min-height: 52px !important;
  }
  .livescore .ms-time {
    flex: 0 0 30px !important;
    font-size: 0.7rem !important;
  }
  .livescore .ms-status {
    flex: 0 0 22px !important;
    font-size: 0.6rem !important;
  }
  .livescore .ms-score-wrap {
    flex: 0 0 48px !important;
  }
  .livescore .ms-score {
    font-size: 0.8rem !important;
  }
  .livescore .ms-home,
  .livescore .ms-away {
    font-size: 0.75rem !important;
    min-width: 0 !important;
  }
  .livescore .ms-row-index .ms-home,
  .livescore .ms-row-index .ms-away {
    gap: 4px !important;
  }
  .livescore .ms-logo {
    width: 16px !important;
    height: 16px !important;
  }
  .livescore .ms-ht {
    display: none !important; /* İY sütunu mobilde gizle */
  }
  .livescore .ms-star-btn {
    flex: 0 0 28px !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
  }
  .livescore .ms-star-btn svg {
    width: 14px !important;
    height: 14px !important;
  }
  .league-strip {
    padding: 8px 12px !important;
  }
  .league-strip-name {
    font-size: 0.7rem !important;
  }
}

/* Mobil footer: tam link listesi gizle; kompakt mini footer + copyright */
@media (max-width: 768px) {
  .site-footer-top {
    display: none !important;
  }
  .site-footer-mobile-cta {
    display: none !important;
  }
  .site-footer-mobile-mini {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    padding: 12px 16px 0;
    font-size: 0.9rem;
  }
  .site-footer-mobile-mini a {
    color: var(--accent-green);
    text-decoration: none;
  }
  .site-footer-mobile-mini a:hover { text-decoration: underline; }
  .site-footer-mobile-sep {
    color: var(--text-muted);
    pointer-events: none;
  }
  .site-footer-mobile-trust {
    flex: 0 0 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
  }
  .site-footer-bottom {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }
}
@media (min-width: 769px) {
  .site-footer-mobile-mini { display: none !important; }
}

/* Üyelik butonu dokunma alanı (WCAG 2.5.5) */
@media (max-width: 768px) {
  .btn-login {
    min-height: 48px;
    min-width: 48px;
    padding: 10px 16px;
  }
}

/* Mobil menü ikonu sola yaklaştır */
@media (max-width: 900px) {
  .navbar {
    padding-left: 4px;
  }
  .navbar-inner {
    padding-left: 4px;
    gap: 8px;
  }
  .navbar-toggle {
    margin-right: 2px;
  }
}

@media (max-width: 480px) {
  .navbar-inner {
    padding: 0 8px;
  }
  .navbar-actions {
    gap: 6px;
  }
  .logo {
    font-size: 1.35rem;
  }
  .match-teams {
    gap: 8px;
  }
  .match-team-name {
    font-size: 0.9rem;
  }
  .match-score {
    font-size: 1rem;
  }
}

/* ===== YATAY TAŞMA ÖNLEME ===== */
@media (max-width: 768px) {
  body, html {
    overflow-x: hidden;
  }
  .main-content {
    overflow-x: hidden;
  }
  img {
    max-width: 100%;
    height: auto;
  }
}

/* ===== INPUT/FORM MOBİL ===== */
@media (max-width: 768px) {
  input, select, textarea, button {
    font-size: 16px !important; /* iOS zoom önleme */
  }
}

/* ===== MAÇ DETAY - Anket ve Yapay Zeka mobilde görünsün ===== */
@media (max-width: 768px) {
  .detail-ai-poll-wrap,
  .detail-ai-block,
  .detail-poll-block,
  .match-broadcast-block .detail-ai-poll-wrap {
    display: block !important;
    visibility: visible !important;
  }
  .detail-ai-poll-row {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
  }
}

/* ===== MAÇ DETAY - Mobil genişlik ve tablolar ===== */
@media (max-width: 768px) {
  .main-content .match-broadcast-block,
  .main-content .match-lineup-block,
  .main-content .match-commentary-block,
  .main-content .match-related-news-block,
  .main-content .detail-breadcrumb-wrap,
  .main-content .match-header-inner,
  .lineup-tabs-block .lineup-tab-panel,
  .detail-above-tabs,
  .match-related-content-block {
    max-width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .match-lineup-block.lineup-tabs-block,
  .match-broadcast-block {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .lineup-table,
  .events-table,
  .standings-table,
  .unavailable-table,
  .h2h-table,
  table {
    width: 100% !important;
    max-width: 100% !important;
  }
  /* Tab menüde sadece ikonlar */
  .lineup-tab-btn {
    font-size: 0 !important;
    padding: 8px 12px !important;
  }
  .lineup-tab-btn .ms-icon {
    font-size: 22px !important;
  }
  /* Logolar üstündeki yönlendirme ikonlarını gizle */
  .breadcrumb-jump-icons {
    display: none !important;
  }
}

/* Canlı sayfa - mobilde Yaklaşan butonunu gizle */
@media (max-width: 768px) {
  .canli-widget-wrap .navtab-header button:last-child,
  .canli-widget-wrap .navtab-header a:last-child,
  .canli-widget-wrap [class*="navtab-header"] button:last-child,
  .canli-widget-wrap [class*="navtab-header"] a:last-child,
  .canli-widget-wrap .widget-toolbar-btns button:last-child,
  .canli-widget-wrap .widget-toolbar-btns a:last-child,
  .canli-widget-wrap [class*="widget-toolbar"] button:last-child,
  .canli-widget-wrap [class*="widget-toolbar"] a:last-child,
  .canli-widget-wrap .btn-widget:last-of-type,
  .canli-widget-wrap .btn-widget-link:last-of-type,
  .canli-widget-wrap [data-tab="scheduled"] { display: none !important; }
}

/* Ana sayfa Maç Özetleri - mobilde 3 büyük görsel yan yana, kaydırmalı */
@media (max-width: 768px) {
  .home-videos-strip .home-videos-strip-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .home-videos-strip .home-videos-strip-track {
    width: calc(var(--strip-total) * 33.333%) !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 8px !important;
  }
  .home-videos-strip .home-videos-strip-item {
    flex: 0 0 calc(33.333% - 6px) !important;
    min-width: calc(33.333% - 6px) !important;
    scroll-snap-align: start;
  }
  .home-videos-strip .home-video-thumb-img {
    aspect-ratio: 16/9;
    min-height: 45px !important;
    max-height: 55px !important;
  }
  .home-videos-strip .home-video-thumb-title {
    padding: 5px 8px !important;
    font-size: 0.72rem !important;
  }
}
