/* ============================================
   SalahNow User Guide - Additional Styles
   Supplements styles.css for guide page
   ============================================ */

/* ---------- Guide Page Layout ---------- */
.guide-page {
  padding: 100px 0 60px;
  min-height: 100vh;
}

.guide-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

/* ---------- Hero Banner ---------- */
.guide-hero {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 50%, var(--bg-dark) 100%);
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}

.guide-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='white' stroke-width='0.5'/%3E%3Cpath d='M30 10L50 30L30 50L10 30Z' fill='none' stroke='white' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

.guide-hero .container {
  position: relative;
  z-index: 2;
  text-align: center;
}

.guide-hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 16px;
}

.guide-hero .guide-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.guide-hero .guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid rgba(212, 168, 67, 0.3);
  padding: 8px 20px;
  border-radius: 50px;
  color: var(--secondary-light);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

/* ---------- Table of Contents (Sidebar) ---------- */
.guide-toc {
  position: sticky;
  top: 100px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.guide-toc::-webkit-scrollbar {
  width: 4px;
}

.guide-toc::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.guide-toc h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(13, 115, 119, 0.1);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 4px;
}

.toc-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
  line-height: 1.4;
}

.toc-list a:hover {
  background: rgba(13, 115, 119, 0.06);
  color: var(--primary);
}

.toc-list a.active {
  background: rgba(13, 115, 119, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.toc-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(13, 115, 119, 0.08);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toc-list a.active .toc-number {
  background: var(--primary);
  color: var(--white);
}

/* ---------- Guide Content Area ---------- */
.guide-content {
  min-width: 0;
}

.guide-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: var(--transition);
}

.guide-section:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.guide-section h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-section h2 .section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(13, 115, 119, 0.1);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.guide-section .section-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  line-height: 1.7;
}

.guide-section h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 3px solid var(--secondary);
}

body.rtl .guide-section h3 {
  padding-left: 0;
  border-left: none;
  padding-right: 14px;
  border-right: 3px solid var(--secondary);
}

.guide-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.guide-section ol {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
  margin: 16px 0;
}

.guide-section ol li {
  counter-increment: step-counter;
  padding: 12px 12px 12px 48px;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 8px;
  background: rgba(248, 249, 250, 0.6);
  border-radius: 8px;
}

body.rtl .guide-section ol li {
  padding: 12px 48px 12px 12px;
}

.guide-section ol li::before {
  content: counter(step-counter);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.rtl .guide-section ol li::before {
  left: auto;
  right: 12px;
}

.guide-section ul {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.guide-section ul li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

body.rtl .guide-section ul li {
  padding: 8px 24px 8px 0;
}

.guide-section ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
}

body.rtl .guide-section ul li::before {
  left: auto;
  right: 4px;
}

/* ---------- Info/Tip Boxes ---------- */
.guide-tip {
  background: rgba(13, 115, 119, 0.06);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--primary-dark);
  line-height: 1.7;
}

body.rtl .guide-tip {
  border-left: none;
  border-right: 4px solid var(--primary);
  border-radius: 8px 0 0 8px;
}

.guide-tip strong {
  color: var(--primary);
}

.guide-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--warning);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: #92400e;
  line-height: 1.7;
}

body.rtl .guide-warning {
  border-left: none;
  border-right: 4px solid var(--warning);
  border-radius: 8px 0 0 8px;
}

/* ---------- Inline Phone Screenshots ---------- */
.guide-screenshot {
  display: flex;
  justify-content: center;
  margin: 24px 0;
  gap: 20px;
  flex-wrap: wrap;
}

.guide-screenshot .phone-frame-small {
  background: #1a1a1a;
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  width: 200px;
  flex-shrink: 0;
  transition: var(--transition);
}

.guide-screenshot .phone-frame-small:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.guide-screenshot .phone-frame-small img {
  border-radius: 22px;
  width: 100%;
  display: block;
}

.guide-screenshot .screenshot-caption {
  text-align: center;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Two phones side by side */
.guide-screenshot.dual {
  gap: 24px;
}

/* ---------- Feature Highlight Box ---------- */
.feature-highlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.feature-highlight-item {
  background: var(--bg-light);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.feature-highlight-item .fh-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(13, 115, 119, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.feature-highlight-item .fh-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.feature-highlight-item .fh-text strong {
  color: var(--text-primary);
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

/* ---------- Keyboard Shortcut Style ---------- */
.guide-key {
  display: inline-block;
  background: var(--bg-light);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Inter', monospace;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ---------- Mobile TOC ---------- */
.guide-toc-mobile {
  display: none;
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.toc-mobile-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
  background: rgba(13, 115, 119, 0.04);
  border: none;
  width: 100%;
  text-align: left;
}

body.rtl .toc-mobile-header {
  text-align: right;
}

.toc-mobile-header svg {
  transition: var(--transition);
  flex-shrink: 0;
}

.toc-mobile-header.open svg {
  transform: rotate(180deg);
}

.toc-mobile-body {
  display: none;
  padding: 8px 16px 16px;
  max-height: 50vh;
  overflow-y: auto;
}

.toc-mobile-body.open {
  display: block;
}

.toc-mobile-body .toc-list a {
  padding: 8px 10px;
  font-size: 0.85rem;
}

/* ---------- Back to Top Enhancement for Guide ---------- */
.guide-back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(13, 115, 119, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
}

body.rtl .guide-back-top {
  right: auto;
  left: 30px;
}

.guide-back-top.visible {
  opacity: 1;
  visibility: visible;
}

.guide-back-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* ---------- Progress Bar ---------- */
.guide-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 1001;
}

.guide-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.15s ease-out;
}

/* ---------- Screenshot Frame (new) ---------- */
.screenshot-frame {
  background: #1a1a1a;
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  width: 200px;
  flex-shrink: 0;
  transition: var(--transition);
}

.screenshot-frame:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.screenshot-frame img {
  border-radius: 22px;
  width: 100%;
  display: block;
}

.screenshot-label {
  text-align: center;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------- Feature Highlights Box ---------- */
.feature-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.feature-highlight-box {
  background: linear-gradient(135deg, rgba(13, 115, 119, 0.04) 0%, rgba(212, 168, 67, 0.04) 100%);
  border: 1px solid rgba(13, 115, 119, 0.08);
  border-radius: 12px;
  padding: 20px;
  transition: var(--transition);
}

.feature-highlight-box:hover {
  border-color: rgba(13, 115, 119, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.feature-highlight-box h4 {
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.feature-highlight-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ---------- Role Badge ---------- */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.role-badge.user { background: rgba(16, 185, 129, 0.1); color: #059669; }
.role-badge.admin { background: rgba(212, 168, 67, 0.15); color: #b8860b; }
.role-badge.super { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.role-badge.master { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.stat-card {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-card .stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* ---------- TOC Mobile Toggle ---------- */
.toc-mobile-toggle {
  display: none;
  width: 100%;
  padding: 14px 20px;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  margin-bottom: 20px;
  text-align: left;
  transition: var(--transition);
}

body.rtl .toc-mobile-toggle {
  text-align: right;
}

.toc-mobile-toggle:hover {
  background: rgba(13, 115, 119, 0.04);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .guide-layout {
    grid-template-columns: 220px 1fr;
    gap: 32px;
  }

  .guide-section {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .guide-hero {
    padding: 120px 0 60px;
  }

  .guide-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .guide-toc {
    display: none;
  }

  .guide-toc-mobile {
    display: block;
  }

  .guide-section {
    padding: 24px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
  }

  .guide-section h2 {
    font-size: 1.25rem;
  }

  .guide-section h2 .section-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .guide-screenshot .phone-frame-small {
    width: 160px;
  }

  .feature-highlight,
  .feature-highlights {
    grid-template-columns: 1fr;
  }

  .toc-mobile-toggle {
    display: block;
  }

  .guide-section ol li {
    padding-left: 42px;
  }

  body.rtl .guide-section ol li {
    padding-right: 42px;
    padding-left: 12px;
  }
}

@media (max-width: 480px) {
  .guide-section {
    padding: 20px 16px;
  }

  .guide-screenshot .phone-frame-small {
    width: 140px;
  }

  .guide-hero h1 {
    font-size: 1.6rem;
  }
}
