.istatistikler-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center
}

.istatistikler-modal.active {
  display: flex
}

.istatistikler-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .85)
}

.istatistikler-content {
  position: relative;
  background: var(--card-bg);
  width: 96%;
  max-width: 980px;
  max-height: 88vh;
  border-radius: calc(10px * var(--kose, 1));
  box-shadow: 0 4px 20px rgba(0, 0, 0, .6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color)
}

.istatistikler-header {
  padding: calc(10px * var(--yg, 1)) calc(14px * var(--yg, 1));
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.istatistikler-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500
}

.istatistikler-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: calc(4px * var(--yg, 1)) calc(8px * var(--yg, 1));
  transition: color .2s
}

.istatistikler-close:hover {
  color: var(--text-primary)
}

.istatistikler-tabs {
  display: flex;
  background: var(--primary-bg);
  padding: calc(6px * var(--yg, 1)) calc(8px * var(--yg, 1));
  gap: calc(4px * var(--yg, 1));
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  min-height: 40px
}

.istatistikler-tabs::-webkit-scrollbar {
  height: 3px
}

.istatistikler-tabs::-webkit-scrollbar-thumb {
  background: var(--hover-bg);
  border-radius: calc(3px * var(--kose, 1))
}

.istatistik-tab {
  padding: calc(5px * var(--yg, 1)) calc(12px * var(--yg, 1));
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: calc(5px * var(--kose, 1));
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap
}

.istatistik-tab:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--border-color)
}

.istatistik-tab.active {
  background: var(--accent-blue);
  color: var(--text-primary);
  border-color: var(--accent-blue)
}

.istatistikler-body {
  flex: 1;
  overflow-y: auto;
  padding: calc(10px * var(--yg, 1));
  background: var(--primary-bg)
}

.istatistikler-body::-webkit-scrollbar {
  width: 6px
}

.istatistikler-body::-webkit-scrollbar-thumb {
  background: var(--hover-bg);
  border-radius: calc(3px * var(--kose, 1))
}

.istatistikler-loading,
.istatistikler-error,
.istatistikler-info {
  text-align: center;
  padding: calc(28px * var(--yg, 1)) calc(16px * var(--yg, 1));
  color: var(--text-muted);
  font-size: 12.5px
}

.istatistikler-info i {
  margin-right: 6px;
  color: var(--accent-blue)
}

.h2h-container {
  max-width: 100%
}

.h2h-sub-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  background: var(--secondary-bg);
  border-radius: calc(5px * var(--kose, 1));
  padding: calc(2px * var(--yg, 1));
  border: 1px solid var(--border-color)
}

.h2h-sub-tab {
  flex: 1;
  padding: calc(5px * var(--yg, 1)) calc(10px * var(--yg, 1));
  background: transparent;
  border: none;
  border-radius: calc(4px * var(--kose, 1));
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s
}

.h2h-sub-tab:hover {
  color: var(--text-primary)
}

.h2h-sub-tab.active {
  background: var(--accent-blue);
  color: var(--text-primary)
}

.h2h-content {
  min-height: 0
}

.h2h-matches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(1px * var(--yg, 1));
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: calc(4px * var(--kose, 1));
  overflow: hidden
}

.h2h-team-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(1px * var(--yg, 1));
  margin-bottom: 0;
  background: var(--border-color);
  grid-column: 1/-1
}

.h2h-team-header {
  padding: calc(7px * var(--yg, 1)) calc(10px * var(--yg, 1));
  background: var(--secondary-bg);
  text-align: center
}

.h2h-team-header h3 {
  margin: 0;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(6px * var(--yg, 1))
}

.h2h-match {
  padding: calc(6px * var(--yg, 1)) calc(10px * var(--yg, 1));
  background: var(--card-bg);
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(8px * var(--yg, 1))
}

.h2h-match:hover {
  background: var(--secondary-bg)
}

.match-left {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--yg, 1));
  flex: 1;
  min-width: 0
}

.match-date {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 56px
}

.match-teams {
  flex: 1;
  min-width: 0
}

.match-team {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4
}

.match-team.highlight {
  color: var(--text-primary);
  font-weight: 600
}

.match-right {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--yg, 1))
}

.match-scores-vertical {
  display: flex;
  flex-direction: column;
  gap: calc(2px * var(--yg, 1))
}

.score-row {
  display: flex;
  gap: calc(4px * var(--yg, 1));
  align-items: center
}

.iy-score {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-secondary);
  min-width: 16px;
  text-align: center
}

.ms-score {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 16px;
  text-align: center
}

.result-badge {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.result-badge.win {
  background: var(--color-success);
  color: var(--text-primary)
}

.result-badge.lose {
  background: var(--color-error);
  color: var(--text-primary)
}

.result-badge.draw {
  background: var(--color-warning);
  color: var(--text-primary)
}

.over-under-values {
  display: flex;
  gap: calc(5px * var(--yg, 1));
  margin-bottom: 8px;
  background: var(--secondary-bg);
  border-radius: calc(5px * var(--kose, 1));
  padding: calc(5px * var(--yg, 1));
  border: 1px solid var(--border-color)
}

.ou-value-btn {
  flex: 1;
  padding: calc(5px * var(--yg, 1)) calc(10px * var(--yg, 1));
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: calc(4px * var(--kose, 1));
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s
}

.ou-value-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--border-color)
}

.ou-value-btn.active {
  background: var(--accent-blue);
  color: var(--text-primary);
  border-color: var(--accent-blue)
}

.result-badge-ou {
  min-width: 32px;
  height: 19px;
  border-radius: calc(10px * var(--kose, 1));
  padding: 0 calc(7px * var(--yg, 1));
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.result-badge-ou.win {
  background: var(--color-success);
  color: var(--text-primary)
}

.result-badge-ou.lose {
  background: var(--color-error);
  color: var(--text-primary)
}

.result-badge-ou.draw {
  background: var(--color-warning);
  color: var(--text-primary)
}

.h2h-match.empty {
  background: transparent;
  min-height: 42px
}

.no-matches {
  text-align: center;
  padding: calc(28px * var(--yg, 1)) calc(16px * var(--yg, 1));
  color: var(--text-muted);
  font-size: 12.5px;
  grid-column: 1/-1
}

/* Responsive - Tablet */

@media(max-width:900px) {
  .h2h-matches {
    grid-template-columns: 1fr;
  }
  /* Takım başlıkları mobilde yan yana kalsın */
  .h2h-team-headers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(1px * var(--yg, 1));
  }
}

/* Responsive - Mobile */

@media(max-width:640px) {
  .istatistikler-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .istatistikler-tabs {
    padding: calc(6px * var(--yg, 1));
    gap: calc(4px * var(--yg, 1));
    min-height: 44px;
  }
  .istatistik-tab {
    padding: calc(6px * var(--yg, 1)) calc(11px * var(--yg, 1));
    font-size: 11px;
  }
  /* Takım başlıkları mobilde yan yana - ZORUNLU */
  .h2h-team-headers {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: calc(1px * var(--yg, 1));
  }
  .h2h-team-header {
    padding: calc(8px * var(--yg, 1)) calc(6px * var(--yg, 1));
  }
  .h2h-team-header h3 {
    font-size: 11px;
    flex-direction: column;
    gap: calc(3px * var(--yg, 1));
  }
  /* Maçlar mobilde yan yana - 2 sütun */
  .h2h-matches {
    grid-template-columns: 1fr 1fr !important;
  }
  .h2h-match {
    padding: calc(8px * var(--yg, 1)) calc(6px * var(--yg, 1));
    flex-direction: column;
    align-items: flex-start;
    gap: calc(6px * var(--yg, 1));
  }
  .match-left {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(4px * var(--yg, 1));
    width: 100%;
  }
  .match-date {
    font-size: 10px;
    min-width: auto;
  }
  .match-teams {
    width: 100%;
  }
  .match-team {
    font-size: 11px;
  }
  .match-right {
    width: 100%;
    justify-content: space-between;
  }
  .match-scores-vertical {
    gap: calc(1px * var(--yg, 1));
  }
  .iy-score {
    font-size: 10px;
    min-width: 16px;
  }
  .ms-score {
    font-size: 14px;
    min-width: 16px;
  }
  .result-badge {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  .result-badge-ou {
    min-width: 32px;
    height: 20px;
    font-size: 9px;
    padding: 0 calc(6px * var(--yg, 1));
  }
}
