/* ============================================
   RaKura Manual - Custom Styles
   ============================================ */

/* ---------- Base & Scrollbar ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (min-width: 1024px) {
  html {
    scroll-padding-top: 2rem;
  }
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---------- Sidebar ---------- */
#sidebar {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem 0.4rem 1.25rem;
  font-size: 0.85rem;
  color: #64748b;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.nav-link:hover {
  color: #1e40af;
  background: #eff6ff;
}

.nav-link.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-left-color: #3b82f6;
  font-weight: 600;
}

.nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 1.25rem 1.25rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Admin Badge ---------- */
.badge-admin {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 0.25rem;
  line-height: 1.5;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-admin-lg {
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  border-radius: 0.3rem;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 50%, #1e3a8a 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

/* ---------- Section Cards ---------- */
.section-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  border: 1px solid #f1f5f9;
  transition: box-shadow 0.3s ease;
}

.section-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-title .title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #3b82f6;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

/* ---------- Steps ---------- */
.steps {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.step {
  counter-increment: step-counter;
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 1.1rem;
  top: 2.75rem;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.step-number {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  z-index: 1;
}

.step-content {
  flex: 1;
  padding-top: 0.2rem;
  font-size: 0.925rem;
  line-height: 1.7;
  color: #334155;
}

.step-content strong {
  color: #0f172a;
}

/* ---------- Tip / Note Box ---------- */
.tip-box {
  background: #f0f9ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  color: #1e40af;
  line-height: 1.7;
}

.tip-box .tip-label {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.warn-box {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.7;
}

/* ---------- Screenshot ---------- */
.screenshot-wrapper {
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.screenshot-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-wrapper .screenshot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #94a3b8;
  font-size: 0.85rem;
  flex-direction: column;
  gap: 0.5rem;
}

.screenshot-wrapper .screenshot-placeholder svg {
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.4;
}

.screenshot-caption {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
  padding: 0.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* ---------- Role Table ---------- */
.role-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1rem 0;
}

.role-table th {
  background: #f8fafc;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  color: #475569;
}

.role-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.role-table tr:hover td {
  background: #f8fafc;
}

.role-check {
  color: #16a34a;
  font-weight: 700;
}

.role-cross {
  color: #dc2626;
  font-weight: 400;
}

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.faq-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  font-size: 0.925rem;
}

.faq-question .q-mark {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b82f6;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: 50%;
}

.faq-answer {
  padding: 1rem 1.25rem 1rem 3.75rem;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.7;
  border-top: 1px solid #e2e8f0;
}

/* ---------- Status Colors ---------- */
.status-danger  { color: #dc2626; background: #fef2f2; padding: 0.15rem 0.5rem; border-radius: 0.25rem; font-size: 0.8rem; font-weight: 600; }
.status-warning { color: #d97706; background: #fffbeb; padding: 0.15rem 0.5rem; border-radius: 0.25rem; font-size: 0.8rem; font-weight: 600; }
.status-success { color: #16a34a; background: #f0fdf4; padding: 0.15rem 0.5rem; border-radius: 0.25rem; font-size: 0.8rem; font-weight: 600; }

/* ---------- Tab-like display ---------- */
.tab-list {
  display: flex;
  gap: 0.25rem;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.tab-item {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  transition: all 0.2s;
}

.tab-item.tab-active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ---------- Section Animations ---------- */
.section-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Back to Top Button ---------- */
#back-to-top {
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

#back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- Mobile Overlay ---------- */
#sidebar-overlay {
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

#sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar slide */
#sidebar {
  transition: transform 0.3s ease;
}

@media (max-width: 1023px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
}

/* ---------- Inline Code ---------- */
.inline-code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
  color: #1e40af;
  font-family: 'SFMono-Regular', Consolas, monospace;
}

/* ---------- Content typography ---------- */
.content-text {
  font-size: 0.925rem;
  line-height: 1.8;
  color: #334155;
}

.content-text p {
  margin-bottom: 0.75rem;
}

.content-text ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.content-text ul li {
  margin-bottom: 0.35rem;
}

.content-text strong {
  color: #0f172a;
}

/* ---------- Print Styles ---------- */
@media print {
  #sidebar,
  #mobile-header,
  #sidebar-overlay,
  #back-to-top {
    display: none !important;
  }
  main {
    margin-left: 0 !important;
  }
  .section-card {
    opacity: 1 !important;
    transform: none !important;
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
  }
}
