/*
Theme Name: Chibani Media
Theme URI: https://chibanimedia.com
Author: Chibani Media
Author URI: https://chibanimedia.com
Description: قالب احترافي متكامل لـ Chibani Media — IPTV، أدوات رقمية، تصميم مواقع وهويات بصرية
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: Private
Text Domain: chibani-media
Tags: rtl-language, custom-colors, custom-logo, full-width-template, e-commerce
*/

/* =============================================
   CSS VARIABLES & ROOT
   ============================================= */
:root {
  --cm-red:          #E63946;
  --cm-red-dark:     #b52d38;
  --cm-red-glow:     rgba(230, 57, 70, 0.35);
  --cm-blue-dark:    #0d1b2a;
  --cm-blue-mid:     #1b2d42;
  --cm-blue-accent:  #1a3a5c;
  --cm-blue-light:   #2a5298;
  --cm-aurora:       #00f5a0;
  --cm-aurora-dark:  #00c97e;
  --cm-aurora-glow:  rgba(0, 245, 160, 0.25);
  --cm-text:         #e8f4f8;
  --cm-text-sub:     #8fafc8;
  --cm-card:         rgba(27, 45, 66, 0.85);
  --cm-border:       rgba(0, 245, 160, 0.15);
  --cm-font-ar:      'Tajawal', sans-serif;
  --cm-font-en:      'Orbitron', sans-serif;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--cm-font-ar);
  background: var(--cm-blue-dark);
  color: var(--cm-text);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0,245,160,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 90%, rgba(230,57,70,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 100% 50% at 50% 50%, rgba(26,58,92,0.35) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }

/* =============================================
   LAYOUT WRAPPER
   ============================================= */
.cm-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cm-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   HEADER
   ============================================= */
.cm-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 70px;
  background: rgba(13, 27, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

/* Logo */
.cm-logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.cm-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.cm-logo-text-fallback {
  font-family: var(--cm-font-en);
  font-size: 1rem;
  font-weight: 900;
  color: var(--cm-text);
  letter-spacing: 2px;
}
.cm-logo-text-fallback span { color: var(--cm-aurora); }

/* Hamburger */
.cm-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--cm-border);
  border-radius: 10px;
  background: transparent;
  transition: border-color 0.2s;
}
.cm-hamburger:hover { border-color: var(--cm-aurora); }
.cm-hamburger span {
  width: 22px;
  height: 2px;
  background: var(--cm-text);
  border-radius: 2px;
  display: block;
  transition: background 0.2s;
}
.cm-hamburger:hover span { background: var(--cm-aurora); }

/* =============================================
   SIDE NAVIGATION
   ============================================= */
.cm-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.cm-nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cm-side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 290px;
  height: 100vh;
  background: rgba(11, 22, 35, 0.98);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--cm-border);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
}

.cm-side-nav.open {
  transform: translateX(0);
}

.cm-nav-head {
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--cm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cm-nav-brand {
  font-family: var(--cm-font-en);
  font-size: 1rem;
  font-weight: 900;
  color: var(--cm-aurora);
  letter-spacing: 2px;
}

.cm-nav-close {
  background: transparent;
  border: 1px solid var(--cm-border);
  border-radius: 8px;
  color: var(--cm-text-sub);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.cm-nav-close:hover { border-color: var(--cm-red); color: var(--cm-red); }

.cm-nav-list {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.cm-nav-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 12px;
  color: var(--cm-text-sub);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.cm-nav-item a:hover,
.cm-nav-item a.active {
  background: var(--cm-card);
  color: var(--cm-aurora);
  border-color: var(--cm-border);
}

.cm-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--cm-blue-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* =============================================
   HERO — HOME
   ============================================= */
.cm-hero {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 48px;
  text-align: center;
}

.cm-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 245, 160, 0.35);
  background: rgba(0, 245, 160, 0.07);
  border-radius: 50px;
  padding: 6px 20px;
  font-family: var(--cm-font-en);
  font-size: 0.72rem;
  color: var(--cm-aurora);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.cm-hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--cm-aurora);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cm-aurora);
  animation: cm-pulse 2s infinite;
}
@keyframes cm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.6); }
}

.cm-hero-title {
  font-family: var(--cm-font-en);
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.cm-hero-title .t-red    { color: var(--cm-red);    text-shadow: 0 0 50px var(--cm-red-glow); }
.cm-hero-title .t-aurora { color: var(--cm-aurora); text-shadow: 0 0 50px var(--cm-aurora-glow); }

.cm-hero-sub {
  color: var(--cm-text-sub);
  font-size: 1rem;
  max-width: 500px;
  line-height: 1.8;
  margin-bottom: 64px;
}

/* =============================================
   SERVICE CARDS — HOME
   ============================================= */
.cm-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  max-width: 920px;
  width: 100%;
}

.cm-service-card {
  background: var(--cm-card);
  border: 1px solid var(--cm-border);
  border-radius: 18px;
  padding: 32px 22px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.cm-service-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--cm-aurora)), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.cm-service-card:hover::after { opacity: 1; }

.cm-service-card:hover {
  transform: translateY(-7px);
  border-color: var(--accent, var(--cm-aurora));
  box-shadow: 0 20px 50px rgba(0,0,0,0.35), 0 0 30px var(--accent-glow, var(--cm-aurora-glow));
}

.cm-service-card[data-accent="red"]  { --accent: var(--cm-red);        --accent-glow: var(--cm-red-glow); }
.cm-service-card[data-accent="blue"] { --accent: var(--cm-blue-light);  --accent-glow: rgba(42,82,152,0.4); }
.cm-service-card[data-accent="gold"] { --accent: #f4a261;               --accent-glow: rgba(244,162,97,0.3); }

.cm-card-icon {
  font-size: 2.6rem;
  margin-bottom: 16px;
  display: block;
}
.cm-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--cm-text);
}
.cm-card-desc {
  font-size: 0.82rem;
  color: var(--cm-text-sub);
  line-height: 1.65;
}

/* =============================================
   PAGE HEADER (inner pages)
   ============================================= */
.cm-page-header {
  padding: 56px 24px 36px;
  text-align: center;
}

/* Page brand logo block */
.cm-page-logo-block {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--cm-card);
  border: 1px solid var(--cm-border);
  border-radius: 16px;
  padding: 14px 28px;
  margin-bottom: 36px;
}
.cm-page-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
}
.cm-page-logo-text {
  font-family: var(--cm-font-en);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--cm-text);
  letter-spacing: 2px;
}
.cm-page-logo-text span { color: var(--cm-red); }

.cm-section-title h2 {
  font-family: var(--cm-font-en);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 900;
  margin-bottom: 10px;
}
.cm-section-title h2 .hl { color: var(--cm-aurora); }
.cm-section-title p {
  color: var(--cm-text-sub);
  font-size: 0.92rem;
}

/* =============================================
   IPTV PLANS
   ============================================= */
.cm-plans-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 70px;
}

.cm-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 20px;
}

.cm-plan-card {
  background: var(--cm-card);
  border: 1px solid var(--cm-border);
  border-radius: 20px;
  padding: 30px 20px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.cm-plan-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.3);
}
.cm-plan-card.featured {
  border-color: var(--cm-aurora);
  box-shadow: 0 0 40px var(--cm-aurora-glow);
}
.cm-plan-card.featured .cm-plan-badge {
  display: inline-block;
}

.cm-plan-badge {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--cm-aurora);
  color: var(--cm-blue-dark);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 50px;
}

.cm-plan-duration {
  font-family: var(--cm-font-en);
  font-size: 0.7rem;
  color: var(--cm-text-sub);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cm-plan-icon { font-size: 2.2rem; margin-bottom: 10px; }
.cm-plan-name { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }

.cm-plan-price {
  font-family: var(--cm-font-en);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--cm-aurora);
  line-height: 1;
  margin-bottom: 4px;
}
.cm-plan-price .currency {
  font-size: 0.85rem;
  color: var(--cm-text-sub);
  font-weight: 400;
}

.cm-plan-features {
  margin: 18px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cm-plan-features li {
  font-size: 0.8rem;
  color: var(--cm-text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.cm-plan-features li::before {
  content: '✓';
  color: var(--cm-aurora);
  font-weight: 700;
  font-size: 0.75rem;
}

/* =============================================
   WHATSAPP BUTTON
   ============================================= */
.cm-btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  border-radius: 11px;
  padding: 13px 20px;
  color: #fff;
  font-family: var(--cm-font-ar);
  font-weight: 700;
  font-size: 0.9rem;
  width: 100%;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s;
  box-shadow: 0 5px 18px rgba(37, 211, 102, 0.3);
}
.cm-btn-wa:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.42);
  color: #fff;
}
.cm-btn-wa svg {
  width: 18px;
  height: 18px;
  fill: #fff;
  flex-shrink: 0;
}

.cm-btn-wa-lg {
  padding: 16px 28px;
  font-size: 1rem;
  border-radius: 13px;
}

/* =============================================
   TOOLS GRID
   ============================================= */
.cm-tools-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 70px;
}

.cm-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.cm-tool-card {
  background: var(--cm-card);
  border: 1px solid var(--cm-border);
  border-radius: 15px;
  padding: 22px 14px 18px;
  text-align: center;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.cm-tool-card:hover {
  transform: translateY(-5px);
  border-color: var(--cm-blue-light);
  box-shadow: 0 14px 35px rgba(42,82,152,0.3);
}

.cm-tool-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  margin: 0 auto 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  background: var(--cm-blue-dark);
  border: 1px solid var(--cm-border);
  overflow: hidden;
}
.cm-tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.cm-tool-name  { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; }
.cm-tool-desc  { font-size: 0.74rem; color: var(--cm-text-sub); margin-bottom: 10px; line-height: 1.5; }
.cm-tool-price { font-family: var(--cm-font-en); font-size: 1rem; font-weight: 700; color: var(--cm-aurora); }
.cm-tool-unit  { font-size: 0.7rem; color: var(--cm-text-sub); margin-bottom: 10px; }

.cm-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  font-size: 0.78rem;
  font-family: var(--cm-font-ar);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.cm-btn-sm:hover { transform: translateY(-2px); color: #fff; }
.cm-btn-sm svg { width: 13px; height: 13px; fill: #fff; }

/* =============================================
   FORMS (Web & Logo pages)
   ============================================= */
.cm-form-wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 24px 70px;
}

.cm-form-card {
  background: var(--cm-card);
  border: 1px solid var(--cm-border);
  border-radius: 22px;
  padding: 40px 36px;
}

.cm-form-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cm-aurora);
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--cm-border);
}

.cm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.cm-form-group label {
  font-size: 0.84rem;
  color: var(--cm-text-sub);
  font-weight: 600;
}

.cm-form-group input,
.cm-form-group textarea,
.cm-form-group select {
  background: var(--cm-blue-dark);
  border: 1px solid var(--cm-border);
  border-radius: 11px;
  padding: 13px 16px;
  color: var(--cm-text);
  font-family: var(--cm-font-ar);
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  direction: rtl;
}
.cm-form-group input:focus,
.cm-form-group textarea:focus,
.cm-form-group select:focus {
  outline: none;
  border-color: var(--cm-aurora);
  box-shadow: 0 0 0 3px rgba(0,245,160,0.1);
}
.cm-form-group textarea { resize: vertical; min-height: 110px; }
.cm-form-group select { cursor: pointer; }
.cm-form-group select option { background: var(--cm-blue-mid); }

.cm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* =============================================
   FOOTER
   ============================================= */
.cm-footer {
  background: rgba(8, 17, 28, 0.97);
  border-top: 1px solid var(--cm-border);
  padding: 50px 28px 28px;
  margin-top: auto;
}

.cm-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--cm-border);
}

.cm-footer-col h4 {
  color: var(--cm-aurora);
  font-family: var(--cm-font-en);
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.cm-footer-col p,
.cm-footer-col a {
  color: var(--cm-text-sub);
  font-size: 0.85rem;
  line-height: 2;
  display: block;
  transition: color 0.2s;
}
.cm-footer-col a:hover { color: var(--cm-aurora); }

/* Social icons */
.cm-social-links {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.cm-social-link {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--cm-border);
  background: var(--cm-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s;
  text-decoration: none;
}
.cm-social-link:hover {
  transform: translateY(-3px);
  border-color: var(--cm-aurora);
  box-shadow: 0 6px 20px rgba(0,245,160,0.2);
}
.cm-social-link svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Facebook */
.cm-social-link.fb svg { fill: #1877F2; }
/* X (Twitter) */
.cm-social-link.x svg  { fill: #ffffff; }
/* Instagram */
.cm-social-link.ig svg { fill: url(#ig-gradient); }

.cm-footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.cm-footer-copy {
  color: var(--cm-text-sub);
  font-size: 0.8rem;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes cm-fadein {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.cm-fadein {
  animation: cm-fadein 0.45s ease both;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--cm-blue-dark); }
::-webkit-scrollbar-thumb { background: var(--cm-blue-accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cm-aurora-dark); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .cm-footer-inner    { grid-template-columns: 1fr; gap: 28px; }
  .cm-form-card       { padding: 26px 18px; }
  .cm-form-grid       { grid-template-columns: 1fr; }
  .cm-footer-bottom   { justify-content: center; text-align: center; }
  .cm-page-logo-block { flex-direction: column; gap: 10px; }
}

@media (max-width: 480px) {
  .cm-hero-sub { font-size: 0.9rem; }
}
/* ── Page Logo Fix ── */
.cm-page-logo-block {
  padding: 20px 36px;
  min-height: 100px;
  justify-content: center;
}

.cm-page-logo-img {
  height: 80px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

.cm-page-logo-text {
  font-size: 1.8rem;
}