/* ============ CSS VARIABLES (Colors from FPL Elite Logo) ============ */
:root {
    --primary-dark: #1a1a2e;
    --primary-mid: #16213e;
    --accent-red: #e94560;
    --accent-gold: #c9a84c;
    --accent-teal: #0f3460;
    --white: #ffffff;
    --white-soft: #f5f5f5;
    --gray-light: #e0e0e0;
    --gray-mid: #999;
    --gray-dark: #333;
    --text-primary: #1a1a2e;
    --text-secondary: #555;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Cairo', sans-serif;
    background: var(--white-soft);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* ============ LANGUAGE MODAL ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    max-width: 90%;
    width: 350px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--gray-mid);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-family: 'Cairo', sans-serif;
}

.language-buttons {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.lang-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--accent-red);
    background: var(--white);
    color: var(--accent-red);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    background: var(--accent-red);
    color: var(--white);
    transform: translateY(-2px);
}

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

/* ============ HEADER ============ */
#mainHeader {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-mid));
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    object-fit: cover;
}

.header-text h1 {
    font-size: 1.3rem;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-text p {
    font-size: 0.9rem;
    color: var(--accent-gold);
    font-family: 'Cairo', sans-serif;
}

/* ============ NAVIGATION ============ */
#mainNav {
    display: flex;
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 74px;
    z-index: 99;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-btn {
    flex: 1;
    min-width: fit-content;
    padding: 0.75rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-text {
    font-size: 0.7rem;
}

/* ============ MAIN CONTENT ============ */
#content {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 60vh;
}

/* ============ CARDS ============ */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-red);
}

/* ============ RANKINGS TABLE (Mobile Optimized) ============ */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ranking-table th {
    background: var(--primary-dark);
    color: var(--white);
    padding: 0.6rem 0.4rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-align: center;
}

.ranking-table td {
    padding: 0.6rem 0.4rem;
    text-align: center;
    border-bottom: 1px solid var(--gray-light);
}

.ranking-table tr:nth-child(even) {
    background: var(--white-soft);
}

.ranking-table tr:hover {
    background: rgba(233, 69, 96, 0.05);
}

.rank-badge {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
}

.rank-1 { background: var(--accent-gold); color: var(--white); }
.rank-2 { background: #c0c0c0; color: var(--white); }
.rank-3 { background: #cd7f32; color: var(--white); }

/* ============ TEAM CARD ============ */
.team-card {
    background: linear-gradient(135deg, var(--primary-mid), var(--primary-dark));
    color: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.team-card h3 {
    color: var(--accent-gold);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.team-members {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.member-tag {
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.captain-badge {
    background: var(--accent-gold);
    color: var(--primary-dark);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: 25px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--accent-red);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

.btn-primary:hover {
    background: #d63850;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--accent-red);
    border: 2px solid var(--accent-red);
}

.btn-outline:hover {
    background: var(--accent-red);
    color: var(--white);
}

/* ============ FOOTER ============ */
#mainFooter {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-mid);
    font-size: 0.8rem;
    background: var(--white);
    border-top: 1px solid var(--gray-light);
}

#mainFooter a {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 600;
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 480px) {
    #content {
        padding: 0.75rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .ranking-table {
        font-size: 0.75rem;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 0.5rem 0.3rem;
    }
}

/* ============ ARABIC SUPPORT ============ */
[lang="ar"] {
    direction: rtl;
    font-family: 'Cairo', 'Inter', sans-serif;
}

[lang="ar"] .header-content {
    flex-direction: row-reverse;
}

[lang="ar"] .nav-btn {
    flex-direction: column-reverse;
}