/**
 * ═══════════════════════════════════════════════════════════════════════════
 * AMS PRO — COMMANDS PAGE STYLES
 * ═══════════════════════════════════════════════════════════════════════════
 * Modular CSS for commands system (ribbon, list view, documentation)
 * Bağımlılık: global.css (değişkenler, fontlar)
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══ 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;
  background: rgba(244, 246, 250, 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 ═══ */
.ribbon-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 40px;
}

.ribbon-strip {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  display: flex;
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px 8px;
  gap: 0;
  scrollbar-width: thin;
}

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

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

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

.ribbon-panel {
  display: flex;
  flex-direction: column;
  border-right: 2px solid var(--border);
  padding: 0 10px;
  min-width: 0;
  flex-shrink: 0;
  overflow: visible;
}

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

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

.ribbon-panel-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  padding: 6px 8px 4px;
  border-top: 2px solid var(--border);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-body);
}

/* ═══ RIBBON BUTTONS ═══ */
.rb-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 68px;
  gap: 4px;
  position: relative;
  border: 2px solid transparent;
}

.rb-large:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.rb-large.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

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

.rb-large .rb-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.3;
  max-width: 72px;
  word-break: break-word;
  font-family: var(--font-body);
}

.rb-split-arrow {
  font-size: 8px;
  color: var(--text-secondary);
  margin-top: 0;
  cursor: pointer;
}

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

/* Small Button */
.rb-small {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  white-space: nowrap;
}

.rb-small:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.rb-small.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

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

.rb-small .rb-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-body);
}

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

/* ═══ DROPDOWN ═══ */
.rb-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 240px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.rb-dropdown.open {
  display: block;
}

.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: var(--text-primary);
  font-family: var(--font-body);
}

.rb-dropdown-item:hover {
  background: var(--blue-soft);
}

.rb-dropdown-item.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.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.45;
}

.rb-dropdown-item.ams-cmd {
  color: var(--blue);
  font-weight: 600;
}

.rb-dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

/* ═══ LIST VIEW ═══ */
.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: calc(var(--nav-h) + var(--subnav-h) + 60px);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - var(--subnav-h) - 80px);
  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 ═══ */
.doc-content {
  min-height: 400px;
}

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

.doc-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.doc-empty h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.doc-empty p {
  font-size: 14px;
  font-weight: 400;
  max-width: 400px;
}

/* ═══ 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-family: var(--font-display);
  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-family: var(--font-display);
  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 var(--bg-section);
  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: var(--bg-section);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 4px;
}

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

.cmd-detail .variations-title {
  font-family: var(--font-display);
  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: var(--border-soft);
}

.cmd-detail .variation-card h4 {
  font-family: var(--font-display);
  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-family: var(--font-display);
  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: 400;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .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;
  }

  .commands-hero {
    padding: 40px 20px 24px;
  }
}

@media (max-width: 768px) {
  .ribbon-strip {
    display: none;
  }

  .view-btn[data-view="ribbon"] {
    display: none;
  }

  .view-btn[data-view="list"] {
    pointer-events: none;
  }

  .view-toggle-bar {
    top: calc(var(--nav-h) + var(--subnav-h));
  }
}
