/* CodeLab Academy — custom styles on top of Tailwind */

html { scroll-behavior: smooth; }

body { font-family: "Vazirmatn", "Inter", sans-serif; }
html[dir="ltr"] body { font-family: "Inter", "Vazirmatn", sans-serif; }

/* Gradient hero backdrop */
.hero-glow {
  background:
    radial-gradient(60% 60% at 20% 10%, rgba(99,102,241,0.18), transparent 60%),
    radial-gradient(50% 50% at 90% 20%, rgba(14,165,233,0.16), transparent 60%),
    radial-gradient(60% 60% at 60% 100%, rgba(168,85,247,0.14), transparent 60%);
}
.dark .hero-glow {
  background:
    radial-gradient(60% 60% at 20% 10%, rgba(99,102,241,0.28), transparent 60%),
    radial-gradient(50% 50% at 90% 20%, rgba(14,165,233,0.22), transparent 60%),
    radial-gradient(60% 60% at 60% 100%, rgba(168,85,247,0.20), transparent 60%);
}

/* Fade / slide-in animation for view transitions */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeUp 0.45s ease both; }

@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}
.animate-floaty { animation: floaty 5s ease-in-out infinite; }

/* Code window mock */
.code-dot { width: 12px; height: 12px; border-radius: 9999px; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.35); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.55); }

/* Card hover lift */
.lift { transition: transform .25s ease, box-shadow .25s ease; }
.lift:hover { transform: translateY(-6px); box-shadow: 0 20px 40px -20px rgba(79,70,229,0.35); }

/* Nav link underline */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; bottom: -4px; inset-inline-start: 0;
  width: 0; height: 2px; background: currentColor; transition: width .25s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Hide scrollbar for tab strips */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== macOS-style magnifying nav dock ===== */
.nav-dock {
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  border-radius: 1rem;
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(8px);
}
.dark .nav-dock {
  background: rgba(23, 23, 23, 0.6);
  border-color: rgba(148, 163, 184, 0.12);
}

.dock-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.dock-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  color: rgb(71, 85, 105);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: width 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              height 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              color 0.2s ease, background 0.2s ease;
}
.dark .dock-icon {
  color: rgb(203, 213, 225);
  background: rgba(38, 38, 38, 0.85);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.dock-icon svg { width: 55%; height: 55%; }

.dock-item:hover .dock-icon,
.dock-item.active .dock-icon {
  color: rgb(79, 70, 229);
  background: rgba(224, 231, 255, 0.95);
}
.dark .dock-item:hover .dock-icon,
.dark .dock-item.active .dock-icon {
  color: rgb(165, 180, 252);
  background: rgba(49, 46, 129, 0.55);
}

/* Tooltip label above the icon (shown on hover) */
.dock-label {
  position: absolute;
  top: -1.6rem;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: pre;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgb(51, 65, 85);
  background: rgba(241, 245, 249, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.dark .dock-label {
  color: #fff;
  background: rgba(38, 38, 38, 0.98);
  border-color: rgba(64, 64, 64, 0.9);
}
.dock-item:hover .dock-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Tehran Clock ── */
@keyframes digitFlip {
  0%   { opacity: 0; transform: translateY(-6px) scaleY(0.6); }
  60%  { opacity: 1; transform: translateY(1px)  scaleY(1.05); }
  100% { opacity: 1; transform: translateY(0)    scaleY(1); }
}

#tehran-time span {
  transition: color 0.2s ease;
}

#tehran-clock-wrap {
  transition: box-shadow 0.3s ease;
}
#tehran-clock-wrap:hover {
  box-shadow: 0 0 0 2px rgba(99,102,241,0.35);
}

#clock-hour, #clock-min, #clock-sec {
  transform-origin: 16px 16px;
}

/* Floating support button */
.floating-support {
  position: fixed;
  left: 28px;
  right: auto;
  bottom: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,#5b21ff,#2563eb);
  color: white;
  font-size: 32px;
  text-decoration: none;
  box-shadow: 0 0 30px rgba(99,102,241,.7);
  z-index: 99999;
  transition: .3s;
  border: 2px solid rgba(255,255,255,.25);
}
.floating-support:hover {
  transform: scale(1.1);
}
.support-dot {
  position:absolute;
  top:-4px;
  right:-4px;
  background:#ef4444;
  color:white;
  font-size:12px;
  width:22px;
  height:22px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
}


.support-chat{position:fixed;right:28px;bottom:110px;width:340px;height:430px;background:#0f172a;border:1px solid #334155;border-radius:22px;display:none;flex-direction:column;overflow:hidden;z-index:99998;box-shadow:0 20px 50px #0008;color:#fff}.support-chat.active{display:flex}.support-head{padding:15px;background:linear-gradient(135deg,#5b21ff,#2563eb);font-weight:700;display:flex;justify-content:space-between}.support-head button{background:none;border:0;color:#fff;font-size:24px;cursor:pointer}.support-messages{flex:1;padding:15px;overflow:auto}.support-msg{padding:10px;border-radius:14px;margin-bottom:10px;max-width:80%;background:#1e293b}.support-msg.user{margin-right:auto;background:#2563eb}.support-form{display:flex;padding:10px;gap:8px}.support-form input{flex:1;border-radius:12px;border:0;padding:10px}.support-form button{border:0;border-radius:12px;padding:0 15px;background:#5b21ff;color:#fff}

.support-title{display:flex;align-items:center;gap:8px}
.support-logo{width:32px;height:32px;border-radius:50%;object-fit:cover}


/* Support floating button logo */
.floating-support {
  width: 52px !important;
  height: 52px !important;
  overflow: hidden;
  padding: 0;
}
.support-btn-logo {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
}

/* Full logo support button */
.floating-support {
    width: 52px !important;
    height: 52px !important;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 50%;
}

.support-btn-logo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50%;
    display: block;
}

.payment-card-info{
  margin:20px auto;
  padding:18px;
  border-radius:16px;
  text-align:center;
  background:rgba(99,102,241,.08);
}
.card-number{
  font-size:22px;
  font-weight:800;
  letter-spacing:2px;
}

/* ══════════════════════════════════════════════════
   Bank Card — 3D Flip Animation
══════════════════════════════════════════════════ */
.bank-card-container {
  width: 380px;
  max-width: 100%;
  height: 240px;
}

.bank-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  cursor: pointer;
  animation: cardFloat 4s ease-in-out infinite;
}

.bank-card:hover {
  transform: rotateY(180deg);
  animation-play-state: paused;
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotateX(2deg) rotateY(-4deg); }
  25%       { transform: translateY(-8px) rotateX(-2deg) rotateY(4deg); }
  50%       { transform: translateY(-4px) rotateX(3deg) rotateY(2deg); }
  75%       { transform: translateY(-12px) rotateX(-1deg) rotateY(-3deg); }
}

.bank-card-front,
.bank-card-back {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: 28px;
  box-shadow:
    0 25px 60px rgba(79, 70, 229, 0.35),
    0 10px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

.bank-card-front {
  background: linear-gradient(
    135deg,
    #4f46e5 0%,
    #7c3aed 40%,
    #6d28d9 70%,
    #4338ca 100%
  );
}

.bank-card-back {
  background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
}

/* لایه براق روی کارت */
.bank-card-shine {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0.04) 40%,
    transparent 60%
  );
  pointer-events: none;
}

/* نوار مغناطیسی پشت کارت */
.bank-card-stripe {
  width: 100%;
  height: 52px;
  background: #1a1a2e;
  margin-top: 40px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* بخش امضا */
.bank-card-sig {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 28px 0;
}

.bank-card-sig-lines {
  flex: 1;
  background: white;
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bank-card-sig-line {
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #ddd 0, #ddd 6px, #f5f5f5 6px, #f5f5f5 10px
  );
  border-radius: 1px;
}

.bank-card-cvv {
  background: white;
  color: #1a1a2e;
  font-family: monospace;
  font-size: 18px;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 6px;
  letter-spacing: 4px;
}

.bank-card-number-group {
  min-width: 60px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Bank card — tighter padding & number spacing on narrow phones so the
   16-digit number doesn't overflow the card width */
@media (max-width: 400px) {
  .bank-card-front,
  .bank-card-back {
    padding: 18px;
  }
  .bank-card-number-group {
    min-width: 0;
    letter-spacing: 0.08em !important;
  }
  .bank-card-sig { margin: 16px 18px 0; }
}

/* ════════════════════════════════════════════════════════════
   NEWS TICKER — نوار اخبار (نمایش یک خبر در هر لحظه)
════════════════════════════════════════════════════════════ */
#news-ticker-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* محاسبه سرعت بر اساس طول متن — از طریق JS تنظیم می‌شه */

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE ADMIN TABLES — تبدیل جدول به کارت در موبایل
   Add class="responsive-table" to any <table> and data-label="..."
   to each <td> to get a stacked-card layout under 640px.
══════════════════════════════════════════════════════════════ */
@media (max-width: 639px) {
  table.responsive-table thead { display: none; }
  table.responsive-table, table.responsive-table tbody { display: block; width: 100%; }
  table.responsive-table tr {
    display: block;
    border: 1px solid rgb(226 232 240);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: rgb(255 255 255);
  }
  .dark table.responsive-table tr {
    border-color: rgb(30 41 59);
    background: rgb(15 23 42 / 0.5);
  }
  table.responsive-table tr.rt-highlight {
    background: rgb(255 251 235 / 0.6);
  }
  .dark table.responsive-table tr.rt-highlight {
    background: rgb(120 53 15 / 0.12);
  }
  table.responsive-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    text-align: end;
    padding: 0.45rem 0 !important;
    border: none !important;
    max-width: none !important;
  }
  table.responsive-table td:not(:last-child) {
    border-bottom: 1px dashed rgb(226 232 240) !important;
  }
  .dark table.responsive-table td:not(:last-child) {
    border-bottom: 1px dashed rgb(51 65 85) !important;
  }
  table.responsive-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 600;
    color: rgb(148 163 184);
    text-align: start;
    flex-shrink: 0;
    padding-inline-end: 0.75rem;
  }
  table.responsive-table td.rt-full {
    display: block;
    text-align: start;
  }
  table.responsive-table td.rt-full::before {
    display: block;
    margin-bottom: 0.35rem;
  }
  table.responsive-table td .flex.flex-wrap,
  table.responsive-table td .flex.gap-2 {
    justify-content: flex-end;
  }
}

/* Scroll-shadow hint for tables that stay horizontally scrollable
   on mobile (e.g. the attendance matrix), so users notice there's
   more content to the side. */
@media (max-width: 639px) {
  .scroll-shadow-x {
    background:
      linear-gradient(to var(--scroll-fade-dir, left), white 30%, rgba(255,255,255,0)),
      linear-gradient(to var(--scroll-fade-dir-rev, right), white 30%, rgba(255,255,255,0)) 100% 0,
      linear-gradient(to var(--scroll-fade-dir, left), rgba(0,0,0,.08), rgba(0,0,0,0)),
      linear-gradient(to var(--scroll-fade-dir-rev, right), rgba(0,0,0,.08), rgba(0,0,0,0)) 100% 0;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 24px 100%, 24px 100%, 10px 100%, 10px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  .dark .scroll-shadow-x {
    background-color: rgb(15 23 42);
    background-image:
      linear-gradient(to var(--scroll-fade-dir, left), rgb(15 23 42) 30%, rgba(15,23,42,0)),
      linear-gradient(to var(--scroll-fade-dir-rev, right), rgb(15 23 42) 30%, rgba(15,23,42,0)) 100% 0,
      linear-gradient(to var(--scroll-fade-dir, left), rgba(255,255,255,.08), rgba(255,255,255,0)),
      linear-gradient(to var(--scroll-fade-dir-rev, right), rgba(255,255,255,.08), rgba(255,255,255,0)) 100% 0;
  }
}

/* ══════════════════════════════════════════════════
   Old-browser fallbacks
══════════════════════════════════════════════════ */
/* dvh unit isn't supported before ~2022 browsers. Only apply the vh
   fallback when the browser can't handle dvh at all, so modern browsers
   keep using Tailwind's 100dvh rule (loaded earlier in the cascade). */
@supports not (min-height: 100dvh) {
  .min-h-dvh { min-height: 100vh; }
}
