/* ============================================
   TJK ALTILI GANYAN - MODERN PREMIUM v12.0
   ✅ AGF Premium tasarımı entegre edildi
   ✅ Dark/Light tema desteği
   ✅ Dropdown hipodrom seçici
   ✅ Modern button tasarımları
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== ANA CONTAINER ========== */
.tjk-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 20px; /* ← SABİT BUTON YOK, NORMAL PADDİNG */
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    border-radius: 10px;
}

/* ========== LOADING ========== */
.tjk-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 15px;
    color: #fff;
}

.tjk-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* ========== ŞEHİR DROPDOWN SELECTOR ========== */
.city-tabs {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.city-tabs label {
    font-weight: 700;
    font-size: 1.2em;
    color: #fff;
    white-space: nowrap;
    min-width: 180px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.city-dropdown {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 24px;
    border-radius: 10px;
    border: 2px solid rgba(52, 152, 219, 0.5);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15), rgba(46, 204, 113, 0.1));
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 50px;
}

.city-dropdown option {
    background: #2c3e50;
    color: #fff;
    padding: 12px;
    font-size: 1em;
    font-weight: 600;
}

.city-dropdown:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.25), rgba(46, 204, 113, 0.15));
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4), inset 0 1px 3px rgba(255, 255, 255, 0.2);
}

.city-dropdown:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.3), 0 6px 20px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

/* ========== ŞEHİR İÇERİK ========== */
.city-content {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.city-content.active {
    display: block;
}

/* ========== AGF TABLARI ========== */
.agf-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.agf-tab {
    flex: 1;
    padding: 14px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.agf-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.agf-tab.active {
    background: #2ecc71;
    color: #fff;
}

.agf-tab:active {
    transform: scale(0.95);
}

.agf-content {
    display: none;
}

.agf-content.active {
    display: block;
}

/* ========== KOŞU TABLARI ========== */
.race-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.race-tab {
    flex: 1;
    min-width: 80px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.race-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.race-tab.active {
    background: #e74c3c;
    color: #fff;
}

.race-tab.has-selection::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.8em;
}

.race-tab:active {
    transform: scale(0.95);
}

.race-content {
    display: none;
}

.race-content.active {
    display: block;
}

/* ========== BİLGİ KUTULARI ========== */
.tjk-bet-info {
    background: rgba(52, 152, 219, 0.15);
    border-left: 4px solid #3498db;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #5dade2;
}

.tjk-coupled-info {
    background: rgba(255, 193, 7, 0.15);
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #ffd54f;
}

.tjk-coupled-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.coupled-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.coupled-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* ========== SIRALAMA KONTROL ========== */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 12px;
}

.sort-controls span {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.sort-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sort-btn.active {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.sort-btn:active {
    transform: scale(0.95);
}

/* ========== TABLO STİLLERİ ========== */
.tjk-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    border-radius: 6px;
    overflow: hidden;
}

.tjk-table thead {
    background: #34495e;
}

.tjk-table thead th {
    padding: 14px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.5px;
}

.tjk-table thead th:nth-child(1) { width: 15%; }
.tjk-table thead th:nth-child(2) { width: 45%; }
.tjk-table thead th:nth-child(3) { width: 15%; }
.tjk-table thead th:nth-child(4) { width: 25%; }

.tjk-table tbody tr {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.tjk-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ✅ SEÇİLİ SATIR RENGİ: MODERN MAVİ */
.tjk-table tbody tr.selected {
    background: rgba(52, 152, 219, 0.3) !important;
    border-left: 4px solid #3498db;
}

.tjk-table tbody td {
    padding: 14px 12px;
    font-size: 15px;
    text-align: center;
    color: #fff;
}

.tjk-table tbody td:nth-child(2) {
    text-align: left;
    padding-left: 12px;
}

/* ========== AT NO ========== */
.horse-no {
    font-weight: 700;
    color: #e74c3c;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ========== AT ADI ========== */
.horse-name {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    line-height: 1.4;
}

/* ✅ KAZANAN KUPA İKONU ========== */
.winner-trophy {
    display: inline-block;
    margin-left: 6px;
    font-size: 16px;
    animation: trophy-shine 2s infinite;
}

@keyframes trophy-shine {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 3px #ffd700);
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 8px #ffd700);
    }
}

/* ========== AGF SIRASI ========== */
.agf-rank {
    font-weight: 600;
    font-size: 16px;
    color: #95a5a6;
}

.rank-1 { 
    color: #2ecc71;
    font-weight: 900;
}

/* ========== AGF ORANI ========== */
.agf {
    font-weight: 900;
    color: #2ecc71;
    font-size: 18px;
}

/* ========== EKÜRİ BADGE ========== */
.coupled-badge {
    display: inline-block;
    background: #f59e0b;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.coupled-badge-0 { background: #f59e0b; }
.coupled-badge-1 { background: #8b5cf6; }
.coupled-badge-2 { background: #ec4899; }
.coupled-badge-3 { background: #06b6d4; }
.coupled-badge-4 { background: #10b981; }
.coupled-badge-5 { background: #ef4444; }

/* ========== EKÜRİ GRUBU GÖRSEL ========== */
/* ========== EKÜRÜ SATIRLARI (GRUP BAZINDA FARKLI RENKLER) ========== */
.coupled-group-row[data-coupled="group_0"] {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05)) !important;
    border-left: 4px solid #f59e0b !important;
}

.coupled-group-row[data-coupled="group_1"] {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05)) !important;
    border-left: 4px solid #8b5cf6 !important;
}

.coupled-group-row[data-coupled="group_2"] {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.05)) !important;
    border-left: 4px solid #ec4899 !important;
}

.coupled-group-row[data-coupled="group_3"] {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05)) !important;
    border-left: 4px solid #06b6d4 !important;
}

.coupled-group-row[data-coupled="group_4"] {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05)) !important;
    border-left: 4px solid #10b981 !important;
}

.coupled-group-row[data-coupled="group_5"] {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05)) !important;
    border-left: 4px solid #ef4444 !important;
}

.coupled-group-row:hover {
    filter: brightness(1.2);
    transform: translateX(2px);
}

/* ========== EKÜRİ AGF GÖSTERİMİ ========== */
.agf-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.coupled-individual-agf {
    font-size: 12px;
    color: #ffd54f;
    font-weight: 600;
}

.coupled-total-agf {
    font-size: 16px;
    color: #f59e0b;
    font-weight: 900;
}

/* ========== KOŞMAZ AT ========== */
.tjk-scratch-row {
    background: rgba(231, 76, 60, 0.2) !important;
    opacity: 0.7;
}

.tjk-scratch-row .horse-name {
    text-decoration: line-through;
    color: #e74c3c;
}

.scratch-badge {
    display: inline-block;
    background: #dc2626;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* ========== İKİNCİ HESAPLA BUTONU (TABLO ALTINDA) ========== */
.calc-button-inline {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
    display: block;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-button-inline:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.5);
}

.calc-button-inline:active {
    transform: translateY(0);
}

/* ========== HESAPLA BUTONU (SABİT - SAYFANIN ALTINDA) - GİZLENDİ ========== */
.calc-button {
    display: none !important; /* ← BUTON GİZLENDİ */
}

/* ========== SONUÇ KONTEYNER (INLINE - MODAL DEĞİL) ========== */
#tjk-result-container {
    margin-top: 30px;
    margin-bottom: 30px;
}

.tjk-prize-container {
    background: rgba(46, 204, 113, 0.1);
    border: 2px solid rgba(46, 204, 113, 0.3);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tjk-prize-title {
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 25px;
    color: #2ecc71;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========== SEÇİLEN ATLAR ALANI ========== */
.tjk-result-selections {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.tjk-selection-race {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 4px solid #2ecc71;
}

.tjk-selection-race:last-child {
    margin-bottom: 0;
}

.tjk-selection-race-title {
    color: #fff;
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tjk-selection-horses {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tjk-horse-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: all 0.2s;
}

.tjk-horse-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.tjk-scratch-horse {
    opacity: 0.6;
    text-decoration: line-through;
}

.tjk-horse-no {
    min-width: 50px;
    font-size: 1.1em;
    font-weight: 700;
    color: #e74c3c;
}

.tjk-horse-name {
    flex: 1;
    padding: 0 15px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
}

.tjk-horse-agf {
    font-weight: 700;
    color: #2ecc71;
    font-size: 1.1em;
}

/* ========== BADGE'LER ========== */
.badge-coupled,
.badge-agf,
.badge-five {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    margin-left: 8px;
    color: white;
}

.badge-agf {
    background: #10b981;
}

.badge-five {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.7em;
}

.calc-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 700;
    margin-left: 8px;
}

.calc-type-badge.normal {
    background: #2ecc71;
    color: white;
}

.calc-type-badge.coupled {
    background: #f59e0b;
    color: white;
}

.calc-type-badge.max-agf {
    background: #8b5cf6;
    color: white;
}

/* ========== İKRAMİYE BİLGİLERİ ========== */
.tjk-prize-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
}

.tjk-prize-single {
    margin-bottom: 15px;
}

.tjk-prize-single:last-child {
    margin-bottom: 0;
}

.tjk-prize-subtitle {
    color: #2ecc71;
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 15px;
}

.tjk-prize-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.tjk-prize-row:last-child {
    margin-bottom: 0;
}

.tjk-prize-label {
    color: #95a5a6;
    font-weight: 600;
    font-size: 1em;
}

.tjk-prize-value {
    color: #2ecc71;
    font-weight: 700;
    font-size: 1.2em;
}

/* ========== DEVİR UYARISI ========== */
.tjk-prize-devir {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(253, 230, 138, 0.2));
}

.devir-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 3px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
    animation: devir-pulse 2s infinite;
}

@keyframes devir-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(255, 193, 7, 0.6);
    }
}

.devir-icon {
    font-size: 40px;
    animation: rotate-icon 3s linear infinite;
    flex-shrink: 0;
}

@keyframes rotate-icon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.devir-text {
    flex: 1;
    color: #ffd54f;
    font-size: 1em;
    line-height: 1.6;
}

.devir-text strong {
    font-size: 1.3em;
    color: #ffc107;
    display: block;
    margin-bottom: 5px;
}

/* ========== MOBİL OPTİMİZASYON - TABLET ========== */
@media (max-width: 768px) {
    .tjk-app {
        padding: 15px;
        padding-bottom: 15px; /* ← SABİT BUTON YOK */
    }

    .city-tabs {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 12px;
    }
    
    .city-tabs label {
        font-size: 1.1em;
        min-width: auto;
        text-align: center;
    }

    .city-dropdown {
        max-width: 100%;
        min-width: auto;
        padding: 14px 20px;
        font-size: 1em;
    }
    
    /* Sonuç alanı */
    .tjk-prize-container {
        padding: 20px 15px;
    }
    
    .tjk-prize-title {
        font-size: 1.5em;
    }
    
    .tjk-horse-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tjk-prize-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .devir-warning {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    
    .devir-icon {
        font-size: 36px;
    }
}

    .race-tab {
        min-width: 70px;
        font-size: 13px;
        padding: 10px 6px;
    }

    .tjk-table thead th {
        padding: 12px 10px;
        font-size: 11px;
    }

    .tjk-table tbody td {
        padding: 12px 10px;
        font-size: 14px;
    }

    .horse-no {
        font-size: 16px;
    }

    .horse-name {
        font-size: 13px;
    }

    .agf {
        font-size: 16px;
    }

    .calc-button {
        font-size: 18px;
        padding: 18px;
    }

    .calc-button-inline {
        font-size: 18px;
        padding: 16px;
    }
    
    .devir-warning {
        flex-direction: column;
        text-align: center;
        padding: 16px;
        gap: 12px;
    }
    
    .devir-icon {
        font-size: 36px;
    }
}

/* ========== MOBİL OPTİMİZASYON - KÜÇÜK MOBİL ========== */
@media (max-width: 480px) {
    .tjk-app {
        padding: 10px;
        padding-bottom: 10px; /* ← SABİT BUTON YOK */
    }

    .city-tabs {
        padding: 12px;
        gap: 10px;
    }

    .city-tabs label {
        font-size: 1em;
    }

    .city-dropdown {
        padding: 12px 16px;
        font-size: 0.95em;
    }
    
    /* Sonuç alanı */
    .tjk-prize-container {
        padding: 15px 10px;
    }
    
    .tjk-prize-title {
        font-size: 1.3em;
    }
    
    .tjk-selection-race-title {
        font-size: 1em;
    }
    
    .tjk-horse-no {
        min-width: 40px;
        font-size: 1em;
    }
    
    .tjk-horse-name {
        font-size: 0.9em;
        padding: 0 10px;
    }
    
    .tjk-horse-agf {
        font-size: 1em;
    }
    
    .tjk-prize-subtitle {
        font-size: 1.1em;
    }
    
    .tjk-prize-label {
        font-size: 0.9em;
    }
    
    .tjk-prize-value {
        font-size: 1.1em;
    }
    
    .devir-text {
        font-size: 0.9em;
    }
    
    .devir-text strong {
        font-size: 1.1em;
    }
}

    .race-tab {
        min-width: 60px;
        font-size: 12px;
        padding: 8px 4px;
    }

    .tjk-table thead th {
        padding: 10px 8px;
        font-size: 10px;
    }

    .tjk-table tbody td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .horse-no {
        font-size: 15px;
    }

    .horse-name {
        font-size: 12px;
    }

    .agf {
        font-size: 15px;
    }
    
    .calc-button {
        font-size: 16px;
        padding: 16px;
    }

    .calc-button-inline {
        font-size: 16px;
        padding: 14px;
    }
    
    .result-horses .horse-no {
        min-width: 35px;
        font-size: 14px;
    }
    
    .result-horses .horse-name {
        font-size: 12px;
    }
    
    .result-horses .horse-agf {
        font-size: 13px;
    }
    
    .winner-trophy {
        font-size: 13px;
        margin-left: 4px;
    }
    
    .devir-text {
        font-size: 14px;
    }
    
    .devir-text strong {
        font-size: 20px;
    }
}