/* ============================================================================
   duvc-ctl Documentation - Doxygen Modern Styling
   ============================================================================ */

/* Import fonts to match Sphinx */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================================
   CSS Variables (Matching Sphinx Theme)
   ============================================================================ */

:root {
  /* Brand Colors */
  --duvc-primary: #2196f3;
  --duvc-primary-dark: #1976d2;
  --duvc-primary-light: #64b5f6;
  --duvc-secondary: #ff9800;
  --duvc-accent: #4caf50;
  
  /* Background Colors */
  --duvc-bg-primary: #ffffff;
  --duvc-bg-secondary: #f8f9fa;
  --duvc-bg-tertiary: #e9ecef;
  --duvc-bg-code: #f8f9fa;
  --duvc-bg-header: #343a40;
  
  /* Text Colors */
  --duvc-text-primary: #212529;
  --duvc-text-secondary: #6c757d;
  --duvc-text-muted: #adb5bd;
  --duvc-text-light: #ffffff;
  --duvc-text-code: #e83e8c;
  
  /* Border & Shadow */
  --duvc-border: #dee2e6;
  --duvc-shadow: 0 2px 10px rgba(0,0,0,0.1);
  --duvc-shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
  
  /* Typography */
  --duvc-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --duvc-font-mono: 'SFMono-Regular', 'Monaco', 'Consolas', monospace;
  
  /* Spacing */
  --duvc-spacing-xs: 0.25rem;
  --duvc-spacing-sm: 0.5rem;
  --duvc-spacing-md: 1rem;
  --duvc-spacing-lg: 1.5rem;
  --duvc-spacing-xl: 2rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --duvc-bg-primary: #1a1a1a;
    --duvc-bg-secondary: #2d2d2d;
    --duvc-bg-tertiary: #404040;
    --duvc-bg-code: #2d2d2d;
    --duvc-bg-header: #1f1f1f;
    
    --duvc-text-primary: #e9ecef;
    --duvc-text-secondary: #adb5bd;
    --duvc-text-muted: #6c757d;
    
    --duvc-border: #404040;
    --duvc-shadow: 0 2px 10px rgba(0,0,0,0.3);
  }
}

/* ============================================================================
   Global Reset & Base Styles
   ============================================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--duvc-font-family) !important;
  line-height: 1.6;
  color: var(--duvc-text-primary) !important;
  background-color: var(--duvc-bg-primary) !important;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   Header & Navigation
   ============================================================================ */

#top {
  background: linear-gradient(135deg, var(--duvc-primary), var(--duvc-primary-dark)) !important;
  border: none !important;
  box-shadow: var(--duvc-shadow);
  margin: 0 !important;
}

#projectname {
  color: var(--duvc-text-light) !important;
  font-weight: 700 !important;
  font-size: 1.8rem !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

#projectbrief {
  color: rgba(255,255,255,0.9) !important;
  font-weight: 400 !important;
  margin-top: var(--duvc-spacing-sm) !important;
}

#projectnumber {
  color: rgba(255,255,255,0.8) !important;
  font-weight: 500 !important;
  background: rgba(255,255,255,0.1) !important;
  padding: var(--duvc-spacing-xs) var(--duvc-spacing-sm) !important;
  border-radius: 12px !important;
  margin-left: var(--duvc-spacing-md) !important;
}

/* ============================================================================
   Navigation Tabs
   ============================================================================ */

.tabs, .tabs2, .tabs3 {
  background: var(--duvc-bg-secondary) !important;
  border: none !important;
  border-top: 1px solid var(--duvc-border) !important;
  padding: 0 !important;
  margin: 0 !important;
}

.tablist {
  margin: 0 !important;
  padding: 0 var(--duvc-spacing-lg) !important;
  display: flex;
  gap: 2px;
}

.tablist li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.tablist a {
  display: block !important;
  padding: var(--duvc-spacing-md) var(--duvc-spacing-lg) !important;
  color: var(--duvc-text-secondary) !important;
  text-decoration: none !important;
  border-radius: 8px 8px 0 0 !important;
  background: transparent !important;
  border: none !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.tablist a:hover {
  background: var(--duvc-bg-tertiary) !important;
  color: var(--duvc-text-primary) !important;
}

.tablist .current a {
  background: var(--duvc-bg-primary) !important;
  color: var(--duvc-primary) !important;
  border-bottom: 2px solid var(--duvc-primary) !important;
  font-weight: 600 !important;
}

/* ============================================================================
   Content Container
   ============================================================================ */

#doc-content, .contents {
  background: var(--duvc-bg-primary) !important;
  margin: 0 !important;
  padding: var(--duvc-spacing-xl) !important;
  max-width: 1200px;
  margin: 0 auto !important;
}

.header {
  background: var(--duvc-bg-secondary) !important;
  border: 1px solid var(--duvc-border) !important;
  border-radius: 12px !important;
  padding: var(--duvc-spacing-lg) !important;
  margin-bottom: var(--duvc-spacing-xl) !important;
  box-shadow: var(--duvc-shadow) !important;
}

.headertitle {
  margin: 0 !important;
}

.title {
  font-size: 2.5rem !important;
  color: var(--duvc-text-primary) !important;
  font-weight: 700 !important;
  margin: 0 0 var(--duvc-spacing-sm) 0 !important;
}

.ingroups {
  color: var(--duvc-text-secondary) !important;
  font-weight: 500 !important;
}

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--duvc-font-family) !important;
  font-weight: 600 !important;
  color: var(--duvc-text-primary) !important;
  margin-top: var(--duvc-spacing-xl) !important;
  margin-bottom: var(--duvc-spacing-md) !important;
  line-height: 1.3 !important;
}

h1 { font-size: 2.5rem !important; }
h2 { font-size: 2rem !important; color: var(--duvc-primary) !important; }
h3 { font-size: 1.5rem !important; }
h4 { font-size: 1.25rem !important; }
h5 { font-size: 1.125rem !important; }
h6 { font-size: 1rem !important; }

p {
  margin: var(--duvc-spacing-md) 0 !important;
  line-height: 1.7 !important;
}

/* ============================================================================
   Code & Syntax Highlighting
   ============================================================================ */

code, tt, .code {
  font-family: var(--duvc-font-mono) !important;
  font-size: 0.9em !important;
  background: var(--duvc-bg-code) !important;
  color: var(--duvc-text-code) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  border: 1px solid var(--duvc-border) !important;
}

pre, .fragment {
  font-family: var(--duvc-font-mono) !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  background: var(--duvc-bg-code) !important;
  border: 1px solid var(--duvc-border) !important;
  border-radius: 8px !important;
  padding: var(--duvc-spacing-lg) !important;
  margin: var(--duvc-spacing-lg) 0 !important;
  overflow-x: auto !important;
  box-shadow: var(--duvc-shadow) !important;
}

.fragment .line {
  line-height: 1.5 !important;
}

/* Syntax highlighting colors */
.keyword    { color: #d73a49 !important; font-weight: 600 !important; }
.keywordtype { color: #005cc5 !important; font-weight: 600 !important; }
.keywordflow { color: #d73a49 !important; font-weight: 600 !important; }
.comment    { color: #6a737d !important; font-style: italic !important; }
.preprocessor { color: #032f62 !important; }
.stringliteral { color: #032f62 !important; }
.charliteral { color: #032f62 !important; }
.vhdldigit  { color: #ff6900 !important; }
.vhdlchar   { color: #008000 !important; }
.vhdlkeyword { color: #0000ff !important; }
.vhdllogic  { color: #ff0000 !important; }

/* Dark mode syntax colors */
@media (prefers-color-scheme: dark) {
  .keyword    { color: #ff7b72 !important; }
  .keywordtype { color: #79c0ff !important; }
  .keywordflow { color: #ff7b72 !important; }
  .comment    { color: #8b949e !important; }
  .preprocessor { color: #a5a5a5 !important; }
  .stringliteral { color: #a5d6ff !important; }
  .charliteral { color: #a5d6ff !important; }
}

/* ============================================================================
   Tables
   ============================================================================ */

table.memberdecls,
table.memberDecls,
table.doxtable,
.table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: var(--duvc-spacing-lg) 0 !important;
  background: var(--duvc-bg-primary) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: var(--duvc-shadow) !important;
  border: 1px solid var(--duvc-border) !important;
}

table.memberdecls th,
table.memberDecls th,
table.doxtable th,
.table th {
  background: linear-gradient(135deg, var(--duvc-primary), var(--duvc-primary-dark)) !important;
  color: white !important;
  font-weight: 600 !important;
  text-align: left !important;
  padding: var(--duvc-spacing-md) !important;
  border: none !important;
}

table.memberdecls td,
table.memberDecls td,
table.doxtable td,
.table td {
  padding: var(--duvc-spacing-md) !important;
  border-bottom: 1px solid var(--duvc-border) !important;
  border-right: none !important;
  border-left: none !important;
  vertical-align: top !important;
}

table.memberdecls tr:nth-child(even),
table.memberDecls tr:nth-child(even),
table.doxtable tr:nth-child(even),
.table tr:nth-child(even) {
  background: var(--duvc-bg-secondary) !important;
}

table.memberdecls tr:hover,
table.memberDecls tr:hover,
table.doxtable tr:hover,
.table tr:hover {
  background: rgba(33, 150, 243, 0.05) !important;
}

/* ============================================================================
   Class/Function Documentation Boxes
   ============================================================================ */

.memitem {
  background: var(--duvc-bg-primary) !important;
  border: 1px solid var(--duvc-border) !important;
  border-radius: 12px !important;
  margin: var(--duvc-spacing-lg) 0 !important;
  box-shadow: var(--duvc-shadow) !important;
  overflow: hidden !important;
}

.memproto {
  background: linear-gradient(45deg, var(--duvc-bg-secondary), var(--duvc-bg-tertiary)) !important;
  padding: var(--duvc-spacing-lg) !important;
  border-bottom: 1px solid var(--duvc-border) !important;
  font-family: var(--duvc-font-mono) !important;
}

.memdoc {
  padding: var(--duvc-spacing-lg) !important;
  background: var(--duvc-bg-primary) !important;
}

.memname {
  color: var(--duvc-primary) !important;
  font-weight: 700 !important;
  font-size: 1.1em !important;
}

.paramtype {
  color: var(--duvc-text-secondary) !important;
  font-style: italic !important;
}

.paramname {
  color: var(--duvc-text-primary) !important;
  font-weight: 500 !important;
}

/* ============================================================================
   Lists & Navigation
   ============================================================================ */

ul, ol {
  padding-left: var(--duvc-spacing-xl) !important;
}

li {
  margin: var(--duvc-spacing-sm) 0 !important;
  line-height: 1.6 !important;
}

.directory table {
  width: 100% !important;
}

.directory .levels {
  background: transparent !important;
}

.directory tr.even {
  background: var(--duvc-bg-secondary) !important;
}

/* ============================================================================
   Links
   ============================================================================ */

a {
  color: var(--duvc-primary) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

a:hover {
  color: var(--duvc-primary-dark) !important;
  text-decoration: underline !important;
}

a:visited {
  color: var(--duvc-primary) !important;
}

/* ============================================================================
   Search Box
   ============================================================================ */

#MSearchBox {
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  border-radius: 6px !important;
}

#MSearchField {
  background: transparent !important;
  color: var(--duvc-text-light) !important;
  border: none !important;
  font-family: var(--duvc-font-family) !important;
}

#MSearchField::placeholder {
  color: rgba(255,255,255,0.7) !important;
}

/* ============================================================================
   Diagrams & Images
   ============================================================================ */

.doxygraph {
  text-align: center !important;
  margin: var(--duvc-spacing-lg) 0 !important;
}

.doxygraph img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
  box-shadow: var(--duvc-shadow) !important;
  border: 1px solid var(--duvc-border) !important;
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
  background: var(--duvc-bg-header) !important;
  color: var(--duvc-text-light) !important;
  text-align: center !important;
  padding: var(--duvc-spacing-lg) !important;
  margin-top: var(--duvc-spacing-xl) !important;
  font-size: 0.9rem !important;
}

.footer a {
  color: var(--duvc-primary-light) !important;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media screen and (max-width: 768px) {
  #doc-content, .contents {
    padding: var(--duvc-spacing-lg) !important;
  }
  
  .title {
    font-size: 2rem !important;
  }
  
  table.memberdecls,
  table.memberDecls,
  table.doxtable {
    font-size: 0.85rem !important;
  }
  
  .memproto,
  .memdoc {
    padding: var(--duvc-spacing-md) !important;
  }
  
  pre, .fragment {
    padding: var(--duvc-spacing-md) !important;
    font-size: 0.8rem !important;
  }
}

@media screen and (max-width: 480px) {
  #projectname {
    font-size: 1.5rem !important;
  }
  
  .tablist {
    padding: 0 var(--duvc-spacing-md) !important;
  }
  
  .tablist a {
    padding: var(--duvc-spacing-sm) var(--duvc-spacing-md) !important;
    font-size: 0.9rem !important;
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  body {
    color: black !important;
    background: white !important;
  }
  
  #top,
  .tabs,
  .tabs2,
  .tabs3 {
    display: none !important;
  }
  
  .memproto {
    background: #f0f0f0 !important;
  }
  
  table.memberdecls th,
  table.memberDecls th,
  table.doxtable th {
    background: #e0e0e0 !important;
    color: black !important;
  }
}

/* ============================================================================
   Custom Enhancements
   ============================================================================ */

/* Add smooth scrolling */
html {
  scroll-behavior: smooth !important;
}

/* Enhance focus indicators for accessibility */
*:focus {
  outline: 2px solid var(--duvc-primary) !important;
  outline-offset: 2px !important;
}

/* Add loading animation */
body {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Custom scrollbar styling for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--duvc-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--duvc-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--duvc-text-muted);
}

/* Improve text selection */
::selection {
  background: rgba(33, 150, 243, 0.2);
}

::-moz-selection {
  background: rgba(33, 150, 243, 0.2);
}
