/* Arabic Font Face */
@font-face {
    font-family: 'ABCFavoritArabic';
    src: url('../font/ABCFavoritArabic-Book.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #0D40A2;
    --primary-dark: #0A2F7A;
    --primary-light: #1E5BC7;
    --secondary-color: #F5F7FA;
    --text-dark: #2C3E50;
    --text-light: #6C757D;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --danger-color: #DC3545;
    --bg-color: #F8F9FA;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background: var(--bg-color);
    margin: 0;
    padding: 0;
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* RTL Support */
html[dir="rtl"],
html.rtl {
    direction: rtl;
}

html[dir="rtl"] body,
html.rtl body {
    font-family: 'ABCFavoritArabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
html[dir="rtl"] .team-name,
html[dir="rtl"] .tournament-title{
text-align: right;
}

html[dir="rtl"] .scoreboard-teams,
html.rtl .scoreboard-teams {
    flex-direction: row-reverse;
}

html[dir="rtl"] .schedule-match,
html.rtl .schedule-match {
    flex-direction: row-reverse;
}

html[dir="rtl"] .schedule-team.text-right,
html.rtl .schedule-team.text-right {
    text-align: left;
    justify-content: flex-start;
}

html[dir="rtl"] .schedule-team.text-right .schedule-flag,
html.rtl .schedule-team.text-right .schedule-flag {
    margin-left: 0;
    margin-right: 0.5rem;
}





html[dir="rtl"] .team-flag,
html.rtl .team-flag {
    margin-right: 0;
    margin-left: 0.6rem;
}

html[dir="rtl"] .screen-title {
    text-align: right;
}
html[dir="rtl"]  .schedule-flag{
    margin-left: 0.5rem;
}

html[dir="rtl"] .ranking-flag,
html.rtl .ranking-flag {
    margin-left: 0;
    margin-right: 1rem;
}

html[dir="rtl"] .player-icon,
html.rtl .player-icon {
    margin-right: 0;
    margin-left: 0.45rem;
}



html[dir="rtl"] .back-btn .fa-arrow-left:before,
html.rtl .back-btn .fa-arrow-left:before {
    content: "\f061"; /* arrow-right icon */
}

html[dir="rtl"] .tournament-info i,
html.rtl .tournament-info i {
    margin-right: 0;
    margin-left: 0.25rem;
}

html[dir="rtl"] .scoreboard-date i,
html[dir="rtl"] .scoreboard-time i,
html.rtl .scoreboard-date i,
html.rtl .scoreboard-time i {
    margin-right: 0;
    margin-left: 0.4rem;
}
html[dir="rtl"] .schedule-match .schedule-team:first-child{
    flex-direction: row-reverse;
}
html[dir="rtl"] .medal-match-meta i,
html.rtl .medal-match-meta i {
    margin-right: 0;
    margin-left: 0.25rem;
}

html[dir="rtl"] .team-card:hover,
html.rtl .team-card:hover {
    transform: translateX(-2px);
}

html[dir="rtl"] .ranking-item:hover,
html.rtl .ranking-item:hover {
    transform: translateX(-3px);
}
.no-ranking-msg {
    text-align: center;
    padding: 20px;
    font-size: 1.2rem;
    color: #999;
}
html[dir="rtl"] .team-details-card{
direction: rtl;
text-align: right;
}
/* Tournament Header - Compact */
.tournament-header {
    background: transparent;
    color: var(--primary-color);
    padding: 0.75rem 0;
    padding-bottom: 0;
    /* position: sticky; */
    /* top: 0; */
    /* z-index: 1; */
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(13, 64, 162, 0.2);
    padding: 2px;
    background: white;
}

.tournament-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--primary-color);
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.tournament-info {
    font-size: 0.7rem;
    opacity: 0.9;
    line-height: 1.3;
    margin: 0;
}

.tournament-info i {
    margin-right: 0.25rem;
    font-size: 0.65rem;
}

@media (min-width: 768px) {
    .tournament-header {
        padding: 1rem 0;
    }
    
    .logo-img {
        width: 70px;
        height: 70px;
    }
    
    .tournament-title {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }
    
    .tournament-info {
        font-size: 0.85rem;
    }
}

/* Navigation Buttons */
.nav-buttons-section {
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 99;
    padding: 0.75rem 0;
    padding-top: 0;
}

.nav-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 500px;
    margin: 0 auto;
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem 0.25rem;
    color: var(--text-light);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border-radius: 8px;
}

.nav-btn i {
    font-size: 1.1rem;
}

.nav-btn span {
    font-weight: 500;
    font-size: 0.65rem;
}

.nav-btn.active {
    color: var(--primary-color);
    background: rgba(13, 64, 162, 0.1);
    border-radius: 50px;
}

.nav-btn:hover {
    color: var(--primary-color);
    background: rgba(13, 64, 162, 0.05);
    border-radius: 50px;
}

@media (min-width: 768px) {
    .nav-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .nav-btn i {
        font-size: 1.3rem;
    }
    
    .nav-btn span {
        font-size: 0.75rem;
    }
}

/* App Screens */
.app-screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.app-screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 1rem 0 0.75rem;
    letter-spacing: -0.5px;
}

@media (min-width: 768px) {
    .screen-title {
        font-size: 1.8rem;
        margin: 1.5rem 0 1rem;
    }
}

/* Scoreboard Card - Enhanced */
.scoreboard-section {
    /* padding: 0.75rem 1rem; */
}

.scoreboard-card {
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.75rem;
}

.scoreboard-flag {
    width: 32px;
    height: 24px;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
}

.match-status {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-status.live {
    background: var(--danger-color);
    color: white;
    animation: pulse 2s infinite;
}

.match-status.upcoming {
    background: var(--primary-color);
    color: white;
}

.match-status.completed {
    background: var(--text-light);
    color: white;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.scoreboard-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0.75rem 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scoreboard-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.75rem 0;
    gap: 0.5rem;
}

.scoreboard-team {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-name-scoreboard {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.score-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    letter-spacing: -1px;
}

.scoreboard-vs {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    margin: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
}

.scoreboard-vs .match-status {
    margin: 0;
}

.scoreboard-meta {
    display: flex;
    flex-direction: column;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--secondary-color);
    gap: 0.75rem;
}

.scoreboard-date-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.scoreboard-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-dark);
    font-weight: 500;
}

.scoreboard-time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-dark);
    font-weight: 500;
}

.scoreboard-venue-full {
    width: 100%;
    display: flex;
    justify-content: center;
}

.scoreboard-date i,
.scoreboard-time i {
    color: var(--primary-color);
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
}

.scoreboard-date span,
.scoreboard-time span {
    color: var(--text-dark);
}

.venue-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    background: rgba(13, 64, 162, 0.08);
    width: 100%;
}

.venue-link:hover {
    color: var(--primary-dark);
    background: rgba(13, 64, 162, 0.15);
}

.venue-link i {
    font-size: 0.8rem;
}

@media (max-width: 767px) {
    .scoreboard-meta {
        gap: 0.6rem;
    }
}

@media (min-width: 768px) {
    .scoreboard-card {
        padding: 2rem;
    }
    
    .team-name-scoreboard {
        font-size: 1.1rem;
    }
    
    .score-display {
        font-size: 2.5rem;
    }
    
    .scoreboard-date,
    .scoreboard-time {
        font-size: 0.8rem;
    }
}

/* Groups Section - Super Minimal */
.groups-section {
    padding: 10px;
}

.group-card {
    background: white;
    border-radius: 8px;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 221px;
}

.group-card:hover {
    box-shadow: 0 2px 6px rgba(13, 64, 162, 0.1);
    border-color: rgba(13, 64, 162, 0.2);
}

.group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--secondary-color);
    letter-spacing: 0.3px;
}

.team-card {
    background: transparent;
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.team-card:hover {
    background: rgba(13, 64, 162, 0.05);
    border-color: rgba(13, 64, 162, 0.1);
    transform: translateX(2px);
}

.team-flag {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
    margin-right: 0.6rem;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.team-name {
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.2;
}

/* Team Details Screen */
#team-screen {
    padding: 1rem;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    color: var(--primary-dark);
}

.team-details-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.team-details-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--secondary-color);
}

.team-details-flag {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border: 2px solid #ddd;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.player-item {
    background: var(--secondary-color);
    padding: 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: background 0.2s ease;
    font-size: 12px;
}

.player-item:hover {
    background: #e8ecf1;
}

.player-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: 0.75rem;
}

/* Schedule Tabs */
.schedule-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0 1rem;
    border-bottom: 2px solid var(--secondary-color);
}

.schedule-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.schedule-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.schedule-tab:hover {
    color: var(--primary-color);
}

/* Schedule Cards */
#schedule-cards-container {
    /* padding: 0 1rem 1rem; */
}

.schedule-card {
    background: white;
    border-radius: 10px;
    padding: 0.9rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.schedule-flag {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 0.5rem;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.no-matches {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.schedule-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--secondary-color);
}

.schedule-date {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
}

.schedule-time {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
}

.schedule-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.schedule-team {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.schedule-team.text-right {
    justify-content: flex-end;
    text-align: right;
}

.schedule-team.text-right .schedule-flag {
    margin-right: 0;
    margin-left: 0.5rem;
}

.schedule-score {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 45px;
    text-align: center;
    flex-shrink: 0;
}

.schedule-status {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--secondary-color);
    text-align: center;
}

.schedule-venue {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--secondary-color);
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.live {
    background: var(--danger-color);
    color: white;
    animation: pulse 2s infinite;
}

.status-badge.upcoming {
    background: var(--primary-color);
    color: white;
}

.status-badge.completed {
    background: var(--text-light);
    color: white;
}

/* Medal Matches */
#medal-matches-container {
    padding: 0 1rem 0.75rem;
}

.medal-match-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
}

.medal-match-card.bronze {
    border-left-color: #CD7F32;
}

.medal-match-card.gold {
    border-left-color: #FFD700;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.medal-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.medal-match-card.bronze .medal-title {
    color: #CD7F32;
}

.medal-match-card.gold .medal-title {
    color: #FFD700;
}

.medal-match-teams {
    text-align: center;
    margin-bottom: 0.75rem;
}

.medal-match-teams strong {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.medal-match-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 0.75rem;
}

.medal-match-meta i {
    margin-right: 0.25rem;
}

/* Rankings - Enhanced */
#rankings-container {
    padding: 0 1rem 0.75rem;
}

.ranking-item {
    background: white;
    border-radius: 10px;
    padding: 0.9rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ranking-item.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #ffffff 100%);
    border-left: 4px solid #FFD700;
}

.ranking-item.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #ffffff 100%);
    border-left: 4px solid #C0C0C0;
}

.ranking-item.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #ffffff 100%);
    border-left: 4px solid #CD7F32;
}

.rank-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.ranking-item.rank-1 .rank-number,
.ranking-item.rank-2 .rank-number,
.ranking-item.rank-3 .rank-number {
    color: var(--text-dark);
}

.ranking-flag {
    width: 40px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    margin: 0 1rem;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.ranking-info {
    flex: 1;
}

.ranking-team-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.ranking-score {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Responsive */
@media (min-width: 768px) {
    .schedule-tabs {
        padding: 0;
    }
    
    .groups-section,
    #schedule-cards-container,
    #medal-matches-container,
    #rankings-container {
        padding: 0;
    }
    
    .group-card {
        padding: 1rem;
    }
    
    .schedule-card {
        padding: 1.1rem;
    }
    
    .ranking-item {
        padding: 1.1rem;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}
