﻿/******************************
 * Global variables
 ******************************/
:root {
  --header-h: 64px;
  --sidebar-w: 250px;
  --radius: 12px;
  --primary: #0d6efd;
  --gradient: linear-gradient(135deg, #6c63ff, #3a44f3);
  --sidebar-bg: #005f73;
  --text: #222;
  --bg: #f5f7fa;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter/Inter-VariableFont_opsz,wght.ttf')
    format('truetype-variations');
  font-weight: 100 900; /* محدوده وزن */
  font-style: normal;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttf')
    format('truetype-variations');
  font-weight: 100 900;
  font-style: italic;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn/Vazirmatn-VariableFont_wght.ttf')
    format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins/Poppins-Bold.ttf') format('truetype-Poppins');
  font-weight: 100 900;
  font-style: normal;
}
/******************************
 * Base
 ******************************/
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Vazirmatn', 'Inter', 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* لینک‌ها در کل سایت */
a {
  color: inherit;
  text-decoration: underline; /* برای متن داخل محتوا UX بهتره */
}
/* لینک‌ها در سایدبار و هدر بدون underline */
.header a,
.sidebar a {
  text-decoration: none;
}

.header a:hover,
.sidebar a:hover {
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}

/******************************
 * Layout wrapper
 ******************************/
.layout {
  display: flex;
  min-height: 100vh;
}

[dir='rtl'] .layout {
  flex-direction: row-reverse;
}

/******************************
 * Header
 ******************************/
.header {
  position: fixed;
  top: 0;
  z-index: 1300; /* بالاتر از سایدبار دسکتاپ */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.75rem 10px;
  min-height: 64px;
  color: #fff;
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
}

.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(13, 110, 253, 0.25);
  background: rgba(13, 110, 253, 0.1);
  color: var(--primary);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.hamburger:hover {
  background: rgba(13, 110, 253, 0.16);
  transform: scale(1.06);
}

.hamburger:active {
  transform: scale(0.98);
}

/* کانتینر سمت راست هدر (اکانت + زبان) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #2f2f2f;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.header .dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.35);
}

.header .dropdown-menu {
  /* روی همه بیاد */
  z-index: 1400;
}

.header .dropdown-toggle img {
  border: 2px solid #fff;
  border-radius: 50%;
}

/******************************
 * Sidebar (desktop)
 ******************************/
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: sticky;
  top: 0; /* با استیکی هدر مشکلی ایجاد نمی‌کند چون هدر داخل فلو است */
  height: 100vh;
  overflow-y: auto;
  z-index: 200; /* هدر بالاتر است */
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.12);
  padding-top: 86px;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
}

.ltr-sidebar {
  order: 0;
}

.rtl-sidebar {
  order: 1;
}

/* لینک‌های سایدبار */
.sidebar a,
.sidebar form button {
  color: #fff;
  font-weight: 500;
  font-size: 0.97rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  border: none;
  text-align: start;
  transition: background 0.18s ease, transform 0.18s ease;
}

.sidebar a:hover,
.sidebar form button:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(5px);
  color: #f9f7f3;
}

.sidebar .active {
  background: rgba(255, 255, 255, 0.22);
}

/******************************
 * Admin group in sidebar
 ******************************/
.admin-menu-wrapper {
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.5rem;
}

.admin-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s ease;
}

.admin-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.arrow-icon {
  transition: transform 0.25s ease;
}

.admin-toggle[aria-expanded='true'] .arrow-icon {
  transform: rotate(180deg);
}

.admin-menu-wrapper a {
  display: block;
  color: #f0f4ff;
  background: transparent;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-top: 0.25rem;
}

.admin-menu-wrapper a:hover {
  background: rgba(255, 255, 255, 0.18);
}

/******************************
 * Content area + Footer
 ******************************/
/* فاصله محتوا از زیر هدر */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* جلوگیری از شکست محتوا */
  padding-top: 0; /* فاصله ثابت با ارتفاع هدر */
}

main {
  flex: 1;
  padding-top: 64px;
}

footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
  border-top: 1px solid #444;
  font-size: 0.92rem;
  flex-shrink: 0;
}

/******************************
 * Overlay (for mobile)
 ******************************/
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 1190;
}

.overlay.show {
  display: block;
}

/******************************
 * Mobile: header + sidebar behavior
 ******************************/
@media (max-width: 768px) {
  main {
    flex: 1;
    padding-top: 0;
    padding-left: 0;
  }

  /* هدر روی صفحه فیکس شود */
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }
  /* فاصله محتوا از زیر هدر */
  .content-area {
    padding-top: var(--header-h);
  }

  /* اکانت و زبان زیر هم برای جلوگیری از به‌هم‌ریختگی */
  .header-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    width: auto;
  }

  .header-actions .dropdown,
  .header-actions .dropdown-toggle {
    width: 100%;
  }

  /* سایدبار به صورت کشویی و روی صفحه */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    max-height: calc(100vh - var(--header-h));
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.28);
    border-radius: 0;
    z-index: 1200; /* بالاتر از overlay و محتوا */
    transform: translateX(
      0
    ); /* مقدار پیش‌فرض؛ با کلاس‌های ltr/rtl کنترل می‌کنیم */
    transition: transform 0.3s ease;
    padding-top: 0;
  }

  /* ورود از چپ برای LTR و از راست برای RTL */
  .ltr-sidebar {
    left: 0;
    right: auto;
    transform: translateX(-100%);
  }

  .rtl-sidebar {
    right: 0;
    left: auto;
    transform: translateX(100%);
  }

  /* وقتی منو باز است */
  .sidebar.mobile-show {
    transform: translateX(0);
  }
}

/******************************
 * Tiny tweaks
 ******************************/
button:focus,
.dropdown-toggle:focus,
.hamburger:focus {
  outline: 2px solid rgba(13, 110, 253, 0.6);
  outline-offset: 2px;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 75vh;
}

.login-subtitle {
  font-size: 0.95rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
}

.captcha-img {
  border: 1px solid #ddd;
  border-radius: 6px;
  height: 40px;
}

.reload-captcha {
  color: #007bff;
  font-size: 1.2rem;
}

.reload-captcha:hover {
  color: #0056b3;
}

.forgot-link {
  font-size: 0.9rem;
  color: #007bff;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.shared-exams-header h2 {
  font-weight: 600;
  color: #2f2f2f;
}

.shared-exams-table table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.shared-exams-table th {
  font-weight: 600;
  color: #555;
}

.shared-exams-table td {
  vertical-align: middle;
}

.exam-row:hover {
  background: #f5f7fa;
  transition: all 0.3s;
}

.exam-row .btn {
  display: flex;
  align-items: center;
}

.exam-row .btn i {
  font-size: 0.9rem;
}

.badge {
  font-size: 0.8rem;
  padding: 0.35em 0.6em;
}

@media (max-width: 768px) {
  .shared-exams-table table,
  .shared-exams-table thead,
  .shared-exams-table tbody,
  .shared-exams-table th,
  .shared-exams-table td,
  .shared-exams-table tr {
    display: block;
    width: 100%;
  }

  .shared-exams-table thead tr {
    display: none;
  }

  .shared-exams-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    position: relative;
    border-bottom: 1px solid #ddd;
  }

  .shared-exams-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    font-weight: 600;
    color: #555;
    text-align: left;
  }

  .exam-row .btn {
    width: 100%;
    justify-content: start;
  }
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.card-title {
  font-weight: 700;
  color: #3a44f3;
}

.form-label {
  font-weight: 500;
  color: #333;
}

.form-select,
.form-control {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  transition: all 0.25s;
}

.form-select:focus,
.form-control:focus {
  border-color: #3a44f3;
  box-shadow: 0 0 0 0.2rem rgba(58, 68, 243, 0.15);
}

.btn-primary {
  background: #3a44f3;
  border: none;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: #5658ff;
}

@media (max-width: 768px) {
  .card {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
}
/* دکمه ذخیره */
.btn_save {
  display: inline-block;
  background-color: #48d1cc;
  color: #fff;
  padding: 0.375rem 0.75rem; /* جمع‌وجور */
  font-size: 1rem; /* اندازه متن مثل btn */
  line-height: 2; /* ارتفاع هماهنگ */
  border: none;
  border-radius: 0.375rem; /* گوشه گرد */
  font-weight: 500;
  text-align: center;
  transition: background-color 0.2s ease-in-out;
  cursor: pointer;
  width: 100%;
}

.btn_save:hover {
  background-color: #94d2bd;
}
a.btn_save:hover {
  color: #fff !important;
}
input.form-control::placeholder {
  font-size: 14px;
}
/* دکمه بازگشت */
.btn_back {
  display: inline-block;
  background-color: #0079bf; /* رنگ اصلی Trello */
  color: #fff;
  padding: 0.375rem 0.75rem; /* جمع‌وجور */
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.375rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
  width: auto;
}

.btn_back:hover {
  background-color: #026aa7;
  color: #fff;
  transform: translateY(-2px);
}
tr.exam-row .mobile-th {
  display: none;
}
@media (max-width: 576px) {
  .login-card {
    padding: 1.5rem 1rem;
  }
  .exam-access-card {
    padding: 1.5rem 1rem;
  }
  .btn_save {
    max-width: 320px;
    margin: 0 auto;
  }
  tr.exam-row td span {
    font-size: 12px !important;
  }
  tr.exam-row .mobile-th {
    display: block;
  }
  .table-responsive.shared-exams-table {
    padding: 8px !important;
  }
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card h3 {
  font-weight: 600;
  color: #333;
}

.exam-access-page {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.exam-access-card {
  width: 100%;
  max-width: 500px;
}

.label-notice-expire {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  display: inline-block;
  margin-bottom: 4px;
}
ul#examTabs li.nav-item {
  flex-grow: 1;
}

ul#examTabs li.nav-item .nav-link {
  width: 100%;
}
.captcha-img {
  height: 49px;
  width: auto;
}
#captchaInput::placeholder {
  font-size: 12px !important;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background-color: #ffffff;
  border: 1px solid #dfdfdf;
  border-radius: 4px;
  color: #333333;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
}

.google-btn img {
  width: 30px;
  margin-right: 10px;
}

.google-btn:hover {
  background-color: #f1f1f1;
}
