/* Shared header - Cyrus AI
   Used by: translation_miniapp.html + wallet_dashboard.html
*/


body.has-site-header {
  margin: 0;
  padding: 0;
  padding-top: var(--cyrus-header-height);

  --cyrus-header-container-max: 580px;
  --cyrus-header-container-pad-x: 16px;
}

/* === Default tokens (fallback) === */
:root {
  --cyrus-header-bg: rgba(243, 231, 225, 0.72);
  --cyrus-header-border: rgba(0, 0, 0, 0.06);
  --cyrus-header-text: #0a0e1a;
  --cyrus-header-chip-bg: rgba(0, 0, 0, 0.06);
  --cyrus-header-height: 75px;
  --cyrus-brand-size: calc(var(--cyrus-header-height) - 16px); /* حدوداً 59px */

  --cyrus-header-container-max: 1200px;
  --cyrus-header-container-pad-x: 22px;

}

html:not([data-theme="light"]) {
  --cyrus-header-bg: rgba(15, 17, 22, 0.60);
  --cyrus-header-border: rgba(255, 255, 255, 0.08);
  --cyrus-header-text: #f8fafc;
  --cyrus-header-chip-bg: rgba(255, 255, 255, 0.08);
}


/* === HEADER === */
.cyrus-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;

  background: var(--cyrus-header-bg);
  border-bottom: 1px solid var(--cyrus-header-border);
  color: var(--cyrus-header-text);
}


/* === NAV LAYOUT === */

.cyrus-nav {
  display: grid;
  grid-template-columns: auto 1fr auto; /* چپ: لینک‌ها | وسط: فاصله | راست: لاگین */

  align-items: center;
  align-content: center;                /* ✅ جدید: ردیف‌ها وسط ظرف قرار بگیرن */

  /* قبلاً این بود: min-height: var(--cyrus-header-height); */
  height: var(--cyrus-header-height);   /* ✅ ارتفاع ثابت، نه فقط min-height */

  padding: 0 var(--cyrus-header-container-pad-x);
  gap: 16px;

  max-width: var(--cyrus-header-container-max);
  margin: 0 auto;
}

/* ===== Placement rules (put after .cyrus-nav) ===== */


/* ===== Edge-start nav links (RTL right edge, LTR left edge) ===== */

/* LTR: لینک‌ها از لبه چپ قاب */
html:not([dir="rtl"]) .cyrus-nav-links {
  grid-column: 1;
  justify-self: start;
  margin: 0;
  padding: 0;
}

/* LTR: لاگین/اکانت سمت راست قاب */
html:not([dir="rtl"]) .cyrus-nav-right {
  grid-column: 3;
  justify-self: end;
  margin: 0;
  padding: 0;
}

/* RTL: لینک‌ها از لبه راست قاب */
html[dir="rtl"] .cyrus-nav-links {
  grid-column: 1;
  justify-self: end;
  margin: 0;
  padding: 0;

  /* ✅ تضمین چسبیدن آیتم‌ها به راست (اگر ظرف stretch شد) */
  justify-content: flex-end;

  /* ✅ کمی پایین‌تر داخل هدر */
  transform: translateY(6px);
}

/* RTL: لاگین/اکانت سمت چپ قاب */
html[dir="rtl"] .cyrus-nav-right {
  grid-column: 3;
  justify-self: start;
  margin: 0;
  padding: 0;
}



.cyrus-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: var(--cyrus-brand-size);  /* قبلاً 36px بود */
  color: inherit;
}

.cyrus-brand-mark {

  width: var(--cyrus-brand-size);      /* قبلاً 28px بود */
  height: var(--cyrus-brand-size);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-weight: 700;
  font-size: 14px;

  background: var(--cyrus-header-chip-bg);
  color: inherit;
}

.cyrus-brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}


/* === LINKS === */
.cyrus-nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.cyrus-nav-link {
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  /* text-transform: uppercase; */
  text-transform: none;  /* یا این خط رو کلاً حذف کن */
  opacity: 0.75;
  color: inherit;
}

.cyrus-nav-link:hover {
  opacity: 1;
}

.cyrus-nav-link.is-active {
  opacity: 1;
  font-weight: 600;
}

/* === RIGHT SIDE === */
.cyrus-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* auth dropdown anchor */
.cyrus-nav-right {
  position: relative; /* مهم: منو نسبت به این تراز می‌شه */
}

/* fixed auth button */
.cyrus-auth-btn {
  appearance: none;
  font: inherit;
  background: var(--cyrus-header-chip-bg);
  color: inherit;
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

/* dropdown menu */
.cyrus-auth-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0; /* RTL/LTR هوشمند */
  min-width: 190px;

  background: var(--cyrus-header-bg);
  border: 1px solid var(--cyrus-header-border);
  border-radius: 12px;
  overflow: hidden;

  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
}

.cyrus-auth-menu[hidden] {
  display: none;
}

.cyrus-auth-menu a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  font-size: 12.5px;
  opacity: 0.9;
}

.cyrus-auth-menu a:hover {
  opacity: 1;
  background: rgba(0,0,0,0.06);
}

html:not([data-theme="light"]) .cyrus-auth-menu a:hover {
  background: rgba(255,255,255,0.08);
}


.cyrus-nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* button شبیه لینک */
.cyrus-nav-dropdown-btn {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

/* نشان دادن اینکه About زیرمنو دارد (مثل Learn ▾) */
.cyrus-nav-dropdown-btn {
  display: inline-flex;          /* متن + آیکن کنار هم */
  align-items: center;
  gap: 6px;                      /* فاصله بین متن و caret */
}

/* caret */
.cyrus-nav-dropdown-btn::after {
  content: "▾";
  font-size: 12px;
  opacity: 0.7;
  transform: translateY(-1px);
  transition: transform 120ms ease, opacity 120ms ease;
}

/* وقتی منو باز است caret برعکس شود */
.cyrus-nav-dropdown-btn[aria-expanded="true"]::after {
  transform: translateY(-1px) rotate(180deg);
  opacity: 1;
}


/* منوی About زیر خودش باز شود (نه مثل auth که از راست می‌چسبد) */
.cyrus-nav-menu {
  inset-inline-end: auto;
  inset-inline-start: 0;
}


/* ===== Auth dropdown (clean) ===== */
.cyrus-nav-right { position: relative; }

.cyrus-auth-menu{
  position:absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: 320px;
  padding: 10px;
  border-radius: 16px;

  background: rgba(255,255,255,0.78);
  border: 1px solid var(--cyrus-header-border);
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
  backdrop-filter: blur(14px);

  max-height: calc(100vh - 110px);
  overflow: auto;
}
html:not([data-theme="light"]) .cyrus-auth-menu{
  background: rgba(18,20,26,0.72);
}

.cyrus-auth-menu[hidden]{ display:none; }

.cyrus-auth-item{
  display:flex;
  align-items:center;
  justify-content: space-between;

  padding: 10px 12px;
  border-radius: 12px;

  text-decoration:none;
  color: inherit;

  font-size: 14px;
  font-weight: 600;
  opacity: 0.92;
}
.cyrus-auth-item:hover{
  opacity: 1;
  background: rgba(0,0,0,0.06);
}
html:not([data-theme="light"]) .cyrus-auth-item:hover{
  background: rgba(255,255,255,0.08);
}

.cyrus-auth-sep{
  height: 1px;
  background: var(--cyrus-header-border);
  margin: 10px 6px;
}

/* provider buttons like OpenAI */

.cyrus-auth-provider-btn{
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  width: 100%;
  text-align: inherit;
  cursor: pointer;
}

.cyrus-auth-provider{
  display:flex;
  align-items:center;
  gap: 10px;

  width: 100%;
  padding: 12px 14px;
  margin: 10px 0;

  border-radius: 999px;
  border: 1px solid var(--cyrus-header-border);
  background: rgba(255,255,255,0.92);

  text-decoration:none;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
}
html:not([data-theme="light"]) .cyrus-auth-provider{
  background: rgba(255,255,255,0.06);
}

.cyrus-auth-provider:hover{
  background: rgba(0,0,0,0.04);
}
html:not([data-theme="light"]) .cyrus-auth-provider:hover{
  background: rgba(255,255,255,0.10);
}

.cyrus-auth-provider-icon{
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  flex: 0 0 22px;
}

.cyrus-auth-provider-icon svg{
  width: 18px;
  height: 18px;
  display:block;
}

.cyrus-auth-or{
  display:flex;
  align-items:center;
  gap: 10px;
  margin: 8px 0 2px;
  opacity: 0.7;
  font-size: 12px;
}
.cyrus-auth-or::before,
.cyrus-auth-or::after{
  content:"";
  flex:1;
  height:1px;
  background: var(--cyrus-header-border);
}

/* plain links at bottom */
.cyrus-auth-link{
  display:block;
  padding: 12px 8px;
  text-decoration:none;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}
.cyrus-auth-link:hover{ opacity: 1; }


/* ======== cyrus-wordmark ===============*/
.cyrus-wordmark {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none; /* خودت توی HTML نوشتی CyrusAI */
  white-space: nowrap;
  line-height: 1;
}

/* اگر خواستی در RTL کمی نزدیک‌تر به کناره‌ی صفحه بشه (اختیاری) */
html[dir="rtl"] .cyrus-wordmark {
  text-align: left;
}

html:not([dir="rtl"]) .cyrus-wordmark {
  text-align: right;
}

.cyrus-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 6px 10px;
  font-size: 11px;
  border-radius: 10px;

  background: var(--cyrus-header-chip-bg);
  color: inherit;

  text-decoration: none;              /* چون الان لینک می‌شه */
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.12);  /* برای قاب کم‌رنگ دورش، شبیه اسکرین‌شات */
  line-height: 1;
}

.cyrus-user-pill:hover {
  opacity: 0.9;
}


/* === Mobile === */
@media (max-width: 640px) {
  .cyrus-nav {

    padding: 0 14px;
    height: var(--cyrus-header-height);
  }

  .cyrus-nav-links {
    gap: 10px;
  }



}

/* ===== Auth full-screen modal (OpenAI-like) ===== */
body.cyrus-auth-modal-open { overflow: hidden; }

.cyrus-auth-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.cyrus-auth-modal[hidden]{ display:none; }

.cyrus-auth-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
}

/* Card */

.cyrus-auth-modal-card{
  position: relative;

  width: min(560px, 100%);          
  max-height: calc(100vh - 56px);
  min-height: 360px;              /* درازتر */
  overflow: auto;

  padding: 30px 24px 26px;        /* یه کم فضای داخلی بیشتر */      
  border-radius: 22px;

  background: rgba(255,255,255,0.86);
  border: 1px solid var(--cyrus-header-border);
  box-shadow: 0 22px 70px rgba(0,0,0,0.25);
  backdrop-filter: blur(14px);
}

html:not([data-theme="light"]) .cyrus-auth-modal-card{
  background: rgba(18,20,26,0.86);
}

/* Close button */
.cyrus-auth-modal-x{
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;

  width: 36px;
  height: 36px;
  border-radius: 999px;

  border: 1px solid var(--cyrus-header-border);
  background: rgba(0,0,0,0.06);
  color: inherit;
  cursor: pointer;
}
html:not([data-theme="light"]) .cyrus-auth-modal-x{
  background: rgba(255,255,255,0.08);
}

/* Title + subtitle */
.cyrus-auth-modal-title{
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  /* margin: 8px 0 6px; */

  margin: 6px 0 26px;   /* فاصله‌ی پایین بیشتر */

}

.cyrus-auth-modal-sub{
  text-align: center;
  font-size: 14px;
  opacity: 0.75;
  margin: 0 0 10px;
}

/* Small note (like "Don't have an account? Sign up") */
.cyrus-auth-modal-note{
  text-align: center;
  font-size: 14px;
  opacity: 0.9;
  margin: 0 0 14px;
}
.cyrus-auth-modal-note a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Providers: make them tighter only inside modal */

.cyrus-auth-modal .cyrus-auth-provider{
  width: min(360px, 100%);   /* این عدد رو می‌تونی 340/380 هم تست کنی */
  margin: 10px auto;
  padding: 9px 12px;         /* از بغل‌ها جمع‌تر */
  font-size: 13.5px;
}

/* OR spacing inside modal */
/* .cyrus-auth-modal .cyrus-auth-or{
  margin: 10px 0 6px;
} */

/* فاصله‌ی بیشتر بین آیتم‌ها (داخل مودال) */
.cyrus-auth-modal .cyrus-auth-provider{
  margin: 6px auto;   /* قبلاً 10px بود */
}

/* OR کمی فاصله‌ی بالا/پایین بیشتر بگیرد */
.cyrus-auth-modal .cyrus-auth-or{
  margin: 18px 0 14px; /* قبلاً 10px 0 6px بود */
}

/* کمی فضای خالی زیر آخرین دکمه */
.cyrus-auth-modal .cyrus-auth-provider:last-of-type{
  margin-bottom: 28px;
}


/* Bottom links inside modal */
.cyrus-auth-modal-links{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  margin-top: 10px;
  font-size: 13px;
  opacity: 0.85;
}
.cyrus-auth-modal-links a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

