/* Bitoyo API - Complete Enhanced Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-color: #3ab2ee;
  --primary-dark: #2098d1;
  --primary-light: #5bc3f2;
  --primary-glow: rgba(58, 178, 238, 0.6);
  --primary-subtle: rgba(58, 178, 238, 0.08);
  --primary-medium: rgba(58, 178, 238, 0.15);
  --primary-strong: rgba(58, 178, 238, 0.25);
  
  --sidebar-width: 340px;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'JetBrains Mono', 'SF Mono', Consolas, Monaco, monospace;
  
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-backdrop: blur(24px) saturate(180%);
  --glass-strong: rgba(255, 255, 255, 0.15);
  
  /* Dark theme */
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f16;
  --bg-tertiary: #16161f;
  --bg-card: rgba(22, 22, 31, 0.8);
  
  --text-primary: #ffffff;
  --text-secondary: #b8b8cc;
  --text-muted: #666688;
  
  --border-primary: rgba(255, 255, 255, 0.08);
  --border-secondary: rgba(255, 255, 255, 0.04);
  
  --sidebar-bg: rgba(10, 10, 15, 0.98);
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-neon: 0 0 20px var(--primary-glow), 0 0 40px rgba(58, 178, 238, 0.3);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #fafbfc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f5;
  --bg-card: rgba(255, 255, 255, 0.95);
  
  --text-primary: #0d1117;
  --text-secondary: #1c2128;
  --text-muted: #656d76;
  
  --border-primary: rgba(0, 0, 0, 0.15);
  --border-secondary: rgba(0, 0, 0, 0.08);
  
  --sidebar-bg: rgba(255, 255, 255, 0.98);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.95);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.18), 0 10px 10px rgba(0, 0, 0, 0.08);
}

/* Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

body.menu-open {
  overflow: hidden;
}

/* Background animation */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 25% 75%, var(--primary-subtle) 0%, transparent 60%),
    radial-gradient(circle at 75% 25%, var(--primary-subtle) 0%, transparent 60%);
  animation: pulse 15s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Mobile menu button */
.mobile-menu-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  gap: 4px;
  box-shadow: var(--shadow-lg);
}

.mobile-menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
  background: var(--primary-color);
  transform: scale(1.05);
  box-shadow: var(--shadow-neon);
}

.mobile-menu-btn:hover span {
  background: white;
}

/* Active state - X */
.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile overlay */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: var(--glass-backdrop);
  border-right: 1px solid var(--border-primary);
  z-index: 50;
  transition: all 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

/* App name */
.app-name {
  display: flex;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border-secondary);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 80px;
}

.app-name-link {
  display: block;
  transition: all 0.3s ease;
}

.app-name-link:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.app-name img {
  max-width: 180px;
  height: auto;
}

/* Enhanced Search */
.search {
  padding: 24px;
  border-bottom: 1px solid var(--border-secondary);
}

.search .input-wrap {
  position: relative;
}

.search input {
  width: 100%;
  padding: 20px 24px;
  background: var(--glass-strong);
  backdrop-filter: var(--glass-backdrop);
  border: 2px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  height: 60px;
}

.search input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.search input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-subtle), var(--shadow-neon);
  background: var(--glass-strong);
  transform: translateY(-2px);
}

/* Search results */
.search .results-panel {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  margin-top: 8px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.search .results-panel .matching-post {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-secondary);
  transition: all 0.3s ease;
  cursor: pointer;
}

.search .results-panel .matching-post:hover {
  background: var(--primary-subtle);
  transform: translateX(4px);
}

.search .results-panel .matching-post:last-child {
  border-bottom: none;
}

/* Navigation */
.sidebar ul {
  list-style: none;
  padding: 24px 0;
  flex: 1;
}

.sidebar ul li a {
  display: block;
  padding: 12px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  margin: 2px 8px;
  border-radius: 8px;
}

.sidebar ul li a:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
  border-left-color: var(--primary-color);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.sidebar ul li.active > a {
  color: var(--primary-color);
  background: var(--primary-medium);
  border-left-color: var(--primary-color);
  font-weight: 600;
  box-shadow: inset 0 0 20px var(--primary-subtle);
}

.sidebar ul li strong {
  display: block;
  padding: 24px 24px 8px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.9;
}

/* Content */
.content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  transition: all 0.3s ease;
}

.markdown-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px;
  min-height: 100vh;
}

/* Typography */
.markdown-section h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 48px;
  background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  line-height: 1.2;
}

.markdown-section h1::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 4px;
  box-shadow: var(--shadow-neon);
}

.markdown-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 48px 0 32px;
  position: relative;
  line-height: 1.3;
}

.markdown-section h2::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 32px;
  background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
  border-radius: 4px;
  box-shadow: var(--shadow-neon);
}

.markdown-section h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 24px;
}

.markdown-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
  font-size: 15px;
}

[data-theme="light"] .markdown-section p {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Enhanced Tables */
.markdown-section table {
  width: 100%;
  margin: 32px 0;
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-primary);
  border-collapse: separate;
  border-spacing: 0;
  display: table;
}

.markdown-section thead {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--primary-subtle));
}

.markdown-section th {
  color: var(--text-primary);
  padding: 20px 24px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--border-primary);
  border-right: 1px solid var(--border-secondary);
  position: relative;
}

.markdown-section th:last-child {
  border-right: none;
}

.markdown-section th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
}

.markdown-section td {
  padding: 16px 24px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-secondary);
  border-right: 1px solid var(--border-secondary);
  font-weight: 500;
  vertical-align: top;
}

.markdown-section td:last-child {
  border-right: none;
}

.markdown-section tbody tr {
  transition: all 0.3s ease;
}

.markdown-section tbody tr:hover {
  background: var(--primary-subtle);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--primary-subtle);
}

.markdown-section tbody tr:last-child td {
  border-bottom: none;
}

/* Special table cells */
.markdown-section td code {
  background: var(--primary-subtle);
  color: var(--primary-color);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 600;
}

/* Lists */
.markdown-section ul,
.markdown-section ol {
  color: var(--text-secondary);
  padding-left: 32px;
  margin-bottom: 24px;
}

.markdown-section li {
  margin-bottom: 8px;
  line-height: 1.7;
}

/* Blockquotes */
.markdown-section blockquote {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border-left: 4px solid var(--primary-color);
  border-radius: 0 16px 16px 0;
  margin: 32px 0;
  padding: 24px 32px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.markdown-section blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 48px;
  color: var(--primary-color);
  opacity: 0.3;
}

.markdown-section blockquote p {
  color: var(--text-secondary);
  margin: 0;
  font-style: italic;
  font-weight: 500;
}

/* Code */
.markdown-section pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  margin: 32px 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.markdown-section pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
}

.markdown-section pre code {
  display: block;
  padding: 32px;
  color: var(--text-primary);
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
}

.markdown-section p code,
.markdown-section li code {
  background: var(--glass-bg);
  color: var(--primary-color);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-code);
  font-size: 0.9em;
  font-weight: 600;
  border: 1px solid var(--glass-border);
}

[data-theme="light"] .markdown-section p code,
[data-theme="light"] .markdown-section li code {
  background: rgba(58, 178, 238, 0.1);
  color: var(--primary-dark);
  border: 1px solid rgba(58, 178, 238, 0.2);
}

/* Tabs */
.docsify-tabs__tab {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  border-radius: 12px 12px 0 0;
  padding: 12px 24px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  margin-right: 4px;
}

.docsify-tabs__tab:hover {
  background: var(--primary-subtle);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.docsify-tabs__tab--active {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-neon);
  transform: translateY(-2px);
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary-light);
  text-shadow: 0 0 8px var(--primary-glow);
}

[data-theme="light"] a {
  color: var(--primary-dark);
  font-weight: 600;
}

/* Theme toggle */
.theme-switcher {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
}

.theme-toggle-btn {
  width: 56px;
  height: 56px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  font-size: 24px;
}

.theme-toggle-btn:hover {
  background: var(--primary-color);
  transform: scale(1.1) rotate(10deg);
  box-shadow: var(--shadow-neon);
}

.theme-toggle-btn:hover #theme-icon {
  filter: brightness(0) invert(1);
}

/* Copy button */
.docsify-copy-code-button {
  background: var(--primary-color) !important;
  border-radius: 8px !important;
  color: white !important;
  border: none !important;
  padding: 8px 16px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  transition: all 0.3s ease !important;
  box-shadow: var(--shadow-md) !important;
}

.docsify-copy-code-button:hover {
  transform: scale(1.05) !important;
  box-shadow: var(--shadow-neon) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex !important;
  }
  
  .sidebar {
    transform: translateX(-100%);
    width: 85vw;
    max-width: 320px;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .content {
    margin-left: 0;
  }
  
  .markdown-section {
    padding: 24px;
    padding-top: 80px;
  }
  
  .markdown-section h2::before {
    left: -16px;
    width: 3px;
    height: 24px;
  }
  
  .theme-toggle-btn {
    width: 48px;
    height: 48px;
    bottom: 24px;
    right: 24px;
    font-size: 20px;
  }
  
  .app-name img {
    max-width: 140px;
  }
  
  /* Mobile'da tablolar responsive */
  .markdown-section table {
    font-size: 14px;
  }
  
  .markdown-section th,
  .markdown-section td {
    padding: 12px 16px;
  }
  
  .search input {
    padding: 18px 20px;
    font-size: 14px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 90vw;
    max-width: 280px;
  }
  
  .markdown-section {
    padding: 16px;
    padding-top: 80px;
  }
  
  .mobile-menu-btn {
    width: 40px;
    height: 40px;
    top: 16px;
    left: 16px;
  }
  
  .mobile-menu-btn span {
    width: 18px;
  }
  
  .app-name img {
    max-width: 120px;
  }
  
  /* Küçük ekranlarda tablolar daha kompakt */
  .markdown-section table {
    font-size: 12px;
  }
  
  .markdown-section th,
  .markdown-section td {
    padding: 8px 12px;
  }
  
  .search input {
    padding: 16px 18px;
    font-size: 13px;
    height: 52px;
  }
}

/* Extra responsive table handling */
@media (max-width: 640px) {
  .markdown-section table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border-radius: 12px;
  }
  
  .markdown-section table tbody {
    display: table;
    width: 100%;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-bg);
  border-radius: 50px;
  border: 1px solid var(--glass-border);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
  box-shadow: var(--shadow-neon);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--glass-bg);
  border-radius: 50px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Loading animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.markdown-section > * {
  animation: slideInUp 0.6s ease-out;
}

/* Focus states for accessibility */
.mobile-menu-btn:focus,
.theme-toggle-btn:focus,
.search input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .sidebar,
  .theme-switcher,
  .mobile-overlay,
  .mobile-menu-btn {
    display: none !important;
  }
  
  .content {
    margin-left: 0 !important;
  }
  
  .markdown-section {
    max-width: none !important;
    padding: 0 !important;
  }
  
  .markdown-section h2::before,
  .markdown-section h1::after {
    display: none;
  }
  
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
}

/* Enhanced hover effects */
.markdown-section table tbody tr:hover td {
  background: var(--primary-subtle);
  color: var(--text-primary);
}

.markdown-section table tbody tr:hover td code {
  background: var(--primary-color);
  color: white;
}

/* Better spacing for nested lists */
.markdown-section ul ul,
.markdown-section ol ol {
  margin-top: 8px;
  margin-bottom: 8px;
}

/* Enhanced code highlighting */
.markdown-section pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

/* Better selection */
::selection {
  background: var(--primary-medium);
  color: var(--text-primary);
}

::-moz-selection {
  background: var(--primary-medium);
  color: var(--text-primary);
}