/* ==========================================================================
   AGF TABLOSU & KUPON PANELERİ STİLLERİ (Tema Uyumlu)
   ========================================================================== */

/* Layout: Left AGF Table vs Right Coupon Panel */
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
}

/* AGF Table Container */
.agf-table-container {
  padding: 0;
}

/* Hipodrom Kırmızı Başlık Çubuğu */
.agf-venue-header {
  background: linear-gradient(90deg, #c62828, #b71c1c);
  color: #ffffff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agf-venue-header h2 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.header-tevzi-info {
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 12px;
  border-radius: 6px;
  color: #ffffff;
}

/* Ayak Navigasyon Sekmeleri */
.agf-legs-nav {
  display: flex;
  background: #0f172a; /* Lacivert zemin */
  border-bottom: 1px solid var(--border-glass);
}

.leg-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
  padding: 12px 8px;
  cursor: pointer;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  transition: all 0.2s ease;
}

.leg-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.leg-tab-btn.active {
  background: #1e293b;
  color: #ffffff;
  border-bottom: 3px solid #c62828;
}

.leg-count-badge {
  background: var(--accent-gold);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

.leg-count-badge.green-badge {
  background: #059669;
  color: #ffffff;
}

/* Koşu Meta Bilgi Çubuğu */
.current-leg-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card-inner);
  border-bottom: 1px solid var(--border-glass);
}

.leg-title-meta {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.leg-time-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.leg-tools-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-tool {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tool:hover {
  color: var(--text-main);
  border-color: var(--accent-gold);
  background: var(--navy-light);
}

/* AGF Custom Table */
.agf-table-wrapper {
  overflow-x: auto;
}

.agf-custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.agf-custom-table th {
  background: #0f172a; /* Lacivert Şık Başlık */
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

.agf-custom-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
  color: var(--text-main);
}

/* SATIR VURGULARI */
.agf-row {
  transition: background 0.2s ease;
}

.agf-row:hover {
  background: var(--navy-light);
}

/* Kupon Hesaplayıcı Seçilen Satır (Mavi/Lacivert Tint) */
.agf-row.row-selected-blue {
  background: #eff6ff !important;
  color: #1e40af;
}

[data-theme="dark"] .agf-row.row-selected-blue {
  background: rgba(25, 118, 210, 0.25) !important;
  color: #ffffff;
}

/* Kazanan At Yeşil Flu Satır */
.agf-row.row-green-winner-flu {
  background: #ecfdf5 !important;
}

[data-theme="dark"] .agf-row.row-green-winner-flu {
  background: rgba(0, 230, 118, 0.15) !important;
}

.agf-row.row-green-winner-flu .horse-title {
  color: #059669;
  font-weight: 800;
}

[data-theme="dark"] .agf-row.row-green-winner-flu .horse-title {
  color: #00e676;
}

.winner-badge-green {
  background: #059669;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.text-green-bold {
  color: #059669;
  font-weight: 800;
}

/* Koşudan Çıkan Atlar Pembe/Kırmızı Satır */
.agf-row.row-red-withdrawn {
  background: #fef2f2 !important;
  opacity: 0.75;
}

[data-theme="dark"] .agf-row.row-red-withdrawn {
  background: #3a181a !important;
  opacity: 0.65;
}

.withdrawn-badge {
  background: #c62828;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

.td-center { text-align: center; }
.font-bold { font-weight: 800; }
.muted-text { color: var(--text-dim); }

.chk-horse-select-ticket,
.radio-payout-winner {
  width: 16px;
  height: 16px;
  accent-color: #c62828;
  cursor: pointer;
}

.horse-name-flex {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.horse-title {
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.horse-equip-tags {
  font-size: 0.72em;
  font-weight: 500;
  opacity: 0.45;
  letter-spacing: 0.5px;
  margin-left: 2px;
}

.text-gold-bold { color: var(--accent-gold-light); font-weight: 800; }

.jockey-td {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Eküri Rozetleri */
.ekuri-pill-custom {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(217, 119, 6, 0.12) !important;
  color: #b45309 !important;
  border: 1px solid rgba(217, 119, 6, 0.35) !important;
}

[data-theme="dark"] .ekuri-pill-custom {
  background: rgba(245, 176, 39, 0.15) !important;
  color: #ffd700 !important;
}

/* AGF Bar Visual Box */
.agf-cell-box {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.agf-bar-bg {
  flex: 1;
  min-width: 40px;
  height: 6px;
  background: var(--border-glass);
  border-radius: 3px;
  overflow: hidden;
}

.agf-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.bar-gold { background: linear-gradient(90deg, #d97706, #f59e0b); }
.bar-green { background: linear-gradient(90deg, #059669, #0284c7); }

.agf-val {
  font-weight: 800;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
  color: var(--text-main);
}

.ekuri-total-agf {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
}

.btn-icon-withdrawn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}
.btn-icon-withdrawn.active { color: var(--accent-red-bright); }

/* RIGHT COUPON PANEL */
.right-coupon-panel {
  padding: 0;
  position: sticky;
  top: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
}

.coupon-header-banner {
  background: linear-gradient(135deg, #c62828 0%, #990000 100%);
  color: #ffffff;
  padding: 16px 20px;
  text-align: center;
}

.coupon-header-banner.banner-navy {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
}

.coupon-header-banner h3 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.coupon-header-banner p {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 2px;
}

.coupon-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payout-summary-card,
.selected-winners-card,
.selected-horses-card {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.card-subtitle {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.winner-leg-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-glass);
}

.winner-leg-line:last-child {
  border-bottom: none;
}

.winner-name-active {
  color: var(--accent-green-bright);
  font-weight: 800;
}

.winner-name-none {
  color: var(--text-dim);
  font-style: italic;
}

.summary-legs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.summary-leg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-glass);
}

.summary-leg-row:last-child {
  border-bottom: none;
}

.leg-tag {
  background: var(--navy-primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.leg-horses-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.selected-horse-chip {
  background: var(--navy-light);
  color: var(--navy-primary);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-block;
}

[data-theme="dark"] .selected-horse-chip {
  background: #133827;
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.no-select-text {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

.coupon-actions-area {
  margin-top: 2px;
}

.btn-clear-coupon {
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-clear-coupon:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.payout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.payout-row:last-child {
  margin-bottom: 0;
}

.payout-row.highlight-payout {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  border-top: 1px solid var(--border-glass);
  padding-top: 8px;
  margin-top: 8px;
}

.payout-row-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}

/* 2 AGF Çift Tablo Gösterim Stilleri */
.agf-two-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  justify-content: center;
}

.agf-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.agf-line.agf-active-game {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #10b981;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.agf-line.agf-inactive-game {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  font-weight: 500;
  opacity: 0.65;
}

.agf-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.85;
}

/* Mobile & Tablet Responsive Adjustments for Calculator & Ticket Cost Matrix */
@media (max-width: 768px) {
  .agf-venue-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 14px;
  }

  .agf-venue-header h2 {
    font-size: 15px;
  }

  .header-tevzi-info {
    font-size: 11px;
  }

  .agf-legs-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .agf-legs-nav::-webkit-scrollbar {
    display: none;
  }

  .leg-tab-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 12px;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .leg-table th,
  .leg-table td {
    padding: 6px 8px;
    font-size: 12px;
  }

  .agf-two-lines {
    font-size: 11px;
  }

  .btn-win-toggle {
    padding: 5px 8px;
    font-size: 11px;
  }

  .ticket-matrix {
    grid-template-columns: 1fr;
  }

  .horses-grid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)) !important;
    gap: 6px !important;
  }

  .horse-chip-label {
    padding: 6px 4px !important;
    font-size: 11px !important;
  }

  .payout-summary-card,
  .ticket-summary-card {
    padding: 14px;
    border-radius: 10px;
  }
}

