/* ============================================
   كورة لايف - KoraLive
   CSS الرئيسي
   ============================================ */

/* --- CSS Variables --- */
:root {
  --main-color: #1e73be;
  --body-bd: #eceef2;
  --header-bd: #fff;
  --header-color: #222;
  --logo-bd: #1e73be;
  --logo-color: #fff;
  --Wtitle-bg: #1f2024;
  --yrsdaybg: #104783;
  --todaybg: #931800;
  --tomorobg: #caa107;
  --footer-bd: #fff;
  --footer-color: #222;
  --footer-border: #ddd;
  --cop-bd: #eceef2;
  --cop-color: #222;
  --GrayColor: #eceef2;
  --Gray2: #ddd;
  --Gray3: #d8dbe1;
  --LightColor: #fff;
  --DarkColor: #474747;
  --LightColor2: #f6f7fa;
  --BorderColor: #e6e7f1;
  --card-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

/* --- Reset --- */
* {
  margin: 0;
  padding: 0;
  outline: 0;
  list-style: none;
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  line-height: 33px;
  width: 100%;
  margin: 0;
  background: var(--body-bd);
  color: #000;
  font-size: 16px;
}

a {
  color: #222;
  text-decoration: none;
}

a:focus,
a:hover {
  color: var(--main-color);
  transition: .3s ease;
}

.container {
  max-width: 1000px;
  margin: auto;
  padding: 0 12px;
}

.d-flex { display: flex; }
.gap-5 { gap: 5px; }
.gap-20 { gap: 20px; }
.grow-1 { flex-grow: 1; }

.fl-start, .rtl .fl-end { float: left; }
.fl-end, .rtl .fl-start { float: right; }

/* --- Header --- */
.AYaHeader {
  position: relative;
  margin-bottom: 15px;
  overflow: hidden;
  width: 100%;
  background: var(--header-bd);
  box-shadow: var(--card-shadow);
}

.AYaLogo {
  width: 200px;
  margin: 5px 0;
  background: var(--logo-bd);
  border-radius: 8px;
  box-sizing: border-box;
}

.AYaLogo.textlogo { padding: 5px; }

.AYaLogo > a {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.AYaLogo span {
  display: block;
  text-align: center;
  color: var(--logo-color);
  font-size: 30px;
}

.AYaLogo span:last-child { font-size: 19px; }

.AYaMainNav {
  width: calc(100% - 200px);
  float: left;
}

.HeaderSocial {
  float: right;
  margin: 25px 0;
}

.AYaMainNav .nav li {
  float: left;
  position: relative;
}

.rtl .AYaMainNav .nav li { float: right; }

.AYaMainNav .nav .MainMenu a {
  padding: 0 8px;
  height: 83px;
  display: flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  color: var(--header-color);
}

.AYaMainNav .nav .MainMenu a:hover {
  border-bottom: 2px solid var(--main-color);
}

.AYaMainNav .nav .HeaderSocial a,
.ChangStyle,
.install-pill {
  height: 35px;
  width: 35px;
  padding: 0;
  display: grid;
  background: var(--DarkColor);
  margin-left: 5px;
  border-radius: 8px;
  float: right;
  cursor: pointer;
}

.install-pill {
  width: auto;
  min-width: 120px;
  padding: 0 14px;
  place-items: center;
  color: #fff;
  font-size: 14px;
  background: var(--main-color);
  margin-top: 25px;
  border: none;
}

/* --- HeadTitle --- */
.HeadTitle {
  padding: 12px;
  overflow: hidden;
  border-bottom: 1px solid var(--Gray2);
  border-radius: 8px 8px 0 0;
  background: var(--GrayColor);
}

.HeadTitle h1,
.HeadTitle h2,
.HeadTitle h3 {
  font-size: 15px;
  background: var(--DarkColor);
  color: #fff;
  padding: 0 10px;
  float: left;
  border-radius: 8px;
}

.HeadTitle h2.boxstitle { background: var(--main-color); }

.rtl .HeadTitle > * { float: right; }

/* --- Filter Days --- */
.AY-FilterDays { float: right; }
.rtl .AY-FilterDays { float: left; }

.AY-FilterDays li a {
  font-size: 15px;
  color: #fff;
  padding: 0 10px;
  display: block;
  border-radius: 8px;
  background: var(--todaybg);
  cursor: pointer;
}

.AY-FilterDays .yema a { background: var(--yrsdaybg); }
.AY-FilterDays .tomat a { background: var(--tomorobg); }

.AY-FilterDays li a.active {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 3px var(--main-color);
}

/* --- BoxContent --- */
.BoxContent,
.tabsbox {
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
  background: var(--LightColor);
  border-radius: 8px;
}

.albaflex {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 0;
  box-sizing: border-box;
}

/* --- Match Card --- */
.match-container {
  overflow: hidden;
  text-align: center;
  background: var(--GrayColor);
  margin-bottom: 12px;
  position: relative;
  border-radius: 8px;
}

.right-team,
.left-team,
.match-center {
  width: 33.33333333%;
}

.team-logo { width: 50%; }

.team-logo img {
  margin: 10px auto;
  display: flex;
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  border: 1px solid var(--Gray2);
}

.team-fallback {
  width: 70px;
  height: 70px;
  margin: 10px auto;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 50%;
  border: 1px solid var(--Gray2);
  font-size: 24px;
  font-weight: 800;
  color: var(--main-color);
}

.team-name {
  margin: 28px auto;
  display: table;
  line-height: 1.5;
  font-weight: 700;
}

.match-timing { margin: 12px auto; }

.result {
  font-size: 21px;
  letter-spacing: 5px;
  margin-right: -5px;
}

.match-time {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.match-timing .date {
  color: #fff;
  background: #263545;
  border-radius: 8px;
  font-size: 14px;
  padding: 0 10px;
  line-height: 1.9;
  display: table;
  margin: auto;
  margin-top: 6px;
  position: relative;
}

.match-timing .date.live { background: #d00000; }
.match-timing .date.finished { background: var(--DarkColor); }
.match-timing .date.scheduled, .match-timing .date.comming-soon { background: #0f6f37; }

.match-info {
  border-top: 1px solid var(--Gray2);
  display: table;
  overflow: hidden;
  width: 100%;
}

.match-info li {
  width: 33.33333333%;
  float: right;
  font-size: 14px;
  font-weight: 100;
}

.overlay-match {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  height: 100%; width: 100%;
  opacity: 0;
  cursor: pointer;
  background: rgb(0 0 0 / 60%);
  z-index: 9;
  transition: opacity .3s ease;
}

.match-container:hover .overlay-match { opacity: 1; }

.text-match {
  position: absolute;
  bottom: 0; right: 0; height: 45px;
  margin: auto; left: 0; top: 0; width: 45px;
  background: no-repeat center url("data:image/svg+xml;charset=utf8,%3Csvg aria-hidden='true' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23fff' d='M256,0C114.617,0,0,114.615,0,256s114.617,256,256,256s256-114.615,256-256S397.383,0,256,0z M344.48,269.57l-128,80 c-2.59,1.617-5.535,2.43-8.48,2.43c-2.668,0-5.34-.664-7.758-2.008C195.156,347.172,192,341.82,192,336V176 c0-5.82,3.156-11.172,8.242-13.992c5.086-2.836,11.305-2.664,16.238,.422l128,80c4.676,2.93,7.52,8.055,7.52,13.57 S349.156,266.641,344.48,269.57z'%3E%3C/path%3E%3C/svg%3E");
}

.no-data__msg {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #666;
}

/* --- Posts (Latest Matches) --- */
.PostsInner {
  padding: 12px 12px 0;
  overflow: hidden;
}

.AY-PItem { width: 25%; }

.AY-PInner {
  background: var(--GrayColor);
  margin: 0 6px 12px 6px;
  overflow: hidden;
  position: relative;
  border-radius: 8px;
}

.AY-PostImg {
  height: 160px;
  background: linear-gradient(135deg, #0e4f88, #1e73be);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
}

.AY-PostImg img {
  object-fit: contain;
  width: 70px;
  height: 70px;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.3);
}

.post-badge {
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.post-info { padding: 10px; }

.post-info h3 {
  margin: 0;
  line-height: 1.5;
  font-size: 15px;
  min-height: 43px;
  overflow: hidden;
  font-weight: 500;
}

.wdthbox {
  padding: 12px;
  text-align: justify;
  overflow: hidden;
  position: relative;
  font-weight: 400;
}

/* --- Footer --- */
footer {
  position: relative;
  background: var(--footer-bd);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-top: 15px;
}

.footermb {
  background: var(--cop-bd);
  overflow: hidden;
  padding: 12px 0;
  color: var(--cop-color);
}

.footermb .weba { float: left; }
.footermb li { float: right; }

.footermb a {
  margin-right: 10px;
  font-size: 13px;
  padding: 0 7px;
  display: block;
  border-radius: 8px;
  color: var(--cop-color);
}

/* --- PWA Banner --- */
.pwa-banner {
  position: fixed;
  left: 20px;
  bottom: 20px;
  background: linear-gradient(135deg, #28a745, #1e7e34);
  color: #fff;
  padding: 15px 20px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 420px;
}

.pwa-banner.show { display: flex; }

.pwa-banner button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  border: 0;
  background: #fff;
  color: #1e7e34;
  cursor: pointer;
  white-space: nowrap;
}

/* ============================================
   Match Page Styles
   ============================================ */

.coMatch {
  position: relative;
  margin-bottom: 15px;
  border-radius: 8px;
  padding: 12px;
  background: var(--LightColor);
  box-shadow: var(--card-shadow);
}

.backMatch {
  overflow: hidden;
  position: relative;
  display: block;
  border-radius: 8px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 28%),
    linear-gradient(135deg, #124f85, #1e73be);
  background-size: 100% 100%;
}

.baMatch {
  overflow: hidden;
  display: block;
  background: rgb(0 0 0 / 59%);
}

.colmd {
  width: 40%;
  text-align: center;
  padding: 45px 0 35px 0;
  color: #fff;
  float: right;
}

.colmd.ce { width: 20%; }

.teamlogo {
  max-width: 100px;
  height: 100px;
  background-size: contain;
  margin: 15px auto;
  background-repeat: no-repeat;
  background-position: center;
}

.matchvs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  z-index: 9;
  right: 0; bottom: 0; left: 0; top: 0;
  font-size: 80px;
  font-weight: bold;
  margin-top: 25px;
  color: #fff;
}

#the-post {
  overflow: hidden;
  border-radius: 8px;
  background: var(--LightColor);
  box-shadow: var(--card-shadow);
}

.EntryHeader {
  background: var(--GrayColor);
  margin-bottom: 12px;
  border-radius: 8px 8px 0 0;
}

.EntryTitle {
  padding: 10px 12px;
  line-height: 1.5;
  overflow: hidden;
  font-size: 24px;
}

.entry-content {
  padding: 15px 20px;
  clear: both;
}

.entry p { margin-bottom: 15px; }

.entry h2 {
  display: table;
  padding: 5px 15px;
  background-color: var(--GrayColor);
  font-size: 18px;
  font-weight: 600;
  margin: 15px 0;
  line-height: 1.5;
  text-align: right;
  border-radius: 8px;
}

.entry iframe {
  max-width: 100%;
  display: table;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--GrayColor);
}

.AlbaEmbed {
  position: relative;
  display: block;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.AlbaEmbed .AlbaEmbed-item,
.AlbaEmbed iframe,
.AlbaEmbed embed,
.AlbaEmbed object,
.AlbaEmbed video {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

.AlbaServersEmbed { padding-bottom: 500px; }

.table-bordered {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--GrayColor);
  border-radius: 8px;
}

.table-bordered tr { border-bottom: 1px solid var(--Gray3); }
.table-bordered tr:last-child { border: 0; }

.table-bordered td,
.table-bordered th {
  font-weight: 500;
  padding: 12px;
  line-height: 25px;
}

.table-bordered td { border-right: 1px solid var(--Gray3); }

.post-footer {
  padding: 0 12px 12px;
  overflow: hidden;
}

.post-share {
  overflow: hidden;
  border-radius: 8px;
  padding: 12px;
  background: var(--GrayColor);
  margin-top: 15px;
}

.share-links {
  text-align: center;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.share-links a {
  font-size: 15px;
  background: var(--main-color);
  padding: 5px 10px;
  height: 30px;
  display: block;
  color: #fff;
  border-radius: 4px;
}

.share-links .facebook { background: #3b5998; }
.share-links .twitter { background: #55acee; }
.share-links .whatsapp { background: #5eaf2e; }
.share-links .telegram { background: #3ca2d9; }

/* Video server */
.video-serv {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.video-serv a {
  padding: 8px 16px;
  background: var(--main-color);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background .3s;
}

.video-serv a:hover {
  background: #155a96;
  color: #fff;
}

.server-body {
  margin-bottom: 12px;
}

.server-body video,
.server-body iframe {
  border-radius: 8px;
  background: #111827;
}

/* ============================================
   Admin Panel Styles
   ============================================ */

.admin-wrap {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 16px;
}

.admin-topbar {
  background: #fff;
  border: 1px solid #e3e7ee;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 22px;
}

.admin-topbar .subtitle {
  color: #6b7280;
}

.admin-topbar .back-link {
  margin-right: auto;
  margin-left: 0;
  font-size: 14px;
  color: var(--main-color);
}

.admin-card {
  background: #fff;
  border: 1px solid #e3e7ee;
  border-radius: 12px;
  padding: 16px 20px 20px;
  margin-bottom: 16px;
}

.admin-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.admin-alert {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #8a1f11;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.admin-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label {
  font-size: 14px;
  color: #6b7280;
  display: grid;
  gap: 6px;
}

.form-grid input,
.form-grid select {
  border: 1px solid #e3e7ee;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e3e7ee;
  background: #fff;
  color: #1d232b;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.btn.primary {
  background: var(--main-color);
  border-color: var(--main-color);
  color: #fff;
}

.btn.danger {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.btn.success {
  background: #28a745;
  border-color: #28a745;
  color: #fff;
}

.btn.small { padding: 6px 10px; font-size: 12px; }

.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid #e3e7ee;
  text-align: right;
}

.admin-table th { background: #f8fafc; }

.admin-actions { display: flex; gap: 6px; }

.db-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ============================================
   Responsive
   ============================================ */

@media screen and (min-width: 1000px) {
  .d-lg-flex { display: flex; }
}

@media screen and (max-width: 1000px) {
  .AYaLogo {
    margin: 8px auto;
    display: table;
    float: none;
    width: initial;
  }
  .AYaMainNav {
    width: 100%;
    float: none;
  }
  .HeaderSocial {
    float: none;
    display: flex;
    justify-content: center;
  }
  .install-pill {
    margin: 8px auto 14px;
    float: none;
  }
  .AY-PItem { width: 50%; }
}

@media screen and (max-width: 500px) {
  .AYaHeader .container { padding: 0 12px; }

  .HeadTitle h2.boxstitle {
    display: block;
    width: 95%;
    text-align: center;
    margin-bottom: 6px;
  }

  .AY-FilterDays {
    float: none;
    width: 100%;
    gap: 0;
  }

  .AY-FilterDays li {
    margin: 0;
    flex: 1;
  }

  .AY-FilterDays li a {
    text-align: center;
    padding: 0;
  }

  .team-logo img,
  .team-fallback {
    width: 50px;
    height: 50px;
    margin: 7px auto 0;
  }

  .team-name { margin: 7px auto 0; }
  .match-timing { margin: 13px auto; }
  .team-logo { width: 100%; }

  .match-info li:nth-child(2) { display: none; }
  .match-info li { width: 50%; }

  .AY-PItem { width: 100%; }
  .AY-PostImg { height: 120px; }

  .pwa-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }

  .form-grid { grid-template-columns: 1fr; }
}
