/* ==========================================================================
   COLMEIA - DESIGN SYSTEM DOCUMENTATION STYLESHEET
   Hive UI System v1.0
   ========================================================================== */

/* Layout & Structure */
.ds-body {
  background-color: #070709;
  color: #F1F5F9;
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.ds-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 9, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 76px;
}

.ds-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 32px;
  max-width: 1600px;
  margin: 0 auto;
}

.ds-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ds-logo-link {
  display: flex;
  align-items: center;
}

.ds-logo-img {
  height: 38px;
  width: auto;
}

.ds-badge-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 184, 0, 0.12);
  border: 1px solid rgba(255, 184, 0, 0.3);
  color: var(--color-yellow);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ds-pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 8px #22C55E;
  animation: dsPulse 2s infinite;
}

@keyframes dsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

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

.ds-search-wrapper {
  position: relative;
  width: 260px;
}

.ds-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  padding: 8px 14px 8px 36px;
  border-radius: 9999px;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}

.ds-search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-yellow);
  box-shadow: 0 0 12px rgba(255, 184, 0, 0.2);
}

.ds-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748B;
  pointer-events: none;
}

.ds-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.ds-back-btn:hover {
  background: var(--color-yellow);
  color: #000000;
  border-color: var(--color-yellow);
  transform: translateX(-2px);
}

/* Layout Grid: Sidebar + Content */
.ds-layout-wrapper {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* Sticky Sidebar */
.ds-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  overflow-y: auto;
  padding: 32px 20px 48px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 184, 0, 0.2) transparent;
}

.ds-sidebar::-webkit-scrollbar {
  width: 5px;
}

.ds-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 184, 0, 0.2);
  border-radius: 4px;
}

.ds-nav-group-title {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748B;
  margin: 20px 0 10px 12px;
}

.ds-nav-group-title:first-child {
  margin-top: 0;
}

.ds-sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ds-nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #94A3B8;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
}

.ds-nav-item a:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.04);
}

.ds-nav-item a.active {
  color: var(--color-yellow);
  background: rgba(255, 184, 0, 0.08);
  font-weight: 700;
}

.ds-nav-item a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--color-yellow);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--color-yellow);
}

.ds-nav-icon {
  font-size: 1rem;
  display: flex;
  align-items: center;
}

/* Main Content Area */
.ds-main-content {
  flex: 1;
  padding: 40px 48px 120px;
  max-width: 1280px;
  overflow-x: hidden;
}

/* Section Header */
.ds-section {
  margin-bottom: 72px;
  scroll-margin-top: 100px;
}

.ds-section-intro {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 24px;
  margin-bottom: 36px;
}

.ds-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-yellow);
  margin-bottom: 8px;
}

.ds-section-heading {
  font-size: 2rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.ds-section-desc {
  font-size: 1rem;
  color: #94A3B8;
  line-height: 1.6;
  max-width: 800px;
}

/* Hero / Overview Banner */
.ds-hero-banner {
  background: radial-gradient(circle at top right, rgba(255, 184, 0, 0.12), transparent 60%),
              linear-gradient(135deg, #111116 0%, #070709 100%);
  border: 1px solid rgba(255, 184, 0, 0.2);
  border-radius: 20px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  margin-bottom: 48px;
}

.ds-hero-banner::after {
  content: '';
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255, 184, 0, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.ds-principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.ds-principle-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px;
  border-radius: 14px;
  transition: all 0.25s ease;
}

.ds-principle-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 184, 0, 0.3);
  transform: translateY(-2px);
}

.ds-principle-icon {
  font-size: 1.75rem;
  margin-bottom: 12px;
  display: block;
}

.ds-principle-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.ds-principle-text {
  font-size: 0.875rem;
  color: #94A3B8;
  line-height: 1.5;
}

/* Subsection & Card Layouts */
.ds-subsection {
  margin-bottom: 40px;
}

.ds-subsection-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds-subsection-title span.count-badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 9999px;
  color: #94A3B8;
  font-weight: 600;
}

/* Color Swatches Grid */
.ds-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.ds-color-card {
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.ds-color-card:hover {
  border-color: var(--color-yellow);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.ds-color-preview {
  height: 90px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px;
}

.ds-color-copy-hint {
  background: rgba(0, 0, 0, 0.7);
  color: #FFFFFF;
  font-size: 0.6875rem;
  padding: 3px 8px;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s ease;
  font-weight: 600;
}

.ds-color-card:hover .ds-color-copy-hint {
  opacity: 1;
  transform: translateY(0);
}

.ds-color-info {
  padding: 14px;
}

.ds-color-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.ds-color-hex {
  font-size: 0.8125rem;
  font-family: monospace;
  color: var(--color-yellow);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ds-color-var {
  font-size: 0.6875rem;
  font-family: monospace;
  color: #64748B;
  word-break: break-all;
}

/* Typography Scale Table */
.ds-type-table {
  width: 100%;
  border-collapse: collapse;
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.ds-type-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ds-type-table td {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

.ds-type-tag {
  font-family: monospace;
  color: var(--color-yellow);
  font-size: 0.8125rem;
  background: rgba(255, 184, 0, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.ds-type-specs {
  font-size: 0.75rem;
  color: #64748B;
  font-family: monospace;
}

/* Interactive Font Tester */
.ds-font-tester {
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  margin-top: 24px;
}

.ds-font-tester-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ds-font-input {
  flex: 1;
  min-width: 250px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9375rem;
  outline: none;
}

.ds-font-input:focus {
  border-color: var(--color-yellow);
}

.ds-size-slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94A3B8;
  font-size: 0.875rem;
}

.ds-size-slider {
  accent-color: var(--color-yellow);
  cursor: pointer;
}

.ds-font-preview-area {
  min-height: 100px;
  display: flex;
  align-items: center;
  color: #FFFFFF;
  word-break: break-word;
  line-height: 1.2;
}

/* Component Showcase Box */
.ds-component-box {
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
}

.ds-component-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.ds-component-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.ds-component-info p {
  font-size: 0.8125rem;
  color: #94A3B8;
  margin-top: 2px;
}

.ds-component-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ds-tab-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.ds-tab-btn.active {
  color: var(--color-yellow);
  background: rgba(255, 184, 0, 0.1);
}

.ds-copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F1F5F9;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ds-copy-code-btn:hover {
  background: var(--color-yellow);
  color: #000000;
  border-color: var(--color-yellow);
}

.ds-preview-canvas {
  padding: 36px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #070709;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 0);
  background-size: 20px 20px;
  min-height: 120px;
}

.ds-preview-canvas.light-bg {
  background: #F8FAFC;
  background-image: radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 0);
  background-size: 20px 20px;
}

.ds-preview-canvas.column {
  flex-direction: column;
  align-items: stretch;
}

.ds-code-view {
  display: none;
  background: #0B0B0E;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.ds-code-view.active {
  display: block;
}

.ds-code-view pre {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.8125rem;
  color: #E2E8F0;
  line-height: 1.6;
}

/* Token Spacing Scale */
.ds-spacing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.ds-spacing-card {
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ds-spacing-visual {
  height: 24px;
  background: rgba(255, 184, 0, 0.3);
  border: 1px solid var(--color-yellow);
  border-radius: 4px;
  flex-shrink: 0;
}

/* Radius Box Visualizer */
.ds-radius-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.ds-radius-card {
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.ds-radius-preview {
  width: 70px;
  height: 70px;
  background: rgba(255, 184, 0, 0.15);
  border: 2px solid var(--color-yellow);
  margin: 0 auto 16px;
}

/* Shadows Visualizer */
.ds-shadows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.ds-shadow-card {
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
}

.ds-shadow-preview {
  width: 80px;
  height: 80px;
  background: #1A1A22;
  border-radius: 12px;
  margin: 0 auto 16px;
}

/* Icons Showcase */
.ds-icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.ds-icon-card {
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ds-icon-card:hover {
  border-color: var(--color-yellow);
  background: rgba(255, 184, 0, 0.05);
  transform: translateY(-2px);
}

.ds-icon-card svg {
  color: var(--color-yellow);
  width: 24px;
  height: 24px;
}

.ds-icon-name {
  font-size: 0.75rem;
  color: #94A3B8;
  font-family: monospace;
}

/* Toast Notifications */
.ds-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: #111116;
  border: 1px solid var(--color-yellow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 184, 0, 0.3);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ds-toast-icon {
  color: var(--color-yellow);
  font-size: 1.1rem;
}

/* Media & Assets Showcase */
.ds-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.ds-media-card {
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.ds-media-card:hover {
  border-color: var(--color-yellow);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.ds-media-preview {
  height: 180px;
  background: #0B0B0E;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 16px 16px;
}

.ds-media-preview.light {
  background: #FFFFFF;
  background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 0);
}

.ds-media-img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.ds-media-card:hover .ds-media-img {
  transform: scale(1.05);
}

.ds-media-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #111116;
  flex: 1;
}

.ds-media-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #FFFFFF;
}

.ds-media-desc {
  font-size: 0.8125rem;
  color: #94A3B8;
  line-height: 1.4;
}

.ds-media-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ds-media-path {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--color-yellow);
  cursor: pointer;
  background: rgba(255, 184, 0, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

.ds-media-path:hover {
  background: rgba(255, 184, 0, 0.2);
}

.ds-avatars-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.ds-avatar-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ds-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--color-yellow);
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(255, 184, 0, 0.2);
}

.ds-cases-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
}

/* Mobile Responsive */
@media (max-width: 991px) {
  .ds-sidebar {
    display: none;
  }

  .ds-main-content {
    padding: 24px 20px 80px;
  }

  .ds-header-container {
    padding: 0 16px;
  }

  .ds-search-wrapper {
    display: none;
  }

  .ds-hero-banner {
    padding: 24px;
  }
}
