/**
 * UpdraftDocs Custom Styles
 * CloudFormation Resource Documentation
 */

/* ===== Color Palette ===== */
:root {
  /* Cost Risk Colors */
  --cost-free: #28a745;
  --cost-low: #17a2b8;
  --cost-medium: #ffc107;
  --cost-high: #dc3545;

  /* Complexity Colors */
  --complexity-basic: #28a745;
  --complexity-demo: #ffc107;
  --complexity-advanced: #dc3545;

  /* Brand Colors */
  --updraft-primary: #0066cc;
  --updraft-secondary: #6c757d;
  --updraft-accent: #17a2b8;

  /* CloudFormation Resource Types */
  --aws-compute: #ff9900;
  --aws-storage: #569a31;
  --aws-database: #3b48cc;
  --aws-networking: #232f3e;
}

/* ===== Cost Risk Badges ===== */
.cost-risk-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.cost-risk-free {
  background-color: var(--cost-free);
}

.cost-risk-low {
  background-color: var(--cost-low);
}

.cost-risk-medium {
  background-color: var(--cost-medium);
  color: #000;
}

.cost-risk-high {
  background-color: var(--cost-high);
}

.cost-risk-indicator {
  padding: 1rem;
  margin: 1rem 0;
  border-left: 4px solid;
  background-color: rgba(0, 0, 0, 0.05);
}

.cost-risk-indicator.cost-risk-free {
  border-color: var(--cost-free);
}

.cost-risk-indicator.cost-risk-low {
  border-color: var(--cost-low);
}

.cost-risk-indicator.cost-risk-medium {
  border-color: var(--cost-medium);
}

.cost-risk-indicator.cost-risk-high {
  border-color: var(--cost-high);
}

/* ===== Complexity Badges ===== */
.complexity-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  text-transform: capitalize;
}

.complexity-basic {
  background-color: var(--complexity-basic);
}

.complexity-demo {
  background-color: var(--complexity-demo);
  color: #000;
}

.complexity-advanced {
  background-color: var(--complexity-advanced);
}

/* ===== Resource Headers ===== */
.resource-header {
  margin-bottom: 2rem;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.resource-type {
  font-family: 'Courier New', monospace;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--updraft-primary);
}

.resource-version {
  font-size: 0.875rem;
  color: var(--updraft-secondary);
  padding: 0.25rem 0.5rem;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.25rem;
}

.resource-description {
  font-size: 1.125rem;
  color: #333;
  margin: 1rem 0;
}

/* ===== Property Tables ===== */
.property-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.property-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
}

.property-table td {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  vertical-align: top;
}

.property-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.property-table code {
  background-color: #e9ecef;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
}

.property-required {
  color: var(--cost-high);
  font-weight: 600;
}

.property-optional {
  color: var(--updraft-secondary);
}

.property-update-type {
  font-size: 0.875rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  background-color: #e9ecef;
}

/* ===== Code Blocks ===== */
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2d2d2d;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem 0.25rem 0 0;
}

.code-block-language {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
}

.code-block-copy {
  background: none;
  border: 1px solid white;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.75rem;
}

.code-block-copy:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

pre {
  margin-top: 0 !important;
  border-radius: 0 0 0.25rem 0.25rem;
}

/* ===== Tab Navigation (for JSON/YAML examples) ===== */
.tab-navigation {
  display: flex;
  border-bottom: 2px solid #dee2e6;
  margin-bottom: 1rem;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--updraft-secondary);
  transition: all 0.2s;
}

.tab-button:hover {
  color: var(--updraft-primary);
}

.tab-button.active {
  color: var(--updraft-primary);
  border-bottom-color: var(--updraft-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== Example Lists ===== */
.example-list {
  list-style: none;
  padding: 0;
}

.example-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  transition: box-shadow 0.2s;
}

.example-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.example-item a {
  text-decoration: none;
  color: inherit;
}

.example-item strong {
  color: var(--updraft-primary);
  font-size: 1.125rem;
}

.example-item p {
  margin: 0.5rem 0 0 0;
  color: var(--updraft-secondary);
}

/* ===== Concept Lists ===== */
.concept-list {
  list-style: none;
  padding: 0;
}

.concept-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  transition: box-shadow 0.2s;
}

.concept-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.concept-item a {
  text-decoration: none;
  color: inherit;
}

.concept-item h3 {
  margin: 0 0 0.5rem 0;
  color: var(--updraft-primary);
}

.concept-item p {
  margin: 0;
  color: var(--updraft-secondary);
}

/* ===== Resource Lists ===== */
.resource-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.resource-list-item {
  padding: 1.5rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.resource-list-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.resource-list-item a {
  text-decoration: none;
  color: inherit;
}

.resource-list-item h3 {
  margin: 0 0 0.5rem 0;
  color: var(--updraft-primary);
  font-size: 1.125rem;
}

.resource-list-item p {
  margin: 0.5rem 0;
  color: var(--updraft-secondary);
  font-size: 0.9rem;
}

/* ===== Language Selector ===== */
.book-language-selector select {
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background-color: white;
  cursor: pointer;
  font-size: 0.875rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .resource-list {
    grid-template-columns: 1fr;
  }

  .property-table {
    font-size: 0.75rem;
  }

  .property-table th,
  .property-table td {
    padding: 0.5rem;
  }

  .code-block-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
  .resource-description {
    color: #e9ecef;
  }

  .property-table th {
    background-color: #2d2d2d;
    color: #e9ecef;
  }

  .property-table tr:nth-child(even) {
    background-color: #343a40;
  }

  .resource-list-item,
  .example-item,
  .concept-item {
    background-color: #2d2d2d;
    border-color: #495057;
  }

  .cost-risk-indicator {
    background-color: rgba(255, 255, 255, 0.05);
  }
}

/* ===== Utility Classes ===== */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}
