/* ==========================================================================
   KORA PRIME - STREAM THEATER & 2D PITCH MATCH CENTER STYLES
   أنماط مسرح البث المباشر، المشغل الاحترافي، الشات الحي، والملعب التكتيكي
   ========================================================================== */

/* نافذة مسرح البث المباشر (Modal Backdrop) */
.stream-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(25px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
}

.stream-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

body.theater-open {
  overflow: hidden;
}

/* مسرح البث الرئيسي */
.stream-theater-box {
  width: 100%;
  max-width: 1350px;
  height: 90vh;
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 28px;
  box-shadow: 0 30px 60px -15px rgba(5, 150, 105, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition-smooth);
}

/* شريط رأس المسرح */
.theater-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-glass);
}

.stream-meta-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stream-match-headline {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stream-match-headline .vs-text {
  color: #059669;
  font-size: 14px;
}

.stream-pill-badge {
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #047857;
}

.theater-ctrl-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theater-tool-btn {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.theater-tool-btn:hover {
  background: #f0fdf4;
  color: #059669;
  border-color: #bbf7d0;
}

.theater-tool-btn.active {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

/* أزرار تبديل السيرفرات الفاتحة */
.server-tab-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.server-tab-pill-btn:hover {
  background: #f0fdf4;
  color: #059669;
  border-color: #bbf7d0;
}

.server-tab-pill-btn.active {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.srv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
}

.server-tab-pill-btn.active .srv-dot {
  background: #ffffff;
}

.srv-type-tag {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

.server-tab-pill-btn.active .srv-type-tag {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.theater-close-btn {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theater-close-btn:hover {
  background: #dc2626;
  color: #fff;
}

/* شبكة البث والشات */
.theater-main-viewport {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  overflow: hidden;
}

/* مساحة مشغل الفيديو */
.stream-video-column {
  display: flex;
  flex-direction: column;
  background: #000;
  overflow-y: auto;
}

.video-screen-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* شريط تحكم البث تحت الفيديو */
.stream-channel-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-glass);
}

.channel-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-tag-bold {
  color: #059669;
  font-weight: 700;
  font-size: 13.5px;
}

.quality-tag-pill {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

/* لوحة السيرفرات والمعلقين */
.stream-options-drawer {
  padding: 20px;
  background: #ffffff;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.option-group-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* شبكة أزرار السيرفرات */
.servers-pills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.server-pill-btn {
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: right;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.server-pill-btn:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.server-pill-btn.active {
  background: #ecfdf5;
  border-color: #059669;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.15);
}

.server-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.server-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #059669;
}

.server-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.server-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* شبكة المعلقين الرياضيين */
.commentators-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.commentator-pill-btn {
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.commentator-pill-btn:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.commentator-pill-btn.active {
  background: #ecfdf5;
  border-color: #059669;
}

.comm-name {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.comm-style {
  font-size: 10px;
  color: var(--text-muted);
}

/* مؤشر تموجات صوت المعلق */
.voice-equalizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.voice-equalizer-bars span {
  width: 3px;
  background: #059669;
  border-radius: 2px;
  animation: eqBounce 0.8s ease-in-out infinite alternate;
}

.voice-equalizer-bars span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.voice-equalizer-bars span:nth-child(2) { height: 90%; animation-delay: 0.3s; }
.voice-equalizer-bars span:nth-child(3) { height: 60%; animation-delay: 0.2s; }
.voice-equalizer-bars span:nth-child(4) { height: 100%; animation-delay: 0.4s; }

@keyframes eqBounce {
  0% { height: 20%; }
  100% { height: 100%; }
}

.quote-bubble {
  background: #f8fafc;
  border-right: 3px solid #059669;
  padding: 8px 14px;
  font-size: 12px;
  color: #334155;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   دردشة الجماهير المباشرة (LIVE FAN CHAT)
   ========================================================================== */
.stream-chat-column {
  background: #ffffff;
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
}

.chat-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-glass);
}

.chat-column-header h4 {
  font-family: var(--font-display);
  font-size: 14px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-online-users {
  font-size: 11px;
  color: #059669;
  font-weight: 600;
}

.chat-messages-scroll {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-system-msg {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 8px;
}

.chat-single-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeInMsg 0.3s ease;
}

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

.chat-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  flex-shrink: 0;
}

.chat-msg-body {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  padding: 8px 12px;
  border-radius: 12px;
  border-top-right-radius: 2px;
}

.my-message .chat-msg-body {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.chat-author {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
}

.author-highlight {
  color: #059669;
}

.chat-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.badge-VIP {
  background: var(--gold-accent);
  color: #000;
}

.badge-عضو {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.badge-محلل {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.chat-time {
  font-size: 9px;
  color: var(--text-muted);
  margin-right: auto;
}

.chat-msg-text {
  font-size: 12.5px;
  color: #1e293b;
  word-break: break-word;
}

/* شريط التفاعل وإرسال الرسائل */
.chat-interactive-tray {
  padding: 12px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--border-glass);
}

.chat-quick-reactions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chat-reaction-btn {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  color: #334155;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.chat-reaction-btn:hover {
  background: #ecfdf5;
  color: #047857;
  transform: scale(1.08);
}

.chat-input-bar {
  display: flex;
  gap: 8px;
}

.chat-text-field {
  flex: 1;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  color: #0f172a;
  outline: none;
}

.chat-text-field:focus {
  border-color: #059669;
}

.chat-submit-btn {
  background: #059669;
  border: none;
  color: #ffffff;
  font-weight: 800;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}

/* وضع السينما (Cinema Mode) */
.cinema-active .stream-chat-column {
  display: none !important;
}
.cinema-active .theater-main-viewport {
  grid-template-columns: 1fr !important;
}

/* ==========================================================================
   نافذة تفاصيل المباراة والملعب التكتيكي (MATCH CENTER MODAL)
   ========================================================================== */
.mc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  padding: 20px;
}

.mc-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mc-modal-box {
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 26px;
  box-shadow: 0 25px 60px -15px rgba(5, 150, 105, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* رأس التفاصيل الفاخر */
.mc-header-card {
  padding: 24px 28px 18px;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-glass);
}

.mc-modal-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mc-match-headline-clash {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.mc-team {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mc-team.away {
  flex-direction: row-reverse;
}

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

.mc-team-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.mc-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mc-score-digits {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  color: #065f46;
  display: flex;
  gap: 8px;
}

.mc-score-digits .colon {
  color: #059669;
}

.mc-status-pill {
  background: #fee2e2;
  color: #e11d48;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}

.mc-league-title {
  font-size: 11px;
  color: var(--text-muted);
}

/* شريط بيانات المباراة */
.mc-meta-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

/* تبويبات التفاصيل */
.mc-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
  background: #f8fafc;
}

.mc-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mc-tab-btn.active {
  color: #059669;
  border-bottom: 2px solid #059669;
  background: #ecfdf5;
}

/* محتوى التبويبات */
.mc-body-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #ffffff;
}

/* الإحصائيات التنافسية */
.stats-comparison-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-compare-row {
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 16px;
}

.stat-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.stat-num.home { color: #059669; }
.stat-num.away { color: #0284c7; }

.stat-dual-bar {
  display: flex;
  height: 6px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  gap: 2px;
}

.bar-fill.home {
  background: #059669;
}

.bar-fill.away {
  background: #0284c7;
}

/* ==========================================================================
   أرضية الملعب التكتيكية (2D TACTICAL PITCH)
   ========================================================================== */
.lineup-formations-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
}

.form-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-dot.home { width: 10px; height: 10px; border-radius: 50%; background: #059669; }
.team-dot.away { width: 10px; height: 10px; border-radius: 50%; background: #0284c7; }

.tactical-pitch-arena {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 1 / 1.4;
  background: #113824;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  background-image: repeating-linear-gradient(
    0deg,
    #0e3320,
    #0e3320 30px,
    #123e27 30px,
    #123e27 60px
  );
}

.pitch-grass {
  position: absolute;
  inset: 0;
}

.pitch-center-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.pitch-center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

.pitch-penalty-home {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 170px;
  height: 70px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-bottom: none;
}

.pitch-penalty-away {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 170px;
  height: 70px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top: none;
}

/* عقد اللاعبين فوق الملعب */
.player-pitch-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.player-pitch-node:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 10;
}

.player-shirt {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.player-shirt.home {
  background: #059669;
  border: 1.5px solid #fff;
  color: #ffffff;
}

.player-shirt.away {
  background: #0284c7;
  border: 1.5px solid #fff;
  color: #ffffff;
}

.player-label {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 3px;
  white-space: nowrap;
}

/* الجدول الزمني للأحداث (Timeline) */
.match-events-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-event-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  padding: 12px 18px;
  border-radius: 14px;
}

.event-minute {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: #059669;
  width: 42px;
}

.event-icon-badge {
  font-size: 20px;
}

.event-player-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.event-sub-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* زر مشاهدة البث أسفل تفاصيل المباراة */
.mc-footer-actions {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
}

.mc-watch-btn-primary {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(5, 150, 105, 0.25);
  transition: var(--transition-smooth);
}

.mc-watch-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 255, 135, 0.5);
}

/* تجاوب المسرح على الشاشات الصغيرة */
@media (max-width: 992px) {
  .theater-main-viewport {
    grid-template-columns: 1fr;
    grid-template-rows: auto 280px;
  }
  .stream-chat-column {
    border-right: none;
    border-top: 1px solid var(--border-glass);
  }
}
