:root {
    --primary-color: #2E5AAC;
    --accent-gold: #C8102E;
    --light-teal: #4A7BC8;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --match-brown: #8b6f47;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background: var(--light-gray);
}

/* Header */
header {
    background: #fff;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo-container {
    text-align: right;
}

.logo-container img {
    max-width: 300px;
    height: auto;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    display: inline-block;
}

.nav-menu a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: block;
}

.nav-menu a:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.nav-menu a.active {
    background: var(--accent-gold);
    color: var(--white);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background: var(--primary-color);
    margin: 6px 0;
    transition: 0.3s;
    border-radius: 3px;
}

/* Main Content */
.groups-main {
    min-height: 70vh;
    padding: 3rem 1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 900;
    font-family: 'Cairo', sans-serif;
    color: var(--primary-color);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-button {
    padding: 1.2rem 3rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    background: var(--white);
    color: var(--primary-color);
    border: 3px solid var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-button:hover {
    background: var(--light-teal);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 90, 172, 0.2);
}

.tab-button.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 6px 25px rgba(46, 90, 172, 0.3);
}

/* Category Content */
.category-content {
    display: none;
}

.category-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Group Selector */
.group-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.group-selector label {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Cairo', sans-serif;
}

.group-select {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    background: var(--white);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.group-select:hover {
    background: var(--light-gray);
    border-color: var(--light-teal);
}

.group-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 63, 66, 0.2);
}

/* Groups Container */
.groups-container {
    position: relative;
}

.group-table-wrapper {
    display: none;
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
    margin-bottom: 3rem;
}

.group-table-wrapper.active {
    display: block;
}

.group-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

/* Table Scroll Container */
.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin: 0 -2rem;
    padding: 0 2rem;
}

/* Match-up Table */
.matchup-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
    font-family: 'Tajawal', sans-serif;
}

.matchup-table thead th {
    background: var(--primary-color);
    color: var(--white);
    padding: 1.5rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.matchup-table thead th.team-header {
    background: var(--accent-gold);
    font-size: 1.3rem;
    min-width: 180px;
}

.matchup-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.matchup-table tbody td {
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 1rem;
    line-height: 1.6;
}

.matchup-table tbody td.team-name {
    background: var(--light-gray);
    font-weight: 700;
    text-align: center;
    color: var(--primary-color);
    position: sticky;
    right: 0;
    z-index: 5;
    border-left: 3px solid var(--primary-color);
    min-width: 180px;
}

.matchup-table tbody td.match-cell {
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.matchup-table tbody td.match-cell:hover {
    background: #e8f0fc;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(46, 90, 172, 0.2);
}

.matchup-table tbody td.match-cell::after {
    content: '⚡';
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.matchup-table tbody td.match-cell:hover::after {
    opacity: 1;
}

.matchup-table tbody td.no-match {
    background: repeating-linear-gradient(45deg, #dedede, #f5f5f5 10px, var(--white) 10px, var(--white) 20px);
    border: 2px solid #ffffff;
}

/* Placeholder Text */
.placeholder-text {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.3rem;
    color: #666;
    font-family: 'Cairo', sans-serif;
}

.placeholder-text h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

/* Footer */
footer {
    padding: 4rem 2rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a3a6b 100%);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 4rem;
}

.sponsors-section {
    margin-bottom: 3rem;
}

.sponsors-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    letter-spacing: 1px;
}

.sponsors-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}

.sponsor-logo {
    max-width: 150px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.sponsor-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.social-media {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-icon {
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    font-family: 'Cairo', sans-serif;
}

.footer-divider {
    width: 100px;
    height: 3px;
    background: var(--accent-gold);
    margin: 2rem auto;
}

.copyright {
    font-size: 0.95rem;
    opacity: 0.7;
    margin-top: 2rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .logo-container {
        order: 1;
        flex: 0 0 auto;
    }

    .menu-toggle {
        display: block;
        order: 2;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        order: 3;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        text-align: center;
        padding: 1rem;
    }

    .logo-container img {
        max-width: 200px;
    }

    .page-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }

    .category-tabs {
        gap: 0.8rem;
    }

    .tab-button {
        padding: 1rem 2rem;
        font-size: 1.2rem;
    }

    .group-selector {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 1rem;
    }

    .group-selector label {
        font-size: 1.1rem;
    }

    .group-select {
        width: 100%;
        min-width: auto;
    }

    .group-table-wrapper {
        padding: 1rem;
    }

    .group-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .table-scroll {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .matchup-table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    .matchup-table thead th {
        padding: 1rem 0.5rem;
        font-size: 0.85rem;
    }

    .matchup-table thead th.team-header {
        font-size: 1rem;
        min-width: 140px;
    }

    .matchup-table tbody td {
        padding: 1rem 0.5rem;
        font-size: 0.85rem;
    }

    .matchup-table tbody td.team-name {
        min-width: 140px;
    }

    .sponsors-grid {
        gap: 1.5rem;
    }

    .sponsor-logo {
        max-width: 100px;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .tab-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .matchup-table {
        min-width: 500px;
    }

    .matchup-table thead th {
        padding: 0.8rem 0.4rem;
        font-size: 0.75rem;
    }

    .matchup-table tbody td {
        padding: 0.8rem 0.4rem;
        font-size: 0.75rem;
    }
}
