/* 
 * Qbitcoin Documentation Page Styling
 * Dark theme with blue gradients
 * Matches home page design with documentation-specific enhancements
 */

/* === DOCUMENTATION VARIABLES === */
:root {
  --docs-header-bg: linear-gradient(135deg, #0a1929 0%, #1976d2 100%);
  --docs-sidebar-bg: rgba(10, 25, 41, 0.95);
  --docs-content-bg: rgba(15, 35, 60, 0.4);
  --docs-code-bg: rgba(5, 16, 31, 0.8);
  --docs-border: rgba(25, 118, 210, 0.3);
  --docs-hover-bg: rgba(25, 118, 210, 0.15);
  --docs-search-bg: rgba(255, 255, 255, 0.1);
  --docs-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* === DOCUMENTATION HEADER === */
.docs-header {
  background: var(--docs-header-bg);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.docs-header::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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.docs-header-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.docs-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.docs-header h1 i {
  color: var(--accent-blue);
  margin-right: 1rem;
}

.docs-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === DOCUMENTATION SEARCH === */
.docs-search {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.docs-search input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  background: var(--docs-search-bg);
  border: 2px solid var(--docs-border);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.docs-search input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 20px rgba(25, 118, 210, 0.3);
  background: rgba(255, 255, 255, 0.15);
}

.docs-search input::placeholder {
  color: var(--text-secondary);
}

.docs-search i {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-blue);
  font-size: 1.1rem;
}

/* === DOCUMENTATION CONTAINER === */
.docs-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-areas: "sidebar main";
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 400px);
}

/* === SIDEBAR NAVIGATION === */
.docs-sidebar {
  grid-area: sidebar;
  background: var(--docs-sidebar-bg);
  border-radius: 12px;
  padding: 2rem;
  height: fit-content;
  position: sticky;
  top: 120px;
  box-shadow: var(--docs-shadow);
  backdrop-filter: blur(10px);
  border: 1px solid var(--docs-border);
}

.sidebar-content h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--docs-border);
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section h4 {
  color: var(--accent-blue);
  font-size: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.sidebar-section h4 i {
  color: var(--primary-blue);
}

.sidebar-section ul {
  list-style: none;
  margin-left: 1.5rem;
}

.sidebar-section li {
  margin-bottom: 0.5rem;
}

.sidebar-section a {
  display: block;
  color: var(--text-secondary);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
}

.sidebar-section a:hover {
  color: var(--text-primary);
  background: var(--docs-hover-bg);
  border-left-color: var(--primary-blue);
  transform: translateX(4px);
}

.sidebar-section a.active {
  color: var(--text-primary);
  background: var(--docs-hover-bg);
  border-left-color: var(--accent-blue);
}

/* === MAIN DOCUMENTATION CONTENT === */
.docs-main {
  grid-area: main;
  background: var(--docs-content-bg);
  border-radius: 12px;
  padding: 3rem;
  box-shadow: var(--docs-shadow);
  backdrop-filter: blur(10px);
  border: 1px solid var(--docs-border);
}

.docs-content {
  max-width: none;
}

/* === DOCUMENTATION SECTIONS === */
.doc-section {
  margin-bottom: 4rem;
  scroll-margin-top: 120px;
}

.doc-section:last-child {
  margin-bottom: 0;
}

.doc-section h2 {
  color: var(--text-primary);
  font-size: 2.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--primary-blue);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.doc-section h2 i {
  color: var(--accent-blue);
  font-size: 2rem;
}

.doc-section h3 {
  color: var(--accent-blue);
  font-size: 1.5rem;
  margin: 2rem 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.doc-section h3 i {
  color: var(--primary-blue);
  font-size: 1.2rem;
}

.doc-section h4 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin: 1.5rem 0 1rem 0;
  font-weight: 600;
}

.doc-content {
  line-height: 1.8;
}

.doc-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.doc-content ul, .doc-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.doc-content li {
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.doc-content li strong {
  color: var(--accent-blue);
}

/* === CODE BLOCKS AND SYNTAX HIGHLIGHTING === */
.doc-content pre {
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  position: relative;
}

.doc-content pre code {
  color: var(--text-primary);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.doc-content code {
  background: rgba(25, 118, 210, 0.2);
  color: var(--accent-blue);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
}

.doc-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* === TABLES === */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--docs-code-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--docs-shadow);
}

.specs-table th {
  background: var(--primary-blue);
  color: var(--text-primary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

.specs-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--docs-border);
  color: var(--text-secondary);
}

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

.specs-table tr:hover {
  background: var(--docs-hover-bg);
}

.specs-table td strong {
  color: var(--text-primary);
}

/* === ALERTS AND CALLOUTS === */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  border-left: 4px solid;
  background: rgba(25, 118, 210, 0.1);
  border-left-color: var(--primary-blue);
}

.alert.warning {
  background: rgba(255, 193, 7, 0.1);
  border-left-color: #ffc107;
}

.alert.danger {
  background: rgba(244, 67, 54, 0.1);
  border-left-color: #f44336;
}

.alert.success {
  background: rgba(76, 175, 80, 0.1);
  border-left-color: #4caf50;
}

.alert p {
  margin-bottom: 0;
  color: var(--text-primary);
}

/* === COPY CODE BUTTON === */
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--docs-border);
}

.copy-btn {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: var(--accent-blue);
  transform: scale(1.05);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
  .docs-container {
    grid-template-columns: 250px 1fr;
    grid-template-areas: "sidebar main";
    gap: 1.5rem;
  }
  
  .docs-sidebar {
    padding: 1.5rem;
  }
  
  .docs-main {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .docs-header h1 {
    font-size: 2.5rem;
  }
  
  .docs-subtitle {
    font-size: 1.1rem;
  }
  
  .docs-container {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "main"
      "sidebar";
    gap: 1rem;
    padding: 1rem;
  }
  
  .docs-sidebar {
    position: static;
    order: 2;
    margin-top: 2rem;
  }
  
  .docs-main {
    padding: 1.5rem;
    order: 1;
  }
  
  .doc-section h2 {
    font-size: 1.8rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .doc-section h3 {
    font-size: 1.3rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .specs-table {
    font-size: 0.85rem;
  }
  
  .specs-table th,
  .specs-table td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .docs-header {
    padding: 2rem 0;
  }
  
  .docs-header h1 {
    font-size: 2rem;
  }
  
  .docs-search {
    margin: 0 1rem;
  }
  
  .docs-main {
    padding: 1rem;
  }
  
  .doc-section h2 {
    font-size: 1.5rem;
  }
  
  .specs-table,
  .specs-table thead,
  .specs-table tbody,
  .specs-table th,
  .specs-table td,
  .specs-table tr {
    display: block;
  }
  
  .specs-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .specs-table tr {
    border: 1px solid var(--docs-border);
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
  }
  
  .specs-table td {
    border: none !important;
    position: relative;
    padding-left: 50% !important;
    text-align: left;
  }
  
  .specs-table td:before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
    color: var(--accent-blue);
  }
}

/* === SMOOTH SCROLLING === */
html {
  scroll-behavior: smooth;
}

/* === SELECTION HIGHLIGHTING === */
::selection {
  background: var(--primary-blue);
  color: white;
}

::-moz-selection {
  background: var(--primary-blue);
  color: white;
}

/* === SCROLLBAR STYLING === */
.docs-main::-webkit-scrollbar,
.docs-sidebar::-webkit-scrollbar {
  width: 6px;
}

.docs-main::-webkit-scrollbar-track,
.docs-sidebar::-webkit-scrollbar-track {
  background: var(--darker-bg);
}

.docs-main::-webkit-scrollbar-thumb,
.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-blue);
  border-radius: 3px;
}

.docs-main::-webkit-scrollbar-thumb:hover,
.docs-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* === PRINT STYLES === */
@media print {
  .docs-header,
  .docs-sidebar {
    display: none;
  }
  
  .docs-container {
    grid-template-columns: 1fr;
  }
  
  .docs-main {
    box-shadow: none;
    background: white;
    color: black;
  }
  
  .doc-section h2,
  .doc-section h3,
  .doc-section h4 {
    color: black;
  }
}