/*
Theme Name: Layali Al-Mondial Theme
Theme URI: https://github.com/qais/layali-theme
Author: Antigravity
Author URI: https://deepmind.google
Description: قالب وردبريس احترافي مميز يعرض مباريات وبث وجدول كأس العالم 2026 مع تصميم زجاجي فاخر متكامل مع إضافة wp Goal.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: layali-theme
Domain Path: /languages
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
  /* Colors */
  --bg-primary:     #060C1A;
  --bg-secondary:   #0C1528;
  --bg-card:        rgba(15, 23, 42, 0.85);
  --bg-card-hover:  rgba(20, 32, 58, 0.95);
  --bg-glass:       rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  --gold:           #F5C518;
  --gold-light:     #FFD740;
  --gold-dark:      #C9A000;
  --green:          #00D4AA;
  --green-dark:     #00A882;
  --red:            #FF4757;
  --blue:           #1E90FF;

  /* Typography Colors */
  --text-primary:   #F0F4FF;
  --text-secondary: #8899BB;
  --text-muted:     #4A5A7A;
  --text-gold:      #F5C518;

  /* Borders & Shadows */
  --border:         rgba(255, 255, 255, 0.06);
  --border-gold:    rgba(245, 197, 24, 0.3);
  --border-glow:    rgba(245, 197, 24, 0.6);
  
  --shadow-sm:      0 2px 10px rgba(0,0,0,0.3);
  --shadow-md:      0 8px 30px rgba(0,0,0,0.4);
  --shadow-lg:      0 20px 60px rgba(0,0,0,0.6);
  --shadow-gold:    0 0 30px rgba(245,197,24,0.25);
  --shadow-green:   0 0 20px rgba(0,212,170,0.2);

  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --radius-xl:    28px;
  --radius-full:  9999px;

  --font-main:    'Cairo', 'Tajawal', sans-serif;
  --transition:   all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* Light Theme Overrides */
.light-theme {
  --bg-primary:     #F3F4F6;
  --bg-secondary:   #FFFFFF;
  --bg-card:        rgba(255, 255, 255, 0.95);
  --bg-card-hover:  rgba(249, 250, 251, 0.98);
  --bg-glass:       rgba(0, 0, 0, 0.03);
  --bg-glass-hover: rgba(0, 0, 0, 0.06);

  --gold:           #B58900;
  --gold-light:     #CFA100;
  --gold-dark:      #8F6C00;
  --green:          #059669;
  --green-dark:     #047857;
  --red:            #DC2626;
  --blue:           #2563EB;

  --text-primary:   #111827;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;
  --text-gold:      #B58900;

  --border:         rgba(0, 0, 0, 0.08);
  --border-gold:    rgba(181, 137, 0, 0.2);
}

/* Global resets & Typography */
body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  transition: var(--transition);
  line-height: 1.6;
}

img, video {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

/* Base layout & WordPress blocks styles */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  flex-grow: 1;
  padding: 2rem 0;
}

/* Header style styling */
.site-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-link.active {
  border: 1px solid var(--border-gold);
  color: var(--gold);
}

.theme-toggle-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--bg-glass-hover);
  border-color: var(--gold);
}

/* Match Dashboard Layout */
.hero-banner {
  background: var(--gradient-hero);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(245, 197, 24, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
}

/* Live Section */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-right: 4px solid var(--gold);
  padding-right: 0.75rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.live-badge-pulse {
  background: var(--red);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.75; box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
  70% { opacity: 1; box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
  100% { opacity: 0.75; box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Match Card */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.match-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-md);
}

.match-card.live-match {
  border-left: 3px solid var(--red);
}

.match-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 35%;
  text-align: center;
}

.team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.team-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.match-center-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30%;
}

.score-display {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.score-vs {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.match-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-top: 0.35rem;
  background: var(--bg-glass);
  color: var(--text-secondary);
}

.status-live, .status-halftime {
  background: rgba(255, 71, 87, 0.15);
  color: var(--red);
}

.status-finished {
  background: rgba(0, 212, 170, 0.15);
  color: var(--green);
}

.status-scheduled {
  background: rgba(30, 144, 255, 0.15);
  color: var(--blue);
}

/* Standings & Stats Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--bg-glass);
  color: var(--gold);
}

/* Standings Table */
.group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.group-header {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
}

.standings-table th, .standings-table td {
  padding: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
}

.standings-table th {
  color: var(--text-secondary);
  font-weight: 700;
}

.standings-table td {
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: right;
}

.team-cell img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.row-qual {
  background: rgba(0, 212, 170, 0.02);
}

.row-third {
  background: rgba(245, 197, 24, 0.01);
}

.pts-cell {
  font-weight: 800;
  color: var(--gold);
}

/* Player Stats Card */
.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.stats-card-header {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 1rem;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stats-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
}

.stats-rank {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-secondary);
  width: 24px;
  text-align: center;
}

.stats-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.stats-info {
  flex-grow: 1;
}

.stats-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.stats-team {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.stats-team img {
  width: 14px;
  height: 14px;
}

.stats-value-box {
  text-align: center;
}

.stats-main-value {
  font-weight: 800;
  color: var(--gold);
  font-size: 1rem;
}

.stats-sub-value {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* Modal Popup Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  padding: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stream-area {
  margin: 1rem 0;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}

.stream-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
}

.timeline-row {
  display: flex;
  align-items: center;
}

.timeline-left, .timeline-right {
  width: 45%;
}

.timeline-left {
  text-align: left;
  padding-left: 1rem;
}

.timeline-right {
  text-align: right;
  padding-right: 1rem;
}

.timeline-time {
  width: 10%;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0;
  z-index: 1;
}

.timeline-detail {
  font-size: 0.8rem;
  color: var(--text-primary);
}

.timeline-detail-player {
  font-weight: 700;
}

.timeline-detail-icon {
  margin: 0 0.25rem;
}

/* Footer styles */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* WordPress post styles compatibility */
.wp-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.wp-post-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.wp-post-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.wp-post-content {
  color: var(--text-secondary);
}

/* Scoreboard Grid Base */
.match-scoreboard-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.scoreboard-team {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.scoreboard-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
}
.scoreboard-team-name {
  font-weight: 800;
  font-size: 1.1rem;
  margin-top: 0.75rem;
  color: var(--text-primary);
}
.scoreboard-score-center {
  text-align: center;
}
.scoreboard-score-value {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--text-primary);
}
.scoreboard-penalties {
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 700;
  margin-top: 0.25rem;
}
.scoreboard-vs {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-secondary);
}
.scoreboard-status-wrapper {
  margin-top: 0.75rem;
}


/* ================================================
   تحسينات التجاوب مع الجوال (Mobile Responsiveness)
   ================================================ */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  /* Navigation Bar adjustment */
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 0.75rem;
  }
  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }
  .nav-link {
    font-size: 0.82rem;
    padding: 0.4rem 0.65rem;
  }

  /* Main container padding */
  main {
    padding: 1rem 0;
  }

  /* Timeline mobile look (single column) */
  .timeline::before {
    left: auto;
    right: 20px;
    transform: none;
  }
  .timeline-row {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 45px;
    padding-left: 0;
    position: relative;
    margin-bottom: 1.25rem;
  }
  .timeline-left, .timeline-right {
    width: 100%;
    text-align: right !important;
    padding: 0 !important;
  }
  .timeline-left > div, .timeline-right > div {
    justify-content: flex-start !important;
    direction: rtl !important;
    text-align: right !important;
  }
  .timeline-time {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 28px;
    line-height: 26px;
    font-size: 0.75rem;
    padding: 0;
  }
}

@media (max-width: 576px) {
  .hero-banner {
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
  }
  .hero-title {
    font-size: 1.4rem;
  }
  .hero-desc {
    font-size: 0.8rem;
  }

  /* Scoreboard inside match cards */
  .match-card {
    padding: 0.8rem;
  }
  .team-logo {
    width: 28px;
    height: 28px;
  }
  .team-name {
    font-size: 0.78rem;
  }
  .score-display {
    font-size: 1.2rem;
  }
  .score-vs {
    font-size: 1rem;
  }

  /* Pitch scaling down on smaller screens */
  .pitch-container {
    transform: scale(0.9);
    transform-origin: top center;
    margin-bottom: -50px;
  }

  /* Scoreboard grid mobile responsiveness */
  .match-scoreboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .scoreboard-team {
    flex-direction: row;
    justify-content: center;
    gap: 0.75rem;
  }
  .scoreboard-logo {
    width: 44px;
    height: 44px;
  }
  .scoreboard-team-name {
    margin-top: 0;
    font-size: 0.95rem;
  }
  .scoreboard-score-value {
    font-size: 1.8rem;
    letter-spacing: 2px;
  }
  .scoreboard-vs {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .pitch-container {
    transform: scale(0.8);
    transform-origin: top center;
    margin-bottom: -100px;
  }
}

@media (max-width: 380px) {
  .pitch-container {
    transform: scale(0.7);
    transform-origin: top center;
    margin-bottom: -150px;
  }
}
