/* CSS Variables for Theme */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e5e7eb;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --live-color: #ef4444;
    --win-color: #10b981;
    --lose-color: #ef4444;
    --draw-color: #f59e0b;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #334155;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
}

/* Header */
.header {
    background-color: var(--bg-card);
    border-bottom: none;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.75rem 0;
        gap: 0.75rem;
    }
}

.logo-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-link:active {
    transform: scale(0.98);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
    cursor: pointer;
}

.nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--accent-color);
    color: white;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
}

.theme-toggle:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Main Content */
.main {
    flex: 1;
    padding: 2rem 0;
}

@media (max-width: 480px) {
    .main {
        padding: 1.5rem 0;
    }
}

/* Date Selector */
.date-selector {
    margin-bottom: 2rem;
}

.date-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .date-controls {
        gap: 0.5rem;
    }
}

.date-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (max-width: 480px) {
    .date-input {
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
    }
}

.date-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.date-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 44px; /* Better touch target */
}

@media (max-width: 480px) {
    .date-btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
        min-height: 42px;
    }
}

.date-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.today-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.today-btn:hover {
    background: var(--accent-color);
    color: white;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* Better touch target */
}

@media (max-width: 480px) {
    .filter-select {
        min-width: 100%;
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
        min-height: 42px;
    }
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Section Title */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    display: none;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ScoreBat Wrapper */
.scorebat-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    min-height: 760px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.scorebat-wrapper iframe {
    position: relative;
    z-index: 1;
    background: transparent;
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
    min-height: 760px;
}

.scorebat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2;
    pointer-events: none;
    cursor: default;
    display: none; /* Hidden by default - can be enabled if needed */
}

/* Optional: Enable overlay to completely block clicks (uncomment if needed) */
/*
.scorebat-overlay.active {
    display: block;
    pointer-events: auto;
    z-index: 100;
}
*/

.scorebat-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.scorebat-loading.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.scorebat-loading .spinner {
    margin-bottom: 1rem;
}

.scorebat-loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Matches Grid */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Match Card */
.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

@media (max-width: 480px) {
    .match-card {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .match-card:hover {
        transform: none; /* Disable hover transform on mobile */
    }
}

.match-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.league-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.match-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.match-status.live {
    background: var(--live-color);
    color: white;
    animation: pulse 2s infinite;
}

.match-status.ns {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.match-status.ft {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 0.5rem;
}

.team-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.3;
}

@media (max-width: 480px) {
    .team-name {
        font-size: 0.85rem;
    }
}

.match-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 1rem;
}

@media (max-width: 480px) {
    .match-score {
        font-size: 1.3rem;
        margin: 0 0.5rem;
        gap: 0.25rem;
    }
}

.match-score.separator {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .match-footer {
        font-size: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

.match-venue {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.no-matches {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* League Card */
.league-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.league-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.league-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.league-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.league-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.league-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Team Card */
.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    text-align: center;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.team-card-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 1rem;
}

.team-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Match Details Page */
.match-details {
    max-width: 800px;
    margin: 0 auto;
}

.match-details-header {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

@media (max-width: 480px) {
    .match-details-header {
        padding: 1.5rem 1rem;
        border-radius: 10px;
        margin-bottom: 1.5rem;
    }
}

.match-details-teams {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 2rem 0;
}

.match-details-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.match-details-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

@media (max-width: 480px) {
    .match-details-logo {
        width: 80px;
        height: 80px;
    }
    
    .match-details-name {
        font-size: 1.2rem;
    }
    
    .match-details-score {
        font-size: 2rem;
    }
    
    .match-details-teams {
        gap: 1.5rem;
        margin: 1.5rem 0;
    }
}

.match-details-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.match-details-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-color);
}

.match-details-info {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

@media (max-width: 480px) {
    .match-details-info {
        padding: 1rem;
        border-radius: 10px;
        margin-bottom: 0.75rem;
    }
    
    .match-details-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .info-row {
        padding: 0.5rem 0;
        font-size: 0.9rem;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .info-label,
    .info-value {
        font-size: 0.9rem;
    }
}

.match-details-info h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

@media (max-width: 480px) {
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer p {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }
    
    .footer-links {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .footer-links span {
        font-size: 0.85rem;
    }
}

.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.footer-links span {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .nav {
        width: auto;
        justify-content: flex-start;
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }

    .matches-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .match-teams {
        flex-direction: row;
        gap: 0.5rem;
    }

    .match-score {
        margin: 0 0.5rem;
    }

    .match-details-teams {
        flex-direction: column;
        gap: 2rem;
    }

    .match-details-score {
        font-size: 2rem;
    }

    .date-controls {
        flex-wrap: wrap;
    }

    .date-input {
        flex: 1;
        min-width: 150px;
    }

    .date-btn {
        flex: 1;
        min-width: 80px;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .match-card {
        padding: 1rem;
    }

    .team-logo {
        width: 45px;
        height: 45px;
    }
    
    .league-name {
        font-size: 0.8rem;
    }
    
    .match-status {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
    
    .match-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .match-teams {
        margin-bottom: 0.75rem;
    }
    
    .date-selector {
        margin-bottom: 1.5rem;
    }
    
    .filters {
        margin-bottom: 1.5rem;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    .header {
        padding: 0;
    }
    
    .no-matches {
        padding: 2rem 1rem;
        font-size: 1rem;
    }
    
    .loading {
        padding: 2rem 1rem;
    }
    
    .loading p {
        font-size: 0.9rem;
    }
}

/* Contact Form Styles */
.contact-section {
    max-width: 700px;
    margin: 0 auto;
}

.section-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-form-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-input,
.form-textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    width: 100%;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    padding: 1rem 2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-loader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner-small {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

.success-message {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 12px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--win-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success-message h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Privacy Page Styles */
.privacy-section {
    max-width: 900px;
    margin: 0 auto;
}

.privacy-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.privacy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.privacy-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.privacy-card h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.privacy-card p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
}

.privacy-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.privacy-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Responsive for Contact and Privacy */
@media (max-width: 768px) {
    .contact-form-container,
    .privacy-card {
        padding: 1.5rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .contact-form-container,
    .privacy-card {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .section-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .form-input,
    .form-textarea {
        padding: 0.65rem 0.85rem;
        font-size: 0.95rem;
        min-height: 42px;
    }
    
    .form-textarea {
        min-height: 100px;
    }
    
    .submit-btn {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .form-label {
        font-size: 0.95rem;
    }
    
    .privacy-card h3 {
        font-size: 1.1rem;
    }
    
    .privacy-card p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .success-message {
        padding: 1.5rem 1rem;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .success-message h3 {
        font-size: 1.3rem;
    }
    
    .success-message p {
        font-size: 1rem;
    }
}

