/* ============================================================================
   duvc-ctl Documentation - Modern Custom Styles
   ============================================================================ */

/* CSS Variables for Theme System */
:root {
  /* Brand Colors */
  --duvc-primary: #2196f3;
  --duvc-primary-dark: #1976d2;
  --duvc-primary-light: #64b5f6;
  --duvc-secondary: #ff9800;
  --duvc-secondary-dark: #f57c00;
  --duvc-accent: #4caf50;
  
  /* Background Colors */
  --duvc-bg-primary: #ffffff;
  --duvc-bg-secondary: #f8f9fa;
  --duvc-bg-tertiary: #e9ecef;
  --duvc-bg-code: #f8f9fa;
  --duvc-bg-sidebar: #343a40;
  
  /* Text Colors */
  --duvc-text-primary: #212529;
  --duvc-text-secondary: #6c757d;
  --duvc-text-muted: #adb5bd;
  --duvc-text-light: #ffffff;
  
  /* 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: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --duvc-font-mono: "SFMono-Regular", "Monaco", "Inconsolata", "Fira Code", "Droid Sans Mono", "Source Code Pro", 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;
  --duvc-spacing-xxl: 3rem;
  
  /* Layout */
  --duvc-container-max-width: 1200px;
  --duvc-sidebar-width: 300px;
  --duvc-content-max-width: 800px;
}

/* ============================================================================
   Base Typography & Layout
   ============================================================================ */

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* ============================================================================
   Hero Section (Landing Page)
   ============================================================================ */

.hero-section {
  background: linear-gradient(135deg, var(--duvc-primary) 0%, var(--duvc-primary-dark) 100%);
  color: var(--duvc-text-light);
  text-align: center;
  padding: var(--duvc-spacing-xxl) var(--duvc-spacing-lg);
  margin-bottom: var(--duvc-spacing-xl);
  border-radius: 12px;
  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="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="20" cy="80" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0 0 var(--duvc-spacing-md) 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin: 0 0 var(--duvc-spacing-lg) 0;
  opacity: 0.95;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: var(--duvc-spacing-md);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-badges .badge {
  display: inline-flex;
  align-items: center;
  padding: var(--duvc-spacing-sm) var(--duvc-spacing-lg);
  background: rgba(255,255,255,0.2);
  color: var(--duvc-text-light);
  text-decoration: none;
  border-radius: 50px;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
}

.hero-badges .badge:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ============================================================================
   Enhanced Card Grid System
   ============================================================================ */

.sd-container-fluid .sd-row {
  margin: var(--duvc-spacing-lg) 0;
}

.sd-card {
  background: var(--duvc-bg-primary);
  border: 1px solid var(--duvc-border);
  border-radius: 12px;
  box-shadow: var(--duvc-shadow);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sd-card:hover {
  box-shadow: var(--duvc-shadow-hover);
  transform: translateY(-4px);
  border-color: var(--duvc-primary-light);
}

.sd-card-header {
  padding: var(--duvc-spacing-lg);
  background: linear-gradient(45deg, var(--duvc-bg-secondary), var(--duvc-bg-tertiary));
  border-bottom: 1px solid var(--duvc-border);
  font-weight: 600;
  color: var(--duvc-text-primary);
  display: flex;
  align-items: center;
  gap: var(--duvc-spacing-sm);
}

.sd-card-body {
  padding: var(--duvc-spacing-lg);
  flex-grow: 1;
}

.sd-card-footer {
  padding: var(--duvc-spacing-md) var(--duvc-spacing-lg);
  background: var(--duvc-bg-secondary);
  border-top: 1px solid var(--duvc-border);
  margin-top: auto;
}

/* Card Icons */
.sd-card-header::before {
  content: '';
  width: 24px;
  height: 24px;
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: var(--duvc-spacing-sm);
}

.sd-card-header[data-icon="rocket"]::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>'); }

.sd-card-header[data-icon="book"]::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.746 0 3.332.477 4.5 1.253v13C19.832 18.477 18.246 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/></svg>'); }

.sd-card-header[data-icon="cog"]::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>'); }

.sd-card-header[data-icon="tool"]::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/></svg>'); }

/* ============================================================================
   Enhanced Code Blocks
   ============================================================================ */

.highlight {
  background: var(--duvc-bg-code);
  border: 1px solid var(--duvc-border);
  border-radius: 8px;
  margin: var(--duvc-spacing-md) 0;
  overflow: hidden;
  position: relative;
}

.highlight pre {
  margin: 0;
  padding: var(--duvc-spacing-lg);
  overflow-x: auto;
  font-family: var(--duvc-font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  background: transparent;
}

/* Language Labels */
.highlight::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  right: 0;
  background: var(--duvc-primary);
  color: white;
  padding: var(--duvc-spacing-xs) var(--duvc-spacing-md);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  border-bottom-left-radius: 4px;
  z-index: 1;
}

.highlight[data-language="cpp"]::before { content: "C++"; background: #00599c; }
.highlight[data-language="python"]::before { content: "Python"; background: #3776ab; }
.highlight[data-language="bash"]::before { content: "Shell"; background: #4eaa25; }
.highlight[data-language="cmake"]::before { content: "CMake"; background: #064f8c; }
.highlight[data-language="json"]::before { content: "JSON"; background: #292929; }
.highlight[data-language="yaml"]::before { content: "YAML"; background: #cb171e; }

/* Copy Button Enhancement */
.copybtn {
  position: absolute;
  top: var(--duvc-spacing-sm);
  right: var(--duvc-spacing-sm);
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--duvc-border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.copybtn:hover {
  background: var(--duvc-primary);
  color: white;
  border-color: var(--duvc-primary);
  transform: scale(1.05);
}

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

table.docutils {
  border-collapse: collapse;
  width: 100%;
  margin: var(--duvc-spacing-lg) 0;
  background: var(--duvc-bg-primary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--duvc-shadow);
}

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

table.docutils td {
  padding: var(--duvc-spacing-md);
  border-bottom: 1px solid var(--duvc-border);
  vertical-align: top;
}

table.docutils tbody tr:nth-child(even) {
  background: var(--duvc-bg-secondary);
}

table.docutils tbody tr:hover {
  background: rgba(33, 150, 243, 0.05);
}

/* ============================================================================
   Enhanced Admonitions
   ============================================================================ */

.admonition {
  margin: var(--duvc-spacing-lg) 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  box-shadow: var(--duvc-shadow);
  overflow: hidden;
  background: var(--duvc-bg-primary);
}

.admonition-title {
  margin: 0;
  padding: var(--duvc-spacing-md) var(--duvc-spacing-lg);
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: var(--duvc-spacing-sm);
}

.admonition-title::before {
  content: '';
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
}

.admonition p {
  padding: 0 var(--duvc-spacing-lg) var(--duvc-spacing-lg);
  margin: var(--duvc-spacing-md) 0 0;
}

/* Specific Admonition Types */
.admonition.note .admonition-title { background: var(--duvc-primary); }
.admonition.note .admonition-title::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>'); }

.admonition.warning .admonition-title { background: var(--duvc-secondary); }
.admonition.warning .admonition-title::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>'); }

.admonition.tip .admonition-title { background: var(--duvc-accent); }
.admonition.tip .admonition-title::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>'); }

.admonition.important .admonition-title { background: #e91e63; }
.admonition.important .admonition-title::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>'); }

/* ============================================================================
   Enhanced Navigation & Sidebar
   ============================================================================ */

.wy-side-nav-search {
  background: var(--duvc-bg-sidebar);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.wy-side-nav-search .wy-dropdown > a {
  color: var(--duvc-text-light);
  font-weight: 600;
  font-size: 1.1rem;
}

.wy-menu-vertical {
  background: var(--duvc-bg-sidebar);
}

.wy-menu-vertical a {
  color: rgba(255,255,255,0.8);
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  padding-left: var(--duvc-spacing-lg);
}

.wy-menu-vertical a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--duvc-text-light);
  border-left-color: var(--duvc-primary-light);
}

.wy-menu-vertical .current a {
  color: var(--duvc-text-light);
  background: rgba(33, 150, 243, 0.1);
  border-left-color: var(--duvc-primary);
  font-weight: 500;
}

/* ============================================================================
   Enhanced Tab System
   ============================================================================ */

.sphinx-tabs {
  margin: var(--duvc-spacing-lg) 0;
}

.sphinx-tabs-tab {
  background: var(--duvc-bg-tertiary);
  border: 1px solid var(--duvc-border);
  border-bottom: none;
  color: var(--duvc-text-secondary);
  padding: var(--duvc-spacing-md) var(--duvc-spacing-lg);
  margin-right: 2px;
  border-radius: 8px 8px 0 0;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sphinx-tabs-tab:hover {
  background: var(--duvc-bg-secondary);
  color: var(--duvc-text-primary);
}

.sphinx-tabs-tab[aria-selected="true"] {
  background: var(--duvc-primary);
  color: white;
  border-color: var(--duvc-primary);
}

.sphinx-tabs-panel {
  background: var(--duvc-bg-primary);
  border: 1px solid var(--duvc-border);
  border-radius: 0 8px 8px 8px;
  padding: var(--duvc-spacing-lg);
}

/* ============================================================================
   Enhanced Buttons & Links
   ============================================================================ */

.btn, .button {
  display: inline-flex;
  align-items: center;
  gap: var(--duvc-spacing-sm);
  padding: var(--duvc-spacing-md) var(--duvc-spacing-lg);
  background: var(--duvc-primary);
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn:hover, .button:hover {
  background: var(--duvc-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: var(--duvc-bg-tertiary);
  color: var(--duvc-text-primary);
}

.btn-secondary:hover {
  background: var(--duvc-bg-secondary);
  color: var(--duvc-text-primary);
  box-shadow: var(--duvc-shadow);
}

/* ============================================================================
   Enhanced Search
   ============================================================================ */

.wy-side-nav-search input[type=text] {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: var(--duvc-text-light);
  padding: var(--duvc-spacing-sm) var(--duvc-spacing-md);
  width: 100%;
  transition: all 0.2s ease;
}

.wy-side-nav-search input[type=text]:focus {
  background: rgba(255,255,255,0.15);
  border-color: var(--duvc-primary-light);
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

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

@media screen and (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .hero-badges {
    flex-direction: column;
    align-items: center;
  }
  
  .sd-container-fluid .sd-row {
    flex-direction: column;
  }
  
  table.docutils {
    font-size: 0.85rem;
  }
  
  table.docutils th,
  table.docutils td {
    padding: var(--duvc-spacing-sm);
  }
}

@media screen and (max-width: 480px) {
  .hero-section {
    padding: var(--duvc-spacing-xl) var(--duvc-spacing-md);
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .highlight pre {
    font-size: 0.8rem;
    padding: var(--duvc-spacing-md);
  }
}

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

@media print {
  .hero-section,
  .wy-nav-side,
  .copybtn,
  .btn,
  .button {
    display: none !important;
  }
  
  body {
    color: black;
    background: white;
  }
  
  .highlight {
    border: 1px solid #ddd;
  }
  
  table.docutils th {
    background: #f0f0f0 !important;
    color: black !important;
  }
}
