/* =============================================================
   eKYC 3.0 Developer Documentation - Motilal Oswal RISE Theme
   Colors from flutter_app/lib/config/theme.dart (MOSL RISE palette)
   - Primary: #2B2E8C (navy blue)
   - Progress: #47A5E3 (light blue)
   - Success: #008743 (green)
   - Error:   #CC101C (red)
   - Accent:  #06A64F (RISE green)
   Font: Inter (fallback to Segoe UI)
   ============================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #fafbff;
  color: #0F0F10;
  line-height: 1.6;
  font-size: 14px;
}

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

.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #2B2E8C 0%, #1a1d6b 100%);
  color: #cfd3e8;
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(43, 46, 140, 0.15);
}

.sidebar .brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 16px;
}

.sidebar .brand .logo-block {
  background: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar .brand .logo-block .logo-img {
  height: 24px;
  width: auto;
}

.sidebar .brand .logo-block .mosl-text {
  font-size: 10px;
  font-weight: 700;
  color: #2B2E8C;
  line-height: 1.1;
  letter-spacing: 0.3px;
}

.sidebar .brand h1 { font-size: 17px; color: #fff; font-weight: 700; letter-spacing: 0.3px; }
.sidebar .brand p { font-size: 11px; color: #93c5fd; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar nav { padding: 0 12px; }

.sidebar .section-label {
  font-size: 10px;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 14px 12px 6px;
  font-weight: 700;
}

.sidebar nav a {
  display: block;
  padding: 8px 12px;
  color: #cfd3e8;
  text-decoration: none;
  font-size: 13px;
  border-radius: 6px;
  margin-bottom: 2px;
  transition: all 0.15s;
}

.sidebar nav a:hover { background: rgba(71, 165, 227, 0.15); color: #fff; }

.sidebar nav a.active {
  background: linear-gradient(90deg, #47A5E3 0%, #2B2E8C 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(71,165,227,0.3);
}

.sidebar nav a .num {
  display: inline-block;
  width: 22px;
  font-size: 11px;
  color: #93c5fd;
  font-weight: 600;
}

.sidebar nav a.active .num { color: #fff; }

.sidebar .sidebar-footer {
  padding: 20px 24px 12px;
  margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  color: #93c5fd;
}

.sidebar .sidebar-footer a { color: #47A5E3; text-decoration: none; }
.sidebar .sidebar-footer a:hover { text-decoration: underline; color: #fff; }

.content {
  margin-left: 260px;
  flex: 1;
  padding: 32px 48px 80px;
  max-width: 1100px;
}

/* ============ BREADCRUMB ============ */

.breadcrumb {
  font-size: 12px;
  color: #727279;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.breadcrumb a { color: #2B2E8C; text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { color: #47A5E3; text-decoration: underline; }
.breadcrumb span.sep { margin: 0 6px; color: #DADADC; }

/* ============ TYPOGRAPHY ============ */

h1 {
  font-size: 30px;
  color: #2B2E8C;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

h1 + .intro {
  font-size: 15px;
  color: #414141;
  margin-bottom: 32px;
  font-weight: 400;
}

h2 {
  font-size: 22px;
  color: #2B2E8C;
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #EDEEFC;
  font-weight: 700;
}

h2 .anchor {
  color: #DADADC;
  text-decoration: none;
  font-size: 16px;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

h2:hover .anchor { opacity: 1; }

h3 { font-size: 17px; color: #0F0F10; margin: 24px 0 10px; font-weight: 600; }
h4 { font-size: 14px; color: #414141; margin: 18px 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

p { margin-bottom: 12px; color: #0F0F10; }
strong { color: #2B2E8C; font-weight: 600; }
a { color: #2B2E8C; }
a:hover { color: #47A5E3; }

ul, ol { margin: 10px 0 14px 22px; }
li { margin-bottom: 6px; }

/* ============ INLINE CODE ============ */

code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  background: #EDEEFC;
  color: #2B2E8C;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.92em;
  border: 1px solid #d4d8f0;
}

/* ============ COLLAPSIBLE CODE BLOCKS ============ */

details.code-block {
  margin: 14px 0 22px;
  border: 1px solid #d4d8f0;
  border-radius: 8px;
  background: #fafbff;
  overflow: hidden;
}

details.code-block[open] { box-shadow: 0 2px 12px rgba(43, 46, 140, 0.1); }

details.code-block summary {
  padding: 12px 16px;
  cursor: pointer;
  background: #EDEEFC;
  font-size: 12px;
  color: #2B2E8C;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  user-select: none;
}

details.code-block summary::-webkit-details-marker { display: none; }

details.code-block summary::before {
  content: '▶';
  font-size: 10px;
  color: #2B2E8C;
  transition: transform 0.2s;
}

details.code-block[open] summary::before { transform: rotate(90deg); }

details.code-block summary .filepath {
  font-family: 'Consolas', monospace;
  background: #fff;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  color: #414141;
  border: 1px solid #DADADC;
}

details.code-block summary .lang-tag {
  background: #2B2E8C;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

details.code-block summary .line-ref { color: #727279; font-size: 11px; font-weight: 400; }

details.code-block summary .lang-tag.json { background: #47A5E3; }
details.code-block summary .lang-tag.bash { background: #414141; }
details.code-block summary .lang-tag.csharp { background: #06A64F; }
details.code-block summary .lang-tag.yaml { background: #008743; }
details.code-block summary .lang-tag.html { background: #CC101C; }

details.code-block pre {
  background: #0f1128;
  color: #e0e6ff;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.65;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

details.code-block pre code { background: transparent; border: none; color: inherit; padding: 0; font-size: inherit; }

/* Dart / C# syntax colors */
.kw { color: #8aa9ff; }     /* keywords */
.str { color: #8ee28e; }    /* strings */
.com { color: #6b7aa3; font-style: italic; } /* comments */
.fn { color: #47A5E3; }     /* function names */
.num { color: #ffa85c; }    /* numbers */
.typ { color: #ffd166; }    /* types */
.prop { color: #ff6b8a; }   /* properties */

/* ============ PATTERN / NOTE CARDS ============ */

.card {
  background: #fff;
  border-left: 4px solid #2B2E8C;
  padding: 14px 18px;
  margin: 14px 0;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 4px rgba(43,46,140,0.05);
}

.card.info { border-left-color: #47A5E3; background: #e8f4fd; }
.card.tip { border-left-color: #06A64F; background: #e8f5e9; }
.card.warn { border-left-color: #F59E0B; background: #fff3e0; }
.card.danger { border-left-color: #CC101C; background: #ffebee; }
.card.highlight { border-left-color: #2B2E8C; background: #EDEEFC; }

.card .card-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card.info .card-title { color: #0e6cbf; }
.card.tip .card-title { color: #06A64F; }
.card.warn .card-title { color: #c07300; }
.card.danger .card-title { color: #CC101C; }
.card.highlight .card-title { color: #2B2E8C; }

.card p { margin-bottom: 6px; }
.card p:last-child { margin-bottom: 0; }

/* ============ BACKEND XREF BOX ============ */

.xref-box {
  background: #EDEEFC;
  border: 1px dashed #2B2E8C;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 12px;
}

.xref-box .xref-label {
  font-size: 10px;
  font-weight: 700;
  color: #2B2E8C;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.xref-box ul { margin: 4px 0 0 0; list-style: none; }

.xref-box li {
  padding: 3px 0;
  margin: 0;
  font-family: 'Consolas', monospace;
  color: #414141;
}

.xref-box li::before { content: '↳ '; color: #2B2E8C; font-weight: 700; font-family: sans-serif; }
.xref-box a { color: #2B2E8C; text-decoration: none; font-weight: 600; }
.xref-box a:hover { text-decoration: underline; color: #47A5E3; }
.xref-box .pending { color: #727279; font-style: italic; font-size: 10px; margin-left: 4px; }

/* ============ TABLES ============ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(43,46,140,0.06);
}

th {
  background: #EDEEFC;
  color: #2B2E8C;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid #d4d8f0;
}

td { padding: 10px 12px; border-bottom: 1px solid #EDEDEE; vertical-align: top; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: none; }
td code { font-size: 11px; }

/* ============ FILE PATH CHIP ============ */

.filepath-chip {
  display: inline-block;
  background: #fff;
  border: 1px solid #DADADC;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: 'Consolas', monospace;
  font-size: 11px;
  color: #2B2E8C;
  text-decoration: none;
}

.filepath-chip:hover { background: #EDEEFC; }

/* ============ CARDS GRID (landing page) ============ */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0 40px;
}

.nav-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d4d8f0;
  box-shadow: 0 1px 4px rgba(43,46,140,0.05);
  transition: all 0.2s;
  display: block;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(43, 46, 140, 0.15);
  border-color: #2B2E8C;
}

.nav-card .nav-num {
  display: inline-block;
  background: linear-gradient(135deg, #2B2E8C, #47A5E3);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.nav-card h3 { font-size: 15px; color: #2B2E8C; margin: 4px 0 6px; font-weight: 700; border: none; padding: 0; }
.nav-card p { font-size: 12px; color: #414141; line-height: 1.5; margin: 0; }

/* ============ PAGINATION ============ */

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #EDEDEE;
  gap: 16px;
}

.pagination a {
  flex: 1;
  background: #fff;
  border: 1px solid #d4d8f0;
  border-radius: 8px;
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  transition: all 0.2s;
  max-width: 48%;
}

.pagination a:hover {
  border-color: #2B2E8C;
  box-shadow: 0 2px 8px rgba(43, 46, 140, 0.1);
}

.pagination a.next { text-align: right; margin-left: auto; }

.pagination .label { display: block; font-size: 10px; color: #727279; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.pagination .title { display: block; font-weight: 700; color: #2B2E8C; }

/* ============ HERO (landing page) ============ */

.hero {
  background: linear-gradient(135deg, #2B2E8C 0%, #47A5E3 100%);
  color: #fff;
  padding: 40px 44px;
  border-radius: 12px;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(43, 46, 140, 0.2);
  position: relative;
  overflow: hidden;
}

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

.hero h1 { color: #fff; font-size: 32px; margin-bottom: 8px; position: relative; }
.hero p { color: rgba(255,255,255,0.92); font-size: 16px; margin-bottom: 0; position: relative; }

.hero-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
}

.hero-logo-row .logo-badge {
  background: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.hero-logo-row .logo-badge img { height: 22px; }
.hero-logo-row .logo-badge .mosl-text { font-size: 10px; font-weight: 700; color: #2B2E8C; line-height: 1.1; }

/* ============ QUICK-START CALLOUT ============ */

.quick-start {
  background: #EDEEFC;
  border: 1px solid #47A5E3;
  border-left: 4px solid #47A5E3;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 13px;
  color: #2B2E8C;
}

.quick-start strong { color: #2B2E8C; }
.quick-start a { color: #2B2E8C; font-weight: 700; }

/* ============ MOBILE ============ */

@media (max-width: 900px) {
  .sidebar { width: 100%; position: static; padding: 16px 20px; }
  .content { margin-left: 0; padding: 20px; }
  .cards-grid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  h2 { font-size: 18px; }
  .pagination { flex-direction: column; }
  .pagination a { max-width: 100%; }
}
