/*
Theme Name: Footv App Theme
Theme URI: https://footv.example.com
Description: A mobile-first app-like WordPress theme for a Yacine TV experience.
Version: 1.0
Author: Gemini
Author URI: https://gemini.google.com
Text Domain: footv-app-theme
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4

Tags: mobile-first, app, football, streaming, responsive, dark-mode, light-mode, pwa, adsense, accessibility

This theme delivers an app-like Yacine TV experience with a focus on performance, accessibility, SEO, responsiveness, and AdSense compliance.
*/

/* --- CSS Variables for Dark and Light Schemes --- */
:root {
    /* Light Mode Defaults */
    --color-primary: #dc2626; /* Red-600 */
    --color-secondary: #1e293b; /* Slate-800 */
    --color-accent: #2563eb; /* Blue-600 */
    --color-background: #ffffff;
    --color-surface: #f8fafc; /* Slate-50 */
    --color-text-primary: #1e293b; /* Slate-800 */
    --color-text-secondary: #475569; /* Slate-600 */
    --color-border: #e2e8f0; /* Slate-200 */
    --color-success: #22c55e; /* Green-500 */
    --color-warning: #f59e0b; /* Amber-500 */
    --color-error: #ef4444; /* Red-500 */
    --color-shadow: rgba(0, 0, 0, 0.1);

    /* Spacing Scale */
    --spacing-xxs: 0.25rem; /* 4px */
    --spacing-xs: 0.5rem;   /* 8px */
    --spacing-sm: 0.75rem;  /* 12px */
    --spacing-md: 1rem;     /* 16px */
    --spacing-lg: 1.5rem;   /* 24px */
    --spacing-xl: 2rem;     /* 32px */
    --spacing-xxl: 3rem;    /* 48px */

    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-full: 9999px;

    /* Font Sizes (example, theme.json will define more) */
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-xxl: 1.5rem;
}

/* Dark Mode Overrides */
.theme-dark {
    --color-primary: #ef4444; /* Red-500 */
    --color-secondary: #f1f5f9; /* Slate-100 */
    --color-accent: #3b82f6; /* Blue-500 */
    --color-background: #0f172a; /* Slate-900 */
    --color-surface: #1e293b; /* Slate-800 */
    --color-text-primary: #f1f5f9; /* Slate-100 */
    --color-text-secondary: #94a3b8; /* Slate-400 */
    --color-border: #334155; /* Slate-700 */
    --color-success: #4ade80; /* Green-400 */
    --color-warning: #fbbf24; /* Amber-400 */
    --color-error: #f87171; /* Red-400 */
    --color-shadow: rgba(0, 0, 0, 0.3);
}

/* --- Base Resets --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    font-family: sans-serif; /* Fallback */
    line-height: 1.5;
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Spacing Scale (Utilities) --- */
.mt-xxs { margin-top: var(--spacing-xxs); }
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mt-xxl { margin-top: var(--spacing-xxl); }

.mb-xxs { margin-bottom: var(--spacing-xxs); }
.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.mb-xxl { margin-bottom: var(--spacing-xxl); }

.py-md { padding-block: var(--spacing-md); }
.px-md { padding-inline: var(--spacing-md); }

/* --- Grid Utilities --- */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* --- Components --- */

/* Cards */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 1px 3px var(--color-shadow);
    padding: var(--spacing-md);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--color-shadow);
}

/* Lists */
.list-unstyled {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-secondary);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--color-primary);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    background-color: var(--color-surface);
    border-color: var(--color-text-secondary);
}

/* Chips (for categories, tags, etc.) */
.chip {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xxs) var(--spacing-xs);
    border-radius: var(--border-radius-full);
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    border: 1px solid var(--color-border);
}

/* Player Container (16:9 aspect ratio) */
.player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background-color: black;
    border-radius: var(--border-radius-md);
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px; /* Fixed height */
    padding-bottom: env(safe-area-inset-bottom); /* For iPhone X notch etc. */
    box-shadow: 0 -2px 10px var(--color-shadow);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: var(--spacing-xs) 0;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: color 0.2s ease-out;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.bottom-nav .mode-toggle-button {
    border-radius: 0; /* Make it consistent with other nav items */
    background: transparent; /* Remove background to blend with nav */
    border: none; /* Remove border */
    padding: var(--spacing-xs) 0; /* Adjust padding to match nav items */
    color: var(--color-text-secondary); /* Inherit color */
    flex-direction: column; /* Align icon and text vertically */
    gap: 2px; /* Small gap between icon and text */
}

.bottom-nav .mode-toggle-button:hover {
    background-color: transparent; /* No background change on hover */
    color: var(--color-primary); /* Change color on hover */
}

.bottom-nav-item.is-active {
    color: var(--color-primary);
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    fill: currentColor; /* Use current text color for SVG */
}

/* Headers/Footers (General) */
.site-header, .site-footer {
    background-color: var(--color-surface);
    padding-block: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.site-footer {
    border-top: 1px solid var(--color-border);
    border-bottom: none;
    margin-top: auto; /* Pushes footer to bottom */
}

/* --- RTL-safe using logical properties --- */
/* Example: margin-inline-start, padding-inline-end */
.text-start { text-align: start; }
.text-end { text-align: end; }

/* --- Classes: .theme-dark, .theme-light and prefers-reduced-motion support --- */
/* .theme-dark is handled by :root overrides */
/* .theme-light is default */

@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0s !important;
        transition-delay: 0s !important;
        animation-duration: 0s !important;
        animation-delay: 0s !important;
    }
}
