:root {
  --primary-color: #FF9900;
  --primary-rgb: 255, 153, 0;
  --primary-light: rgba(255, 153, 0, 0.15);
  --bg-main: #0B0F17;
  --bg-sidebar: #0F172A;
  --bg-card: #1E293B;
  --bg-card-hover: #273549;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 153, 0, 0.4);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* Base resets & typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Top Navigation Bar */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cloud-menu-tabs {
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.6);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.cloud-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cloud-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.cloud-tab-btn.active {
  color: #fff;
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.cloud-tab-btn.active.tab-aws {
  border-bottom: 2px solid #FF9900;
  color: #FFB340;
}
.cloud-tab-btn.active.tab-gcp {
  border-bottom: 2px solid #4285F4;
  color: #70A5F9;
}
.cloud-tab-btn.active.tab-azure {
  border-bottom: 2px solid #0078D4;
  color: #40A4FF;
}
.cloud-tab-btn.active.tab-oci {
  border-bottom: 2px solid #C74634;
  color: #F17564;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-input {
  width: 100%;
  background: #1E293B;
  border: 1px solid var(--border-color);
  padding: 7px 12px 7px 34px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary-color);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Main Container Layout */
.main-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 64px);
}

/* Sidebar */
.sidebar {
  width: 320px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.25rem 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sidebar-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.section-group {
  margin-bottom: 1.25rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s ease;
  margin-bottom: 3px;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.topic-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.topic-item.active {
  background: var(--bg-card);
  color: #fff;
  border-left-color: var(--primary-color);
  font-weight: 600;
}

.topic-check {
  font-size: 0.8rem;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.2s;
}

.topic-check.completed {
  opacity: 1;
  color: #10B981;
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  overflow-y: auto;
}

.topic-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.topic-level {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}

.topic-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: #1E293B;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: all 0.2s;
  margin-left: auto;
}

.topic-status-btn.done {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10B981;
}

.topic-main-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.topic-summary {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Tab Navigation for Content */
.content-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.75rem;
}

.c-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.c-tab:hover {
  color: #fff;
}

.c-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Rich Content Styling */
.markdown-body {
  font-size: 1rem;
  color: #CBD5E1;
}

.markdown-body h3 {
  font-size: 1.3rem;
  color: #fff;
  margin: 1.5rem 0 0.75rem;
}

.markdown-body p {
  margin-bottom: 1rem;
}

.markdown-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.markdown-body li {
  margin-bottom: 0.4rem;
}

.markdown-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #F8FAFC;
}

/* Markdown Tables */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.markdown-body th, .markdown-body td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  text-align: left;
  font-size: 0.9rem;
}

.markdown-body th {
  background: #0F172A;
  color: #fff;
  font-weight: 600;
}

/* Interactive Diagrams */
.diagram-box {
  background: #0B1120;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.diagram-region, .diagram-vpc {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 1.25rem;
  position: relative;
}

.diagram-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.diagram-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.diagram-az, .diagram-sub {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

.diagram-sub.public {
  border-left: 3px solid #10B981;
}

.diagram-sub.private {
  border-left: 3px solid #EF4444;
}

.az-header, .sub-header {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.az-content {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 4px;
  margin-right: 4px;
}

.igw-bar {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #1E293B;
  border-radius: 6px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

/* CLI Code blocks */
.cli-block {
  background: #0F172A;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.cli-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #1E293B;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
}

.copy-btn:hover {
  color: #fff;
}

.cli-code {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #38BDF8;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Exam tips & Alerts */
.tip-card {
  background: rgba(30, 41, 59, 0.6);
  border-left: 4px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

/* Personal Notes Area */
.notes-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
}

.notes-textarea {
  width: 100%;
  min-height: 140px;
  background: #0F172A;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.notes-textarea:focus {
  border-color: var(--primary-color);
}

.notes-save-btn {
  background: var(--primary-color);
  color: #000;
  font-weight: 700;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

/* Flow Nodes */
.flow-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.flow-node {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.85rem;
}

.flow-arrow {
  color: var(--text-dim);
  font-size: 1.2rem;
}

.pricing-grid, .iam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.p-card, .iam-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.p-card.highlight {
  border-color: var(--primary-color);
}

.p-price {
  display: block;
  margin-top: 0.5rem;
  font-weight: 700;
  color: #10B981;
  font-size: 0.85rem;
}

/* Mobile Toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    height: calc(100vh - 64px);
    z-index: 40;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .content-area {
    padding: 1.5rem;
  }
  .search-box {
    display: none;
  }
}
