/* cpaltemplates Documentation Custom Styles */

/* CPAL Brand Colors - New Color System */
:root {
  /* Core Colors */
  --cpal-midnight: #004855;
  --cpal-deep-teal: #006878;
  --cpal-coral: #E86A50;
  --cpal-sage: #5A8A6F;
  --cpal-slate: #5C6B73;
  --cpal-warm-gray: #9BA8AB;
  /* Legacy (backward compatibility) */
  --cpal-teal: #007A8C;
  --cpal-gold: #B8860B;
  /* Status Colors */
  --cpal-success: #5A8A6F;
  --cpal-warning: #D4A84B;
  --cpal-error: #C75540;
  --cpal-info: #006878;
}

/* Navbar customization */
.navbar {
  background-color: var(--cpal-midnight) !important;
}

/* Logo spacing - add margin between logo and title */
.navbar-brand img {
  margin-right: 10px;
}

/* Code block styling */
pre.sourceCode {
  border-left: 3px solid var(--cpal-teal);
  background-color: #f8f9fa;
}

/* Function reference styling */
.function-signature {
  background-color: #e9ecef;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-family: monospace;
  margin-bottom: 1rem;
}

/* Color swatch display */
.color-swatch {
  display: inline-block;
  width: 60px;
  height: 30px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid #ddd;
}

/* Parameter tables */
.param-table {
  font-size: 0.9rem;
}

.param-table th {
  background-color: var(--cpal-midnight);
  color: white;
}

/* Callout customization */
.callout-tip {
  border-left-color: var(--cpal-teal) !important;
}

.callout-warning {
  border-left-color: var(--cpal-orange) !important;
}

.callout-important {
  border-left-color: var(--cpal-pink) !important;
}

/* Feature cards for landing page */
.feature-card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
}

.feature-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-card h3 {
  color: var(--cpal-teal);
  margin-top: 0;
}

/* Quick reference tables */
.quick-ref-table {
  font-size: 0.85rem;
}

.quick-ref-table code {
  background-color: #f1f3f5;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Deprecated function styling */
.deprecated {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
}

.deprecated::before {
  content: "DEPRECATED: ";
  font-weight: bold;
  color: #856404;
}

/* Recommended function styling */
.recommended {
  background-color: #d4edda;
  border: 1px solid #28a745;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
}

.recommended::before {
  content: "RECOMMENDED: ";
  font-weight: bold;
  color: #155724;
}

/* Card styling for home page */
.card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  background-color: var(--cpal-midnight) !important;
  color: white !important;
  padding: 0.75rem 1rem;
  border-bottom: none;
}

.card-header strong {
  color: white !important;
}

.card-body {
  padding: 1rem;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 72, 85, 0.15);
  transition: box-shadow 0.2s ease;
}

/* Hero section */
.hero-banner {
  background: linear-gradient(135deg, #002d38 0%, #00404f 100%);
  color: white;
  padding: 2rem 2rem 1.75rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
}

.hero-banner h1 {
  color: white;
  font-size: 2.25rem;
  margin-bottom: 0.25rem;
  margin-top: 0;
}

.hero-banner .tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.hero-banner .hero-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.hero-banner .hero-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.hero-banner .hero-feature svg {
  width: 20px;
  height: 20px;
}

/* Color palette display in hero */
.hero-palette {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 1.5rem 0;
}

.hero-palette p {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0;
}

.hero-palette .swatch {
  display: inline-block;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-palette .swatch:hover {
  transform: scale(1.15);
  cursor: pointer;
}

/* Gallery cards get special treatment */
.gallery-card .card-header {
  background: linear-gradient(135deg, var(--cpal-coral) 0%, #d45a42 100%) !important;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .card {
  border-color: #374151;
  background-color: #1f2937;
}

[data-bs-theme="dark"] .card-body {
  color: #e5e7eb;
}

[data-bs-theme="dark"] .hero-banner {
  background: linear-gradient(135deg, #001a20 0%, #002d38 100%);
}

/* Function status indicators */
.status-ready {
  color: #28a745;
  font-weight: bold;
}

.status-dev {
  color: #d4a84b;
  font-weight: bold;
}

.status-revamp {
  color: #dc3545;
  font-weight: bold;
}

.status-legend {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: nowrap;
  padding: 0.75rem 1.5rem;
  background-color: #f8f9fa;
  border-radius: 6px;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.status-legend p {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin: 0;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

[data-bs-theme="dark"] .status-legend {
  background-color: #1f2937;
}

/* Center htmlwidgets (Highcharter, etc.) */
.cell-output-display .htmlwidget {
  margin-left: auto;
  margin-right: auto;
}

.cell-output-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================
   Reactable Table Styles (CPAL Branding)
   ============================================ */

/* Base reactable container */
.reactable-cpal {
  font-family: inherit;
}

/* Table header title and subtitle */
.cpal-table-header {
  margin-bottom: 1rem;
}

.cpal-table-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--cpal-midnight);
}

.cpal-table-subtitle {
  font-size: 0.9rem;
  color: #6c757d;
  margin: 0;
}

/* Table footer/source */
.cpal-table-footer {
  font-size: 0.8rem;
  color: #6c757d;
  font-style: italic;
  text-align: right;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid #dee2e6;
}

/* Row hover enhancement */
.reactable-cpal .rt-tr:hover {
  background-color: rgba(0, 104, 120, 0.08);
}

/* Ensure table doesn't have double borders */
.reactable-cpal .rt-table {
  border-top: none;
}

/* Sort indicator styling */
.reactable-cpal .rt-sort-header:hover {
  background-color: rgba(0, 104, 120, 0.05);
}

/* Page size select styling */
.reactable-cpal .rt-page-size-select {
  border: 1px solid var(--cpal-deep-teal);
  border-radius: 4px;
  padding: 4px 8px;
}

/* ============================================
   Reactable Dark Mode Support
   ============================================ */

[data-bs-theme="dark"] .cpal-table-title {
  color: #e5e7eb;
}

[data-bs-theme="dark"] .cpal-table-subtitle,
[data-bs-theme="dark"] .cpal-table-footer {
  color: #9ca3af;
}

[data-bs-theme="dark"] .cpal-table-footer {
  border-top-color: #374151;
}

[data-bs-theme="dark"] .reactable-cpal {
  background-color: #1f2937;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .reactable-cpal .rt-tr {
  color: #e5e7eb;
}

[data-bs-theme="dark"] .reactable-cpal .rt-tr:hover {
  background-color: rgba(0, 104, 120, 0.15);
}

[data-bs-theme="dark"] .reactable-cpal .rt-td {
  border-top-color: #374151;
}

[data-bs-theme="dark"] .reactable-cpal .rt-th {
  border-color: var(--cpal-deep-teal);
}

[data-bs-theme="dark"] .reactable-cpal .rt-search,
[data-bs-theme="dark"] .reactable-cpal .rt-page-size-select {
  background-color: #374151;
  border-color: var(--cpal-deep-teal);
  color: #e5e7eb;
}

[data-bs-theme="dark"] .reactable-cpal .rt-pagination {
  border-top-color: #374151;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .reactable-cpal .rt-page-button {
  color: #e5e7eb;
}

[data-bs-theme="dark"] .reactable-cpal .rt-page-button:hover {
  background-color: #374151;
}
