/**
 * ═══════════════════════════════════════════════════════════════════════════
 * AMS PRO — COMMANDS PAGE STYLES
 * ═══════════════════════════════════════════════════════════════════════════
 * Modular CSS for commands system (ribbon, list view, documentation)
 * Bağımlılık: global.css (değişkenler, fontlar)
 *
 * TEMA: Ribbon + sol panel = DARK | Sağ panel + list view = LIGHT
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══ COMMANDS SECTION WRAPPER ═══ */
.commands-section {
  position: relative;
  z-index: 2;
}

/* ═══ VIEW TOGGLE BAR ═══ */
.view-toggle-bar {
  position: sticky;
  top: calc(var(--nav-h) + var(--subnav-h));
  z-index: 50;
  margin-top: calc(var(--nav-h) + var(--subnav-h));
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 10px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.view-toggle {
  display: inline-flex;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.view-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn.active {
  background: var(--blue);
  color: white;
}

.view-btn:hover:not(.active) {
  color: var(--text-primary);
}

.view-btn svg {
  width: 16px;
  height: 16px;
}

.search-box {
  position: relative;
  max-width: 280px;
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.25s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--blue);
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.cmd-stats {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   RIBBON VIEW — DARK THEME
   Civil 3D ribbon tarzı koyu arka plan
   ═══════════════════════════════════════════════════════════════════════════ */

.ribbon-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  position: sticky;
  top: calc(var(--nav-h) + var(--subnav-h));
  z-index: 40;
  overflow: visible;
}

.ribbon-strip {
  background: #2d3340;
  border: none;
  border-radius: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 4px;
  gap: 0;
  scrollbar-width: thin;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.ribbon-strip.grabbing {
  cursor: grabbing;
}

.ribbon-strip::-webkit-scrollbar {
  height: 5px;
}

.ribbon-strip::-webkit-scrollbar-thumb {
  background: #555e6e;
  border-radius: 3px;
}

.ribbon-strip::-webkit-scrollbar-track {
  background: #363d4a;
  border-radius: 3px;
}

.ribbon-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #3d4450;
  padding: 0 8px;
  min-width: 0;
  flex-shrink: 0;
  overflow: visible;
}

.ribbon-panel:last-child {
  border-right: none;
}

.ribbon-panel.panel-active {
  background: rgba(96,165,250,0.1);
  border-radius: 6px;
}

.ribbon-panel-content {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  flex: 1;
  padding: 6px 0;
}

.ribbon-panel-title {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 5px 8px 3px;
  border-top: 1px solid #3d4450;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-body);
}


/* ═══ RIBBON BUTTONS — DARK ═══ */

/* Large Button */
.rb-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 60px;
  gap: 3px;
  position: relative;
  border: 1px solid transparent;
}

.rb-large:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

.rb-large.active {
  background: rgba(96,165,250,0.15);
  border-color: rgba(96,165,250,0.35);
  box-shadow: 0 1px 6px rgba(96,165,250,0.2);
}

.rb-large .rb-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.rb-large .rb-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-align: center;
  line-height: 1.3;
  max-width: 68px;
  word-break: break-word;
  font-family: var(--font-body);
}

.rb-split-arrow {
  font-size: 7px;
  color: rgba(255,255,255,0.4);
  margin-top: 0;
  cursor: pointer;
}

.rb-large.not-ready,
.rb-small.not-ready {
  opacity: 0.35;
}

/* Small Button */
.rb-small {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.rb-small:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

.rb-small.active {
  background: rgba(96,165,250,0.15);
  border-color: rgba(96,165,250,0.35);
  box-shadow: 0 1px 6px rgba(96,165,250,0.2);
}

.rb-small .rb-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.rb-small .rb-label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-body);
}

/* Row Panel */
.rb-row-panel {
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}


/* ═══ RIBBON DROPDOWN — DARK ═══ */

.rb-dropdown {
  position: fixed;
  background: transparent;
  padding: 0;
  min-width: 240px;
  z-index: 9999;
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.rb-dropdown.open {
  display: block;
  pointer-events: auto;
  opacity: 1;
}

.rb-dropdown-inner {
  background: #1e2433;
  border: 1px solid #2d3748;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  padding: 6px;
  overflow-y: auto;
}

.rb-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-body);
}

.rb-dropdown-item:hover {
  background: rgba(96,165,250,0.15);
  color: #fff;
}

.rb-dropdown-item.active {
  background: rgba(96,165,250,0.2);
  color: #60a5fa;
}

.rb-dropdown-item .dd-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

.rb-dropdown-item.not-ready {
  opacity: 0.35;
}

.rb-dropdown-item.ams-cmd {
  color: #60a5fa;
  font-weight: 600;
}

.rb-dropdown-sep {
  height: 1px;
  background: #2d3748;
  margin: 4px 8px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   RIBBON SPLIT PANE — Sol DARK sidebar + Sağ LIGHT doc panel
   ═══════════════════════════════════════════════════════════════════════════ */

.ribbon-split-pane {
  max-width: 1680px;
  margin: 24px auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: calc(100vh - 240px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ═══ Sol Panel — DARK ═══ */
.ribbon-cmd-sidebar {
  border-right: 1px solid var(--border);
  padding: 0;
  border-radius: 12px 0 0 12px;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  background: #0a0e1a;
}

.ribbon-cmd-sidebar .sidebar-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 14px 16px 6px;
  font-family: var(--font-mono);
}

.ribbon-cmd-sidebar .sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 2px 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 6px;
  border-left: 3px solid transparent;
  background: #1a2540;
}

.ribbon-cmd-sidebar .sidebar-link:hover {
  color: rgba(255,255,255,0.9);
  background: #243050;
}

.ribbon-cmd-sidebar .sidebar-link.active {
  color: #60a5fa;
  border-left-color: #60a5fa;
  background: #1a3060;
  font-weight: 600;
}

.ribbon-cmd-sidebar .sidebar-link .cmd-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  color: rgba(255,255,255,0.4);
}

.ribbon-cmd-sidebar .sidebar-link.not-ready {
  opacity: 0.35;
}

/* Tree group — indent + sol çizgi */
.ribbon-cmd-sidebar .sidebar-tree-group {
  margin: 0 10px 4px;
  padding: 4px 0 4px 12px;
  border-left: 2px solid rgba(255,255,255,0.1);
}

.ribbon-cmd-sidebar .sidebar-tree-group .sidebar-link {
  padding: 6px 12px;
  font-size: 12.5px;
  position: relative;
}

.ribbon-cmd-sidebar .sidebar-tree-group .sidebar-link::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(255,255,255,0.18);
}

.ribbon-cmd-sidebar .sidebar-tree-group .sidebar-link.active::before {
  background: #60a5fa;
}

/* Sidebar search */
.ribbon-cmd-sidebar .sidebar-search-box {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 10px;
  margin: 10px 10px 8px;
  background: #ffffff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ribbon-cmd-sidebar .sidebar-search-box svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #94a3b8;
}

.ribbon-cmd-sidebar .sidebar-search-box input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 12px;
  color: #1e293b;
  outline: none;
}

.ribbon-cmd-sidebar .sidebar-search-box input::placeholder {
  color: #94a3b8;
}

/* Sidebar panel header */
.ribbon-cmd-sidebar .sidebar-panel-header {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  padding: 14px 16px 10px;
  font-family: var(--font-mono);
}

/* Collapsible groups — card style */
.ribbon-cmd-sidebar .sidebar-group-title.collapsible {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 10px;
  padding: 9px 12px;
  background: #243d70;
  border: 1px solid #345599;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-mono);
}

.ribbon-cmd-sidebar .sidebar-group-title.collapsible:hover {
  color: rgba(255,255,255,0.95);
  border-color: #4070c0;
  background: #2f5cb0;
}

.ribbon-cmd-sidebar .group-arrow {
  font-size: 11px;
  transition: transform 0.2s;
  display: inline-block;
  width: 14px;
  text-align: center;
  opacity: 0.4;
  color: rgba(255,255,255,0.5);
}

.ribbon-cmd-sidebar .group-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  padding: 1px 7px;
  border-radius: 10px;
}

.ribbon-cmd-sidebar .sidebar-group-title.collapsed .group-arrow {
  transform: rotate(-90deg);
}

.ribbon-cmd-sidebar .sidebar-tree-group.collapsed {
  display: none;
}

/* ═══ Sağ Panel — LIGHT ═══ */
.ribbon-doc-panel {
  padding: 32px 40px;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LIST VIEW — LIGHT THEME
   ═══════════════════════════════════════════════════════════════════════════ */

.list-container {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding: 24px 40px 80px;
}

.list-sidebar {
  position: sticky;
  top: 184px;
  align-self: start;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 16px 12px 6px;
  font-family: var(--font-mono);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  border-radius: 0 4px 4px 0;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(37,99,235,0.04);
}

.sidebar-link.active {
  color: var(--blue);
  border-left-color: var(--blue);
  background: rgba(37,99,235,0.06);
  font-weight: 600;
}

.sidebar-link .cmd-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--bg-section);
  border-radius: 3px;
  color: var(--text-dim);
}

.sidebar-link.not-ready {
  opacity: 0.5;
}


/* ═══════════════════════════════════════════════════════════════════════════
   DOC CONTENT + COMMAND DETAIL — LIGHT
   ═══════════════════════════════════════════════════════════════════════════ */

.doc-content {
  min-height: 400px;
}

.doc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
}

.doc-empty .empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.25;
}

.doc-empty h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.doc-empty p {
  font-size: 12px;
  font-weight: 300;
  max-width: 320px;
}

/* Command Detail */
.cmd-detail {
  animation: fadeInUp 0.3s ease;
}

.cmd-detail .cmd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 5px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.cmd-detail .cmd-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.cmd-detail h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.cmd-detail .cmd-summary {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 32px;
}

.cmd-detail .cmd-panel-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-section);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

/* Steps */
.cmd-detail .steps-block {
  margin-bottom: 32px;
}

.cmd-detail .steps-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-detail .steps-label::before {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--blue);
}

.cmd-detail .step-list {
  list-style: none;
  counter-reset: cmdstep;
  padding: 0;
  margin: 0;
}

.cmd-detail .step-item {
  counter-increment: cmdstep;
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.7;
}

.cmd-detail .step-item:last-child {
  border-bottom: none;
}

.cmd-detail .step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 8px;
  border: none;
  margin: 0;
}

.cmd-detail .step-num::before {
  content: counter(cmdstep);
}

.cmd-detail .step-text code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Variations */
.cmd-detail .variations {
  margin-top: 28px;
}

.cmd-detail .variations-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-detail .variations-title::before {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--amber);
}

.cmd-detail .variation-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.cmd-detail .variation-card:hover {
  border-color: #cbd5e1;
}

.cmd-detail .variation-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.cmd-detail .variation-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Coming soon */
.cmd-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

.cmd-coming-soon .cs-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--blue-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.cmd-coming-soon h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.cmd-coming-soon p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .ribbon-split-pane {
    grid-template-columns: 1fr;
  }
  .ribbon-cmd-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
  }
  .list-container {
    grid-template-columns: 1fr;
    padding: 16px 20px 60px;
  }
  .list-sidebar {
    position: static;
    max-height: none;
  }
  .view-toggle-bar {
    padding: 8px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .ribbon-strip {
    display: none;
  }
  .view-btn[data-view="ribbon"] {
    display: none;
  }
  .view-btn[data-view="list"] {
    pointer-events: none;
  }
}
