@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Color Palette - Dark Sleek Tech */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-hover: rgba(30, 41, 59, 0.7);
  --bg-input: #1e293b;
  --border-color: rgba(51, 65, 85, 0.6);
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #2563eb;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --glass-bg: rgba(17, 24, 39, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --sidebar-width: 290px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-hover: rgba(241, 245, 249, 0.9);
  --bg-input: #f1f5f9;
  --border-color: rgba(226, 232, 240, 0.9);
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 25px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.12);
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Background Ambient Glow */
.ambient-glow {
  position: fixed;
  top: -150px;
  right: -150px;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(99, 102, 241, 0.05) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header & Top Navigation */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .brand-title {
  background: linear-gradient(90deg, #0f172a, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-badge {
  font-size: 11px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.header-search {
  position: relative;
  width: 380px;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 8px 40px 8px 14px;
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.license-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Layout Grid */
.app-container {
  display: flex;
  min-height: calc(100vh - 64px);
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 20px 14px;
  overflow-y: auto;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  flex-shrink: 0;
}

.sidebar-category {
  margin-bottom: 24px;
}

.category-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.18), rgba(56, 189, 248, 0.05));
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
  font-weight: 600;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-weight: 600;
}

.nav-badge.new {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 36px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: var(--text-dim);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--accent-cyan); }

/* Control Header View */
.control-hero {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.control-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.control-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.control-package-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

.control-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 850px;
  line-height: 1.6;
}

/* Tab Navigation (User Showcase vs Developer Guide vs API Reference) */
.view-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}

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

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* Tab Contents */
.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in;
}
.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Containers */
.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.doc-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Code Blocks */
.code-container {
  position: relative;
  background: #070a13;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 16px 0;
  overflow: hidden;
}

.code-header {
  background: #0f1523;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.copy-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.lang-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.lang-tab-btn.active {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
}

/* API Tables (Properties, Methods, Events, Commands) */
.api-table-wrapper {
  overflow-x: auto;
  margin: 16px 0 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.api-table th {
  background: var(--bg-hover);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.api-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.api-table tr:last-child td {
  border-bottom: none;
}

.api-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.api-name {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-weight: 600;
}

.api-type {
  font-family: var(--font-mono);
  color: var(--accent-purple);
  font-size: 12.5px;
}

.api-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Interactive Preview Playground */
.demo-stage {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 16px 0;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.25);
  position: relative;
}

.demo-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.demo-controls-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.demo-btn.secondary {
  background: var(--bg-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.demo-btn.secondary:hover {
  border-color: var(--accent-cyan);
}

/* Home Overview Grid */
.home-hero {
  text-align: center;
  padding: 48px 0 36px 0;
}

.home-headline {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-subhead {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 30px auto;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin: 36px 0;
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.controls-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin: 36px 0;
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.control-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
}

.card-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Quick toast alerts */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid var(--accent-emerald);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .header-search { display: none; }
  .main-content { padding: 24px 16px; }
  .stats-bar { flex-direction: column; gap: 16px; }
}

/* Microsoft Word Ribbon Styles */
.word-ribbon-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}
.word-ribbon-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.word-ribbon-tab.active {
  background: #1e293b;
  color: #38bdf8;
  font-weight: 700;
  border-top: 2px solid #38bdf8;
}

.word-toolgroup {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #334155;
  padding-right: 10px;
  margin-right: 2px;
}
.word-toolgroup:last-child {
  border-right: none;
}
.word-toolgroup-title {
  text-align: center;
  font-size: 9.5px;
  color: #64748b;
  margin-top: 6px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  font-weight: 600;
}

.word-toolbtn {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.1s ease;
}
.word-toolbtn:hover {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}
.word-toolbtn.large {
  flex-direction: column;
  height: 52px;
  padding: 4px 10px;
  min-width: 48px;
}
.word-toolbtn.small {
  height: 16px;
  font-size: 10px;
  padding: 1px 6px;
}

.word-style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  min-width: 65px;
  height: 48px;
  transition: all 0.15s ease;
}
.word-style-card:hover {
  border-color: #38bdf8;
  background: #1e293b;
  transform: translateY(-1px);
}

