/* Match Detail Page */
.match-detail {
    padding: 0;
}

/* Top event section - player için margin */
.top-event {
    margin-bottom: 25px;
    position: relative;
    z-index: 100;
}

/* 3D Flip Card for Top Event Video Player */
.top-event .top-event-card-flip {
    perspective: 1200px;
    position: relative;
    width: 100%;
    min-height: 200px;
    /* Front card'ın içeriğine göre yükseklik belirlenir */
    height: auto;
    /* Player'ın üstte kalması için z-index */
    z-index: 100;
    /* Back card'ın front ile aynı konumda olması için */
    display: flex;
    flex-direction: column;
}

.top-event-card-flip.has-video {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.top-event-card-front,
.top-event-card-back {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.top-event-card-front {
    position: relative;
    width: 100%;
    /* Front card'ın yüksekliği içeriğine göre belirlenir */
    /* Parent container'ın yüksekliğini belirler */
    flex: 0 0 auto;
    /* Başlangıçta görünür */
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.top-event-card-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: rotateY(180deg);
    width: 100%;
    /* Front card ile aynı yükseklikte olması için - parent'ın tam yüksekliğini al */
    height: 100%;
    /* Front card'ın içeriği kadar yükseklik için min-height */
    min-height: 150px;
    /* Başlangıçta gizli - sadece flipped durumunda görünür */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Flipped durumunda front card gizli */
.top-event-card-flip.flipped .top-event-card-front {
    transform: rotateY(-180deg);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Flipped olmadığında front card görünür */
.top-event-card-flip:not(.flipped) .top-event-card-front {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Flipped durumunda back card görünür */
.top-event-card-flip.flipped .top-event-card-back {
    transform: rotateY(0deg);
    /* Flipped olduğunda iframe görünür ve yüklenebilir - en üstte */
    z-index: 200;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Flipped olmadığında back card gizli */
.top-event-card-flip:not(.flipped) .top-event-card-back {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Play Button - Tam Ortada */
.top-event-card-front .top-event-card {
    position: relative;
}

/* Hover efektini kapat (flip animasyonu için) */
.top-event-card-flip.has-video .top-event-card:hover {
    transform: none;
}

.top-event-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.95;
    pointer-events: auto;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.top-event-play-button:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
}

.top-event-play-button svg {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
    transition: all 0.3s ease;
    display: block;
}

.top-event-play-button:hover svg circle {
    fill: rgba(255, 255, 255, 1);
}

.top-event-play-button:hover svg {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

/* Video Container - Gradient border ile, 16:9 aspect ratio */
.top-event-video-container {
    position: relative;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: visible;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Gradient yeşil border */
    padding: 3px;
    background: linear-gradient(135deg, #afe743 0%, #2ed4bc 100%);
    box-sizing: border-box;
    /* Video container'ın üstte kalması için */
    z-index: 200;
    /* Front card ile aynı yükseklikte olması için - front card'ın min-height'ı kadar */
    min-height: 150px;
    /* Container'ın yüksekliği wrapper'a göre (16:9 + padding) */
    /* Wrapper 16:9 olduğu için container da otomatik olarak doğru yükseklikte olacak */
    /* Başlangıçta gizli - sadece flipped durumunda görünür */
    visibility: hidden;
    opacity: 0;
    display: none;
}

/* Flipped durumunda video container görünür */
.top-event-card-flip.flipped .top-event-video-container {
    visibility: visible;
    opacity: 1;
    display: block;
}

/* Flipped olmadığında video container gizli */
.top-event-card-flip:not(.flipped) .top-event-video-container {
    visibility: hidden;
    opacity: 0;
    display: none;
}

/* Video wrapper - 16:9 aspect ratio (1920x1080 baz alarak) */
.top-event-video-wrapper {
    width: calc(100% - 6px); /* padding için (3px left + 3px right) */
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    /* 16:9 aspect ratio (1920x1080) */
    aspect-ratio: 16 / 9;
    /* Fallback for older browsers */
    padding-bottom: 56.25%; /* 9/16 = 0.5625 */
    height: 0;
    margin: 0 auto;
}

/* Modern browsers için aspect-ratio kullan */
@supports (aspect-ratio: 16 / 9) {
    .top-event-video-wrapper {
        padding-bottom: 0;
        height: auto;
    }
}

.top-event-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 30;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.top-event-close-button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.top-event-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    display: block !important;
    box-sizing: border-box;
    /* Inspect element'te görünür olması için */
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1;
}

/* Video container back side - 16:9 aspect ratio wrapper'da tanımlı */

.top-bottom { position:absolute; left:50%; transform:translateX(-50%); bottom: 0; display:flex; align-items:center; justify-content:center; }
.live-minute { background: #dc2626; color: #ffffff; padding: 8px 12px; border-top-left-radius: 15px; border-top-right-radius: 15px; font-weight: 900; font-size: 12px; letter-spacing:0.5px; }
.top-league { font-weight: 900; font-size: 12px; color: black; background: #ffffffb5; padding: 4px 12px; border-top-left-radius: 15px; border-top-right-radius: 15px; }

.top-event-player {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-event-video-frame {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.top-event-video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.top-event-video-placeholder {
    text-align: center;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 500;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(15,23,42,0.45);
}

@media (max-width: 768px) {
    /* Mobile için daha hızlı animasyon */
    .top-event-card-front,
    .top-event-card-back {
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Touch optimizasyonu */
    .top-event-card-flip.has-video {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .top-event-play-button {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        transform: translate(-50%, -50%) scale(0.8);
    }
    
    .top-event-play-button:active {
        transform: translate(-50%, -50%) scale(0.9);
    }
    
    /* Mobile'da video container responsive - 16:9 */
    .top-event-video-container {
        max-width: 100%;
        min-height: 0;
    }
    
    /* Video wrapper mobile'da da 16:9, görünür */
    .top-event-video-wrapper {
        width: calc(100% - 6px);
        margin: 0 auto;
        /* Mobile'da da 16:9 aspect ratio */
        aspect-ratio: 16 / 9;
        padding-bottom: 56.25%;
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
    
    @supports (aspect-ratio: 16 / 9) {
        .top-event-video-wrapper {
            padding-bottom: 0;
            height: auto;
        }
    }
    
    .top-event-video-player {
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
    
    .top-event-card-flip {
        min-height: 0;
    }
    
    .top-event-card-back {
        min-height: 0;
    }
    
    /* Top name mobile için daha küçük font */
    .top-name {
        font-size: 16px;
        max-width: 120px;
    }
}

.match-detail-card {
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 0;
    position: relative;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin: 25px auto;
    max-width: 100%;
    z-index: 1;
}

.match-detail-league-chip,
.match-detail-league-logo,
.match-detail-league-name {
    display: none;
}

/* Match detail tabs - player'ın altında kalmalı */
.match-detail-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: nowrap;
    justify-content: space-between;
}

.match-detail-tabs::-webkit-scrollbar {
    display: none;
}

.match-detail-tab {
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.match-detail-tab.active {
    color: #fff;
    border-bottom-color: #afe743;
    background: rgba(255, 255, 255, 0.05);
}

.match-detail-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

/* Tab Content */

.match-detail-tab-content {
    display: none;
    padding: 5px;
}
#tab-h2h.match-detail-tab-content,
#tab-standings.match-detail-tab-content,
#tab-chat.match-detail-tab-content {
    padding-top: 18px;
}

#tab-chat .chat-placeholder {
    padding: 18px 20px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.4);
}

.match-detail-section {
    margin-bottom: 30px;
}

.match-detail-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Stats */
.match-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.match-stat-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
}

.match-stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

.match-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    min-width: 60px;
}

.match-stat-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.match-stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #afe743, #2ed4bc);
    transition: width 0.3s ease;
}

/* H2H */
.match-h2h {
    display: grid;
    gap: 12px;
}

.match-h2h-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.match-h2h-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.match-h2h-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.match-h2h-teams {
    font-size: 14px;
    color: #fff;
    flex: 1;
    text-align: center;
    margin: 0 15px;
}

.match-h2h-score {
    font-size: 16px;
    font-weight: 700;
    color: #afe743;
}

/* Predictions */
.match-predictions {
    margin-top: 25px;
    margin-bottom: 25px;
}

.match-predictions-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.match-predictions-card {
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.prediction-winner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prediction-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.prediction-value {
    font-size: 16px;
    font-weight: 700;
    color: #afe743;
}

.prediction-advice {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    line-height: 1.6;
}

.prediction-percentages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.prediction-percent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.prediction-percent-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.prediction-percent-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

@media (max-width: 768px) {
    .match-detail-teams {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .match-detail-score {
        order: -1;
        min-width: auto;
    }
    
    .match-stat-row {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .match-stat-label {
        text-align: center;
        font-size: 12px;
    }
}

/* Standings Table */

.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-header {
    display: grid;
    grid-template-columns: 40px 1fr 34px 34px 34px 34px 50px 34px 34px;
    gap: 10px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.standings-header .standings-col-played,
.standings-header .standings-col-win,
.standings-header .standings-col-draw,
.standings-header .standings-col-lose,
.standings-header .standings-col-goals,
.standings-header .standings-col-gd,
.standings-header .standings-col-points {
    text-align: right;
}

.standings-row {
    display: grid;
    grid-template-columns: 40px 1fr 44px 44px 44px 44px 60px 44px 44px;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.standings-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.standings-row-highlight {
    background: linear-gradient(135deg, rgba(175, 231, 67, 0.25) 0%, rgba(46, 212, 188, 0.25) 100%);
    border: 1px solid rgba(175, 231, 67, 0.4);
    box-shadow: 0 2px 8px rgba(175, 231, 67, 0.15);
    font-weight: 600;
    color: #fff;
}

.standings-row-highlight:hover {
    background: linear-gradient(135deg, rgba(175, 231, 67, 0.35) 0%, rgba(46, 212, 188, 0.35) 100%);
    box-shadow: 0 4px 12px rgba(175, 231, 67, 0.25);
}

.standings-col-rank {
    text-align: left;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.standings-row-highlight .standings-col-rank {
    color: #afe743;
}

.standings-col-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    min-width: 0;            /* allow ellipsis */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.standings-team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.standings-col-goals,
.standings-col-played,
.standings-col-win,
.standings-col-draw,
.standings-col-lose,
.standings-col-gd {
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 12px;
}

.standings-col-points {
    text-align: right;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.standings-row-highlight .standings-col-points {
    color: #afe743;
}

@media (max-width: 768px) {
    
    .standings-header,
    .standings-row {
        grid-template-columns: 26px 1fr 26px 26px 26px 26px 40px 26px 28px;
        gap: 4px;
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .standings-header .standings-col-played,
    .standings-header .standings-col-win,
    .standings-header .standings-col-draw,
    .standings-header .standings-col-lose,
    .standings-header .standings-col-goals,
    .standings-header .standings-col-gd,
    .standings-header .standings-col-points {
        text-align: right;
    }

    .standings-col-team {
        font-size: 11px;
        gap: 6px;
    }
    
    .standings-team-logo {
        width: 16px;
        height: 16px;
    }
    
    .standings-col-goals {
        font-size: 10px;
    }
    
    .standings-col-points {
        font-size: 11px;
        font-weight: 800;
    }
}

/* Odds */
.match-odds {
    padding: 20px;
}

/* Chat input styles */
.chat-input-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.chat-input {
    flex: 1;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 16px; /* Prevent iOS zoom */
    line-height: 1.4;
}
.chat-input::placeholder {
    color: rgba(255,255,255,0.5);
}
.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.25);
    background: rgba(15,23,42,0.55);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.chat-send-btn:hover {
    transform: translateY(-1px);
    background: rgba(15,23,42,0.7);
    border-color: rgba(148,163,184,0.4);
}
.chat-send-btn:active {
    transform: translateY(0);
}

.odds-bookmaker {
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.odds-bookmaker-name {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.odds-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.odds-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
}

.odds-bet-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.odds-values {
    display: flex;
    gap: 12px;
}

.odds-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.odds-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

.odds-number {
    font-size: 16px;
    font-weight: 700;
    color: #afe743;
}

@media (max-width: 768px) {
    .odds-values {
        gap: 6px;
    }
    
    .odds-value {
        padding: 6px;
    }
    
    .odds-number {
        font-size: 14px;
    }
}

/* Ensure active tab content is visible */
.match-detail-tab-content.active {
    display: block;
}

