.style-guide {
  width: 100%;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
}

/* Header */
.sg-header {
  background: linear-gradient(135deg, rgba(7, 27, 58, 0.8) 0%, rgba(11, 39, 82, 0.6) 100%);
  border-bottom: 1px solid var(--app-border-color);
  padding: 60px 0;
  margin-bottom: 40px;

  .sg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
  }
}

.sg-title {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--app-text);
  letter-spacing: -0.5px;
}

.sg-subtitle {
  font-size: 16px;
  color: var(--app-text-muted);
  margin: 0;
  font-weight: 400;
}

/* Container */
.sg-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px 24px;
}

/* Section Structure */
.sg-section {
  margin-bottom: 60px;

  &.sg-footer {
    margin-bottom: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--app-divider);
  }
}

.sg-section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--app-text);
  margin: 0 0 32px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--app-accent-primary);
  display: inline-block;
}

.sg-subsection {
  margin-bottom: 40px;
}

.sg-subsection-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--app-accent-primary);
  margin: 0 0 20px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Color Palette - Display Specific */
.sg-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.sg-color-card {
  background: var(--app-bg-elevated);
  border: 1px solid var(--app-border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;

  &:hover {
    border-color: var(--app-border-color-active);
    box-shadow: 0 4px 16px rgba(2, 10, 26, 0.4);
  }
}

.sg-color-swatch {
  width: 100%;
  height: 140px;
  border-bottom: 1px solid var(--app-divider);
}

.sg-color-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sg-color-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--app-text);
}

.sg-color-code,
.sg-color-var {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--app-text-code);
  background: rgba(255, 215, 0, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
}

.sg-color-var {
  color: var(--app-accent-primary);
  background: rgba(142, 180, 255, 0.08);
}

/* Typography Display Grid */
.sg-typography-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sg-type-item {
  background: var(--app-bg-elevated);
  border-left: 3px solid var(--app-accent-primary);
  padding: 24px;
  border-radius: 4px;
}

/* Demo Grid & Sections */
.sg-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.sg-demo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--app-bg-elevated);
  border: 1px solid var(--app-border-color);
  border-radius: 8px;
}

.sg-demo-label {
  font-size: 12px;
  color: var(--app-text-muted);
  text-align: center;
}

.sg-demo-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  background: var(--app-bg-elevated);
  border: 1px solid var(--app-border-color);
  border-radius: 8px;
}

.sg-demo-block {
  padding: 20px;
  background: var(--app-bg-elevated);
  border-left: 3px solid var(--app-accent-primary);
  border-radius: 4px;

  p {
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.6;

    &:first-child {
      margin-top: 0;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }
}

/* Cards Display */
.sg-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.sg-card {
  border-radius: 8px;
  transition: all 0.2s ease;
  overflow: hidden;

  &:hover {
    box-shadow: 0 8px 24px rgba(2, 10, 26, 0.4);
  }
}

.sg-card-default {
  background: rgba(11, 39, 82, 0.5);
  border: 1px solid var(--app-border-color);
}

.sg-card-elevated {
  background: linear-gradient(135deg, rgba(11, 39, 82, 0.7) 0%, rgba(15, 48, 95, 0.5) 100%);
  border: 1px solid var(--app-border-color-active);
  box-shadow: 0 4px 16px rgba(2, 10, 26, 0.3);
}

.sg-card-accent {
  background: rgba(11, 39, 82, 0.5);
  border: 2px solid var(--app-accent-primary);
}

.sg-card-header {
  padding: 16px;
  border-bottom: 1px solid var(--app-divider);

  h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--app-text);
  }
}

.sg-card-body {
  padding: 16px;

  p {
    margin: 0;
    font-size: 14px;
    color: var(--app-text-muted);
    line-height: 1.6;
  }
}

/* Form Display Grid */
.sg-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.sg-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Spacing & Effects Display */
.sg-spacing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
}

.sg-spacing-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  span {
    font-size: 12px;
    color: var(--app-text-muted);
    font-family: 'Courier New', monospace;
  }
}

.sg-spacing-box {
  width: 100%;
  background: linear-gradient(135deg, var(--app-accent-primary) 0%, var(--app-accent-blue) 100%);
  border-radius: 4px;
}

.sg-effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
}

.sg-effect-box {
  padding: 40px 20px;
  background: var(--app-bg-elevated);
  border: 1px solid var(--app-border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--app-text-muted);
}

.sg-shadow-box {
  padding: 40px 20px;
  background: var(--app-bg-elevated);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--app-text);
}

.sg-shadow-sm {
  box-shadow: 0 2px 8px rgba(2, 10, 26, 0.15);
}

.sg-shadow-md {
  box-shadow: 0 4px 16px rgba(2, 10, 26, 0.3);
}

.sg-shadow-lg {
  box-shadow: 0 8px 32px rgba(2, 10, 26, 0.5);
}

/* Footer */
.sg-footer-text {
  font-size: 14px;
  color: var(--app-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
  .sg-container {
    padding: 0 16px 40px 16px;
  }

  .sg-title {
    font-size: 28px;
  }

  .sg-section-title {
    font-size: 24px;
  }

  .sg-color-grid,
  .sg-demo-grid,
  .sg-card-grid,
  .sg-form-grid,
  .sg-spacing-grid,
  .sg-effects-grid {
    grid-template-columns: 1fr;
  }

  .sg-type-h1 {
    font-size: 24px;
  }

  .sg-type-h2 {
    font-size: 20px;
  }
}
