/* Enhanced Design System for PyDevelop-Docs */
/* This CSS provides modern, beautiful styling for all projects using PyDevelop-Docs */

/* ===== HERO SECTION ===== */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 2rem;
  margin: -2rem -2rem 2rem -2rem;
  border-radius: 0 0 20px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="25" cy="75" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="75" cy="25" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
  z-index: -1;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== MODERN CARDS & GRIDS (sphinx-design) ===== */
.sd-card {
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

.sd-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

.sd-card-header {
  background: linear-gradient(45deg, #f8fafc, #e2e8f0) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  font-weight: 600 !important;
}

/* Card with colored borders */
.sd-border-primary .sd-card {
  border-left: 4px solid #3b82f6 !important;
}

.sd-border-success .sd-card {
  border-left: 4px solid #10b981 !important;
}

.sd-border-warning .sd-card {
  border-left: 4px solid #f59e0b !important;
}

.sd-border-danger .sd-card {
  border-left: 4px solid #ef4444 !important;
}

/* ===== ENHANCED BUTTONS ===== */
.sd-btn {
  border-radius: 8px !important;
  font-weight: 500 !important;
  padding: 0.75rem 1.5rem !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.sd-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  border: none !important;
  color: white !important;
}

.sd-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
  text-decoration: none !important;
  color: white !important;
}

.sd-btn-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: none !important;
  color: white !important;
}

.sd-btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
  text-decoration: none !important;
  color: white !important;
}

.sd-btn-secondary {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  border: none !important;
  color: white !important;
}

.sd-btn-secondary:hover {
  background: linear-gradient(135deg, #4b5563, #374151) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4) !important;
  text-decoration: none !important;
  color: white !important;
}

/* ===== ENHANCED TABS (sphinx_tabs) ===== */
.sd-tab-set {
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  margin: 1.5rem 0 !important;
}

.sd-tab-label {
  background: #f8fafc !important;
  border: none !important;
  padding: 1rem 1.5rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.sd-tab-label:hover {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

.sd-tab-label[aria-selected="true"] {
  background: #3b82f6 !important;
  color: white !important;
  font-weight: 600 !important;
}

.sd-tab-content {
  padding: 2rem !important;
  background: white !important;
}

/* ===== ENHANCED DROPDOWNS (sphinx_togglebutton) ===== */
.sd-dropdown {
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  margin: 1rem 0 !important;
  overflow: hidden !important;
  transition: all 0.3s ease !important;
}

.sd-dropdown:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.sd-dropdown > summary {
  background: #f8fafc !important;
  padding: 1rem 1.5rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  border: none !important;
}

.sd-dropdown[open] > summary {
  background: #3b82f6 !important;
  color: white !important;
}

.sd-dropdown-content {
  padding: 1.5rem !important;
  background: white !important;
}

/* ===== ENHANCED CODE BLOCKS ===== */
.highlight {
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
  margin: 1rem 0 !important;
}

.highlight pre {
  padding: 1.5rem !important;
  margin: 0 !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
}

/* Code block with copy button enhancement */
.highlight-default .highlight {
  position: relative;
}

.highlight-default .highlight .copybutton {
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  background: rgba(0, 0, 0, 0.7) !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.75rem !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

.highlight-default .highlight:hover .copybutton {
  opacity: 1 !important;
}

/* ===== SIMPLIFIED ADMONITIONS - Work with Furo ===== */
/* Reduced overrides to avoid conflicts with Furo's built-in styling */
.admonition {
  border-radius: 0.5rem;
  margin: 1rem 0;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admonition.note {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid #3b82f6;
}

.admonition.tip {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid #10b981;
}

.admonition.warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
}

.admonition.danger {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid #ef4444;
}

.admonition.important {
  background: rgba(139, 92, 246, 0.1);
  border-left: 4px solid #8b5cf6;
}

.admonition-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== ENHANCED TABLES ===== */
.docutils,
.table-striped {
  width: 100% !important;
  border-collapse: collapse !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  margin: 1.5rem 0 !important;
}

.docutils th,
.table-striped th {
  background: #3b82f6 !important;
  color: white !important;
  padding: 1rem !important;
  font-weight: 600 !important;
  text-align: left !important;
}

.docutils td,
.table-striped td {
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.docutils tbody tr:nth-child(even),
.table-striped tbody tr:nth-child(even) {
  background: #f8fafc !important;
}

.docutils tbody tr:hover,
.table-striped tbody tr:hover {
  background: #e2e8f0 !important;
}

/* ===== ENHANCED LISTS ===== */
.simple li,
.arabic li {
  margin: 0.5rem 0 !important;
  padding-left: 0.5rem !important;
}

.simple li::marker,
.arabic li::marker {
  color: #3b82f6 !important;
  font-weight: 600 !important;
}

/* Definition lists */
.docutils dt {
  font-weight: 600 !important;
  color: #1f2937 !important;
  margin-top: 1rem !important;
}

.docutils dd {
  margin-left: 1.5rem !important;
  margin-bottom: 0.5rem !important;
  color: #4b5563 !important;
}

/* ===== ENHANCED NAVIGATION ===== */
.toctree-l1 > a {
  font-weight: 600 !important;
  color: #1f2937 !important;
  transition: color 0.2s ease !important;
}

.toctree-l1 > a:hover {
  color: #3b82f6 !important;
}

.toctree-l2 > a {
  color: #4b5563 !important;
  padding-left: 1rem !important;
  transition: color 0.2s ease !important;
}

.toctree-l2 > a:hover {
  color: #1d4ed8 !important;
}

.toctree-l3 > a {
  color: #6b7280 !important;
  padding-left: 2rem !important;
  font-size: 0.9rem !important;
  transition: color 0.2s ease !important;
}

.toctree-l3 > a:hover {
  color: #3b82f6 !important;
}

/* ===== MERMAID DIAGRAMS ENHANCEMENT ===== */
.mermaid {
  text-align: center !important;
  margin: 2rem 0 !important;
  padding: 1rem !important;
  background: #f8fafc !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 1rem !important;
    margin: -1rem -1rem 1rem -1rem !important;
  }

  .hero-title {
    font-size: 2rem !important;
  }

  .hero-subtitle {
    font-size: 1rem !important;
  }

  .sd-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
  }

  .sd-card {
    margin-bottom: 1rem !important;
  }

  .sd-tab-label {
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
  }

  .sd-tab-content {
    padding: 1rem !important;
  }
}

/* ===== DARK MODE ENHANCEMENTS ===== */
body[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
}

body[data-theme="dark"] .sd-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .sd-card-header {
  background: linear-gradient(45deg, #334155, #475569) !important;
  border-color: #475569 !important;
  color: white !important;
}

body[data-theme="dark"] .sd-tab-content {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .sd-tab-label {
  background: #334155 !important;
  color: #94a3b8 !important;
}

body[data-theme="dark"] .sd-tab-label:hover {
  background: #475569 !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .sd-dropdown > summary {
  background: #334155 !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .sd-dropdown-content {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .docutils tbody tr:nth-child(even),
body[data-theme="dark"] .table-striped tbody tr:nth-child(even) {
  background: #1e293b !important;
}

body[data-theme="dark"] .docutils tbody tr:hover,
body[data-theme="dark"] .table-striped tbody tr:hover {
  background: #334155 !important;
}

body[data-theme="dark"] .admonition.tip {
  background: rgba(16, 185, 129, 0.15);
  color: #e2e8f0;
}

body[data-theme="dark"] .admonition.note {
  background: rgba(59, 130, 246, 0.15);
  color: #e2e8f0;
}

body[data-theme="dark"] .admonition.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #e2e8f0;
}

body[data-theme="dark"] .admonition.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #e2e8f0;
}

body[data-theme="dark"] .admonition.important {
  background: rgba(139, 92, 246, 0.15);
  color: #e2e8f0;
}

body[data-theme="dark"] .mermaid {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sd-card,
.admonition,
.sd-dropdown {
  animation: fadeInUp 0.6s ease-out !important;
}

/* Stagger animations for multiple cards */
.sd-card:nth-child(1) {
  animation-delay: 0s !important;
}
.sd-card:nth-child(2) {
  animation-delay: 0.1s !important;
}
.sd-card:nth-child(3) {
  animation-delay: 0.2s !important;
}
.sd-card:nth-child(4) {
  animation-delay: 0.3s !important;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center !important;
}

.text-muted {
  color: #6b7280 !important;
}

.font-mono {
  font-family:
    "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New",
    monospace !important;
}

.shadow-lg {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

/* ===== OCTICONS INTEGRATION ===== */
.octicon {
  display: inline-block !important;
  vertical-align: text-top !important;
  fill: currentColor !important;
  width: 1.2em !important;
  height: 1.2em !important;
  margin-right: 0.5rem !important;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

body[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1e293b;
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #475569;
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ===== PRINT STYLES ===== */
@media print {
  .hero-section,
  .sd-btn,
  .sd-dropdown > summary {
    background: none !important;
    color: black !important;
    box-shadow: none !important;
  }

  .sd-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid !important;
  }

  .sd-tab-content {
    display: block !important;
  }

  .sd-tab-label {
    display: none !important;
  }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
.sd-btn:focus,
.sd-tab-label:focus,
.sd-dropdown > summary:focus {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .sd-card {
    border: 2px solid currentColor !important;
  }

  .sd-btn {
    border: 2px solid currentColor !important;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .sd-card:hover {
    transform: none !important;
  }

  .sd-btn:hover {
    transform: none !important;
  }
}

/* ===== 6. AUTOAPI MODULE ENHANCEMENTS ===== */

/* Clean module summary styling */
.autoapi-module-summary {
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1),
    rgba(139, 92, 246, 0.05)
  );
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 0.9rem;
  color: var(--color-foreground-secondary);
  text-align: center;
}

.module-stat {
  background: rgba(255, 255, 255, 0.8);
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-weight: 500;
  margin: 0 0.125rem;
  display: inline-block;
  border: 1px solid rgba(59, 130, 246, 0.15);
  white-space: nowrap;
}

[data-theme="dark"] .autoapi-module-summary {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.15),
    rgba(139, 92, 246, 0.08)
  );
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .module-stat {
  background: rgba(30, 41, 59, 0.8);
  color: var(--color-foreground-primary);
  border-color: rgba(59, 130, 246, 0.25);
}

/* Simplified AutoAPI module styling */
.autoapi-module-title {
  border-bottom: 2px solid var(--color-brand-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Clean admonition styling for AutoAPI sections */
.autoapi-section {
  margin: 1.5rem 0;
}

.autoapi-section .admonition {
  border-radius: 6px;
  border: 1px solid var(--color-background-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.autoapi-section .admonition.note {
  border-left: 4px solid #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.autoapi-section .admonition.tip {
  border-left: 4px solid #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.autoapi-section .admonition.info {
  border-left: 4px solid #06b6d4;
  background: rgba(6, 182, 212, 0.05);
}

.autoapi-section .admonition.warning {
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

/* Enhanced dropdown styling for modules - REDUCED OVERRIDES */
.sd-sphinx-override details.dropdown {
  border-radius: 0.5rem;
  margin: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

.sd-sphinx-override details.dropdown:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sd-sphinx-override details.dropdown summary {
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
}

.sd-sphinx-override details.dropdown[open] summary {
  border-bottom: 2px solid var(--color-brand-primary);
}

.sd-sphinx-override details.dropdown .sd-summary-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Module content sections - SIMPLIFIED */
.module-contents-section {
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
}

/* Enhanced autoapisummary tables - SIMPLIFIED */
.autoapisummary {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.25rem;
}

.autoapisummary th,
.autoapisummary td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-background-border);
}

.autoapisummary th {
  background: var(--color-background-secondary);
  font-weight: 600;
  color: var(--color-brand-primary);
}

.autoapisummary tr:hover {
  background: var(--color-background-hover);
}

.autoapisummary tr:last-child td {
  border-bottom: none;
}

/* Tab set enhancements for modules */
.sd-sphinx-override .sd-tab-set > .sd-tab-label {
  padding: 0.75rem 1.5rem !important;
  font-weight: 500 !important;
  border-radius: 0.5rem 0.5rem 0 0 !important;
  transition: all 0.2s ease !important;
}

.sd-sphinx-override .sd-tab-set > .sd-tab-label:hover {
  background: var(--color-background-hover) !important;
}

.sd-sphinx-override .sd-tab-set > .sd-tab-content {
  border-radius: 0 0.5rem 0.5rem 0.5rem !important;
  padding: 1.5rem !important;
  background: var(--color-background-secondary) !important;
  border: 1px solid var(--color-background-border) !important;
}

/* Module navigation breadcrumbs */
.module-breadcrumb {
  background: var(--color-background-secondary);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--color-brand-primary);
}

.module-breadcrumb a {
  color: var(--color-brand-content);
  text-decoration: none;
  font-weight: 500;
}

.module-breadcrumb a:hover {
  text-decoration: underline;
}

/* Module header card enhancements */
.sd-card.sd-bg-primary {
  background: linear-gradient(
    135deg,
    var(--color-brand-primary),
    var(--color-brand-content)
  ) !important;
  color: white !important;
}

.sd-card.sd-bg-primary .sd-card-title {
  font-size: 1.5rem !important;
  margin-bottom: 1rem !important;
}

/* Responsive grid adjustments for modules */
@media (max-width: 768px) {
  .sd-sphinx-override .sd-container-fluid .sd-row .sd-col {
    margin-bottom: 1rem;
  }

  .module-stats {
    text-align: center;
  }

  .stat-item {
    display: inline-block;
    margin: 0.25rem;
  }
}

/* Dark mode specific adjustments */
[data-theme="dark"] .module-contents-section {
  background: var(--color-background-primary);
  border-color: var(--color-background-border);
}

[data-theme="dark"] .autoapisummary th {
  background: var(--color-background-primary);
  color: var(--color-brand-primary);
}

[data-theme="dark"] .sd-sphinx-override .sd-tab-content {
  background: var(--color-background-primary) !important;
  border-color: var(--color-background-border) !important;
}

/* ===== END: 6. MODULE TEMPLATE ENHANCEMENTS ===== */
