/* ============================================================
   DEJ Core - Global CSS for All Frontend Pages
   فونت، رنگ‌های برند و استایل پایه برای کل سایت
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/dana-font@v5.0.1/dana.css');
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/peyda-font@v1.0.0/peyda.css');

:root {
  --dej-blue: #0E2EB0;
  --dej-blue-dark: #0a258f;
  --dej-blue-light: #1d44d4;
  --dej-gold: #C1A61A;
  --dej-gold-light: #d4bb28;
  --dej-white: #F9F8F8;
  --dej-ink: #0f172a;
  --dej-muted: #64748b;
  --dej-bg: #05070d;
  --dej-line: rgba(14, 46, 176, .12);
  --dej-radius: 18px;
  --dej-shadow: 0 12px 32px rgba(15, 23, 42, .08);
  --dej-shadow-lg: 0 24px 64px rgba(14, 46, 176, .12);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  height: -webkit-fill-available;
}

/* Force Persian font on all DEJ pages */
body {
  font-family: Dana, Peyda, Vazirmatn, Tahoma, Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  direction: rtl;
  text-align: right;
}

/* Persian numbers everywhere */
.dej-fa-num {
  font-variant-numeric: tabular-nums;
}

/* Selection color */
::selection {
  background: var(--dej-gold);
  color: #000;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(14, 46, 176, .05);
}
::-webkit-scrollbar-thumb {
  background: var(--dej-blue);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--dej-gold);
}

/* ============================================================
   DEJ Site Header (For all DEJ pages)
   ============================================================ */
.dej-site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(5, 7, 13, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(14, 46, 176, 0.25);
  padding: 0 clamp(16px, 4vw, 40px);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: Dana, Vazirmatn, sans-serif;
  direction: rtl;
}

.dej-site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  color: var(--dej-white) !important;
}

.dej-site-header__brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--dej-gold);
  object-fit: cover;
}

.dej-site-header__brand strong {
  font-size: 16px;
  font-weight: 900;
  color: var(--dej-white);
  background: linear-gradient(90deg, var(--dej-white), var(--dej-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dej-site-header__brand small {
  display: block;
  font-size: 10px;
  color: rgba(249, 248, 248, 0.55);
  font-weight: 700;
  margin-top: 2px;
}

.dej-site-header__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dej-site-header__nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  color: rgba(249, 248, 248, 0.85) !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 800;
  transition: .2s;
  white-space: nowrap;
  transform-style: preserve-3d;
  perspective: 800px;
}

.dej-site-header__nav a:hover,
.dej-site-header__nav a.current {
  background: var(--dej-blue);
  color: var(--dej-white) !important;
  transform: translateY(-2px) rotateX(8deg);
  box-shadow: 0 10px 24px rgba(14, 46, 176, .28), 0 0 18px rgba(193, 166, 26, .18);
}

.dej-site-header__nav a.cta {
  background: var(--dej-gold);
  color: #000 !important;
}

.dej-site-header__nav a.cta:hover {
  background: var(--dej-gold-light);
  transform: translateY(-2px) rotateX(8deg) scale(1.02);
  box-shadow: 0 12px 26px rgba(193, 166, 26, .32);
}

.dej-site-header__live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #ef4444 !important;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none !important;
}

.dej-site-header__live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
  animation: dejLivePulse 1.5s ease-in-out infinite;
}

@keyframes dejLivePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.dej-site-header__toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(249, 248, 248, 0.2);
  color: var(--dej-white);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

/* Mobile responsive header */
@media (max-width: 900px) {
  .dej-site-header__nav {
    position: fixed;
    top: 64px;
    right: 0;
    height: calc(100vh - 64px);
    width: 260px;
    background: rgba(5, 7, 13, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 8px;
    border-right: 1px solid rgba(14, 46, 176, 0.25);
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
  }

  .dej-site-header__nav.open {
    transform: translateX(0);
  }

  .dej-site-header__nav a {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 14px;
  }

  .dej-site-header__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dej-site-header__brand small {
    display: none;
  }
}

/* ============================================================
   DEJ Site Footer (For all DEJ pages)
   ============================================================ */
.dej-site-footer {
  background: linear-gradient(180deg, transparent, #05070d 50%);
  padding: 40px clamp(16px, 4vw, 40px) 30px;
  margin-top: 60px;
  color: rgba(249, 248, 248, 0.7);
  font-family: Dana, Vazirmatn, sans-serif;
  direction: rtl;
}

.dej-site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.dej-site-footer__top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(193, 166, 26, 0.15);
}

.dej-site-footer__col h4 {
  color: var(--dej-gold);
  font-size: 13px;
  font-weight: 900;
  margin: 0 0 12px;
  letter-spacing: .5px;
}

.dej-site-footer__col a {
  display: block;
  color: rgba(249, 248, 248, 0.65) !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0;
  transition: .2s;
}

.dej-site-footer__col a:hover {
  color: var(--dej-gold) !important;
  transform: translateX(-3px);
}

.dej-site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(249, 248, 248, 0.06);
  font-size: 11px;
  color: rgba(249, 248, 248, 0.4);
}

.dej-site-footer__bottom a {
  color: var(--dej-gold) !important;
  text-decoration: none !important;
}

/* ============================================================
   DEJ Page Container (Wrapper for shortcode pages)
   ============================================================ */
.dej-page-wrap {
  min-height: calc(100vh - 64px);
  background: linear-gradient(180deg, #05070d 0%, #0a1128 30%, #05070d 100%);
  font-family: Dana, Vazirmatn, sans-serif;
  direction: rtl;
}

/* When using Elementor Canvas template */
body.elementor-template-canvas {
  background: #05070d !important;
  margin: 0;
  padding: 0;
}

body.elementor-template-canvas .dej-page-wrap {
  min-height: 100vh;
}

/* ============================================================
   Utility classes
   ============================================================ */
.dej-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--dej-blue);
  color: var(--dej-white) !important;
  text-decoration: none !important;
  font-weight: 900;
  font-size: 13px;
  transition: .2s;
  border: 0;
  cursor: pointer;
}

.dej-btn-primary:hover {
  background: var(--dej-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 46, 176, 0.35);
}

.dej-btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--dej-gold);
  color: #000 !important;
  text-decoration: none !important;
  font-weight: 900;
  font-size: 13px;
  transition: .2s;
  border: 0;
  cursor: pointer;
}

.dej-btn-gold:hover {
  background: var(--dej-gold-light);
  transform: translateY(-2px);
}

.dej-card {
  background: #fff;
  border-radius: var(--dej-radius);
  padding: 20px;
  box-shadow: var(--dej-shadow);
  border: 1px solid var(--dej-line);
}

@supports (-webkit-touch-callout: none) {
  .dej-site-header,
  .dej-site-footer,
  .dej-card,
  .dej-page-wrap {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .dej-site-header {
    background: rgba(5, 7, 13, 0.96);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
  }

  body.elementor-template-canvas {
    min-height: -webkit-fill-available;
  }
}
