/* ==========================================================================
   Unity Project Documentation Styles
   ========================================================================== */

/* CSS Variables for Theme Support */
:root {
  /* Light Theme Colors */
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --info-color: #9b59b6;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-card: #ffffff;
  --bg-modal: rgba(0, 0, 0, 0.8);
  
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --text-inverse: #ffffff;
  
  --border-color: #dee2e6;
  --border-light: #e9ecef;
  --shadow-light: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-medium: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-dark: linear-gradient(135deg, #434343 0%, #000000 100%);
  
  /* Animations */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-code: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #161b22;
  --bg-modal: rgba(0, 0, 0, 0.9);
  
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-inverse: #0d1117;
  
  --border-color: #30363d;
  --border-light: #21262d;
  --shadow-light: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
  --shadow-heavy: 0 1rem 3rem rgba(0, 0, 0, 0.5);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-medium), color var(--transition-medium);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  transition: all var(--transition-medium);
}

[data-theme="dark"] .navbar {
  background: rgba(13, 17, 23, 0.95);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.nav-brand i {
  font-size: 1.5rem;
  color: var(--secondary-color);
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--secondary-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-medium);
}

.nav-link:hover::after {
  width: 100%;
}

.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-medium);
  color: var(--text-secondary);
}

.theme-toggle:hover {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  transform: scale(1.1);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--gradient-primary);
  overflow: hidden;
}

.hero-background {
  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.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-10px) translateY(-10px); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 3rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease 0.2s both;
}

.hero-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease 0.3s both;
}

.hero-author i {
  font-size: 1rem;
  opacity: 0.8;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  animation: fadeInUp 1s ease 0.4s both;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

/* Section Styles */
.section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4rem;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Features Section */
.features-section {
  background: var(--bg-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-medium);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-medium);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  background: var(--gradient-primary);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: white;
  font-size: 1.5rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.feature-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Feature Modal */
.feature-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-modal);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.feature-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 1rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

/* Code Styles */
.code-example {
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 2rem;
}

.code-header {
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.code-filename {
  font-family: var(--font-code);
  font-weight: 500;
  color: var(--text-primary);
}

.copy-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-code);
  line-height: 1.5;
}

code {
  font-family: var(--font-code);
  background: var(--bg-tertiary);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

pre code {
  background: none;
  padding: 0;
}

/* Codebase Section */
.search-filter {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 500;
}

.filter-tag:hover,
.filter-tag.active {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

.code-file-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all var(--transition-medium);
  opacity: 1;
  transform: scale(1);
}

.code-file-card.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.code-file-card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.file-header {
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.file-icon {
  width: 3rem;
  height: 3rem;
  background: var(--gradient-primary);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
}

.file-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.file-path {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-code);
}

.file-status {
  flex-shrink: 0;
}

.status-badge {
  background: var(--success-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.file-description {
  padding: 0 1.5rem 1rem;
}

.file-description p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.file-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-badge {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.file-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.75rem;
}

.action-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: unset;
  flex: unset;
}

.action-btn:hover {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

.view-btn:hover {
  background: var(--secondary-color);
  color: white;
}

/* Architecture Section */
.architecture-diagram {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-light);
}

.diagram-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.layer {
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border-left: 4px solid transparent;
  transition: all var(--transition-medium);
}

.presentation-layer {
  border-left-color: #e74c3c;
}

.business-layer {
  border-left-color: #3498db;
}

.data-layer {
  border-left-color: #27ae60;
}

.utility-layer {
  border-left-color: #f39c12;
}

.layer h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.layer-components {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.component {
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-light);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.component:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

/* API Section - Modern Design */
.api-section {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.api-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
}

.api-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 3rem;
  background: var(--bg-card);
  padding: 0.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-light);
}

.api-tab {
  background: transparent;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
}

.api-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.6s;
}

.api-tab:hover::before {
  left: 100%;
}

.api-tab.active {
  background: linear-gradient(135deg, var(--secondary-color), #2980b9);
  color: white;
  box-shadow: 0 8px 32px rgba(52, 152, 219, 0.3);
  transform: translateY(-2px);
}

.api-tab-content {
  display: none;
  animation: fadeInUp 0.5s ease-out;
}

.api-tab-content.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.api-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 1.25rem;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.api-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary-color), var(--info-color), var(--success-color));
}

.api-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

.api-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.api-name {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-code);
  background: linear-gradient(135deg, var(--text-primary), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.api-type {
  background: linear-gradient(135deg, var(--info-color), #8e44ad);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.api-description {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.8;
  font-size: 1.1rem;
}

.api-methods,
.api-properties,
.api-examples {
  margin-bottom: 2.5rem;
}

.api-methods h4,
.api-properties h4,
.api-examples h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.api-methods h4::before {
  content: '⚡';
  font-size: 1.5rem;
}

.api-properties h4::before {
  content: '🔧';
  font-size: 1.5rem;
}

.api-examples h4::before {
  content: '💡';
  font-size: 1.5rem;
}

.method-item,
.property-item,
.example-item {
  background: var(--bg-secondary);
  padding: 1.75rem;
  border-radius: 1rem;
  margin-bottom: 1.25rem;
  border-left: 4px solid var(--secondary-color);
  transition: all 0.3s ease;
  position: relative;
}

.method-item:hover,
.property-item:hover {
  background: var(--bg-tertiary);
  border-left-color: var(--success-color);
  transform: translateX(4px);
}

.method-item code {
  display: inline-block;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
  background: rgba(52, 152, 219, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(52, 152, 219, 0.2);
}

.method-item p,
.property-item p {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  line-height: 1.7;
}

.method-params {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(52, 152, 219, 0.05);
  border-radius: 0.75rem;
  border: 1px solid rgba(52, 152, 219, 0.1);
}

.method-params strong {
  color: var(--text-primary);
  font-weight: 700;
}

.method-params ul {
  margin: 0.75rem 0 0 0;
  padding-left: 1rem;
}

.method-params li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.method-params code {
  background: var(--secondary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.required {
  color: var(--accent-color);
  font-weight: bold;
  margin-left: 0.25rem;
}

.readonly {
  background: var(--warning-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.method-example {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
}

.method-example strong {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: block;
}

.method-example pre {
  margin: 0;
  padding: 1rem;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

.example-item {
  border-left-color: var(--success-color);
}

.example-item pre {
  margin: 0;
  padding: 1.5rem;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 0.75rem;
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.7;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Visual Studio Dark Theme Code Highlighting */
.language-csharp {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

/* C# Keywords */
.language-csharp .keyword {
  color: #569cd6 !important; /* Blue for keywords */
  font-weight: bold;
}

/* C# Types */
.language-csharp .type {
  color: #4ec9b0 !important; /* Teal for types */
}

/* C# Strings */
.language-csharp .string {
  color: #ce9178 !important; /* Orange for strings */
}

/* C# Comments */
.language-csharp .comment {
  color: #6a9955 !important; /* Green for comments */
  font-style: italic;
}

/* C# Numbers */
.language-csharp .number {
  color: #b5cea8 !important; /* Light green for numbers */
}

/* C# Methods */
.language-csharp .method {
  color: #dcdcaa !important; /* Yellow for methods */
}

/* C# Properties */
.language-csharp .property {
  color: #9cdcfe !important; /* Light blue for properties */
}

/* C# Local Variables (메소드 내 변수) */
.language-csharp .local-variable {
  color: #9cdcfe !important; /* Light blue for local variables */
}

/* C# Class Variables (클래스 멤버 변수) */
.language-csharp .class-variable {
  color: #d4d4d4 !important; /* Default text color for class variables */
}

/* C# Parameters (매개변수) */
.language-csharp .parameter {
  color: #9d9d9d !important; /* Gray color for parameters */
}

/* C# Operators */
.language-csharp .operator {
  color: #d4d4d4 !important; /* White for operators */
}

/* C# Punctuation */
.language-csharp .punctuation {
  color: #d4d4d4 !important; /* White for punctuation */
}

/* C# Classes */
.language-csharp .class-name {
  color: #4ec9b0 !important; /* Teal for class names */
  font-weight: bold;
}

/* C# Attributes */
.language-csharp .attribute {
  color: #92c5f7 !important; /* Light blue for attributes */
}

/* Generic syntax highlighting for code blocks */
pre code {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  display: block;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 0.5rem;
}

/* Code block wrapper */
.code-example {
  background: #1e1e1e;
  border-radius: 0.75rem;
  border: 1px solid #333;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin: 1rem 0;
}

.code-header {
  background: #2d2d30;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #333;
  border-radius: 0.75rem 0.75rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-filename {
  color: #cccccc;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

.copy-btn {
  background: transparent;
  border: 1px solid #555;
  color: #cccccc;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.copy-btn:hover {
  background: #333;
  border-color: #777;
  color: #fff;
}

/* Scrollbar styling for dark theme */
pre::-webkit-scrollbar {
  height: 8px;
}

pre::-webkit-scrollbar-track {
  background: #2d2d30;
  border-radius: 4px;
}

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

pre::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* Code Viewer Modal */
.code-viewer-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-modal);
  z-index: 3000;
}

.code-viewer-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-viewer-content {
  background: var(--bg-card);
  border-radius: 1rem;
  width: 90vw;
  max-width: 1200px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.code-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-tertiary);
}

.code-viewer-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.code-action-btn {
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-action-btn:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

.code-viewer-body {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-secondary);
}

.code-viewer-body pre {
  height: 100%;
  margin: 0;
  padding: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-stats {
    gap: 2rem;
  }
  
  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  
  .code-grid {
    grid-template-columns: 1fr;
  }
  
  .search-filter {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
  }
  
  .nav-menu {
    display: none;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .file-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .file-actions {
    flex-direction: column;
  }
  
  .api-tabs {
    flex-direction: column;
  }
  
  .diagram-container {
    gap: 0.75rem;
  }
  
  .layer-components {
    flex-direction: column;
  }
  
  .code-viewer-content {
    width: 95vw;
    height: 90vh;
  }
  
  .code-viewer-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .code-viewer-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  .code-file-card {
    margin-bottom: 1rem;
  }
  
  .file-header {
    padding: 1rem;
  }
  
  .file-description {
    padding: 0 1rem 1rem;
  }
  
  .file-actions {
    padding: 1rem;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .theme-toggle,
  .hero,
  .action-btn,
  .code-action-btn {
    display: none;
  }
  
  .section {
    padding: 2rem 0;
    page-break-inside: avoid;
  }
  
  .feature-card,
  .code-file-card,
  .api-item {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000;
    --border-light: #000;
  }
  
  .feature-card,
  .code-file-card,
  .api-item {
    border-width: 2px;
  }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
.nav-link:focus,
.feature-card:focus,
.code-file-card:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Smooth scrolling for reduced motion users */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.pagination-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1.1rem;
  border-radius: 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  margin: 0 4px;
  transition: all var(--transition-fast);
  box-shadow: none;
}
.pagination-btn.active {
  background: var(--secondary-color);
  color: #fff;
  border-color: var(--secondary-color);
  font-size: 1.08rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.08);
}
#pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}