/* Academic Blue Theme - Predicting the Next Word Book */
/* Color Palette based on Wong colorblind-safe colors */

:root {
  /* Primary colors */
  --primary: #0072B2;
  --primary-dark: #005a8c;
  --primary-light: #3d9fd4;

  /* Wong colorblind-safe palette */
  --wong-blue: #0072B2;
  --wong-orange: #E69F00;
  --wong-green: #009E73;
  --wong-red: #D55E00;
  --wong-cyan: #56B4E9;
  --wong-pink: #CC79A7;
  --wong-yellow: #F0E442;

  /* Semantic colors */
  --success: #009E73;
  --warning: #E69F00;
  --danger: #D55E00;
  --info: #56B4E9;

  /* Neutrals */
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --bg-light: #f8f9fa;
  --bg-dark: #343a40;
  --border-color: #dee2e6;
}

/* Typography */
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.lead {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-secondary);
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Navigation */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--primary) !important;
}

.nav-link.active {
  color: var(--primary) !important;
  border-bottom: 2px solid var(--primary);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.book-stats {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Cards */
.card {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.hover-shadow:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.card-header {
  background-color: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
}

/* Chapter Cards */
.chapter-card .card {
  border-left: 4px solid var(--primary);
}

.chapter-card .card:hover {
  border-left-color: var(--primary-dark);
}

.chapter-card[data-status="complete"] .card {
  border-left-color: var(--success);
}

.chapter-card[data-status="in-progress"] .card {
  border-left-color: var(--warning);
}

.chapter-card[data-status="planned"] .card {
  border-left-color: var(--text-muted);
}

/* Figure Cards */
.figure-card {
  border: none;
  overflow: hidden;
}

.figure-card img,
.figure-placeholder {
  transition: transform 0.3s ease;
}

.figure-card:hover img,
.figure-card:hover .figure-placeholder {
  transform: scale(1.05);
}

.figure-placeholder {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Progress Components */
.progress {
  background-color: var(--bg-light);
  border-radius: 0.5rem;
  overflow: hidden;
}

.progress-bar {
  transition: width 0.6s ease;
}

.progress-circle {
  position: relative;
}

.circular-chart {
  display: block;
  margin: 0 auto;
}

.circle-bg {
  fill: none;
  stroke: #eee;
  stroke-width: 3;
}

.circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  animation: progress 1s ease-out forwards;
}

@keyframes progress {
  0% { stroke-dasharray: 0 100; }
}

/* Stat Cards */
.stat-card {
  border-radius: 0.5rem;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.4em 0.8em;
}

.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-primary { background-color: var(--primary) !important; }

/* Buttons */
.btn {
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-light {
  background-color: #fff;
  border-color: #fff;
  color: var(--primary);
}

.btn-light:hover {
  background-color: var(--bg-light);
  color: var(--primary-dark);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
}

/* Filter Controls */
.filter-controls .form-select,
.filter-controls .form-control {
  border-color: var(--border-color);
  border-radius: 0.375rem;
}

.filter-controls .form-select:focus,
.filter-controls .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 114, 178, 0.25);
}

.btn-group .btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Author Section */
.author-section .author-image {
  position: relative;
}

.author-card {
  border: 1px solid var(--border-color);
}

.social-links .btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Citation Box */
.citation-box {
  border-left: 4px solid var(--primary);
}

.citation-box pre {
  margin: 0;
  font-size: 0.875rem;
}

/* Color Palette Display */
.color-swatch {
  text-align: center;
}

.color-swatch div {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Milestones */
.milestone-marker {
  flex-shrink: 0;
}

.milestone-content {
  padding-top: 0.25rem;
}

/* Recent Updates */
.update-item {
  transition: border-color 0.2s ease;
}

.update-item:hover {
  border-color: var(--primary) !important;
}

/* Footer */
footer {
  background-color: var(--bg-dark);
  color: rgba(255, 255, 255, 0.8);
}

footer a {
  color: rgba(255, 255, 255, 0.8);
}

footer a:hover {
  color: #fff;
}

footer h5 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero .lead {
    font-size: 1.1rem;
  }

  .book-stats {
    margin-top: 2rem;
  }

  .display-5 {
    font-size: 2rem;
  }

  .display-6 {
    font-size: 1.5rem;
  }
}

/* Print styles */
@media print {
  .navbar,
  footer,
  .btn,
  .filter-controls {
    display: none !important;
  }

  .card {
    break-inside: avoid;
    border: 1px solid #000;
  }

  a {
    text-decoration: none;
    color: #000;
  }
}

/* Accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus states for accessibility */
a:focus,
button:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* GLightbox customization */
.gslide-title {
  font-family: inherit;
}

.gslide-desc {
  font-family: inherit;
  color: var(--text-secondary);
}

/* Part Section Headers */
.part-section h2 {
  color: var(--primary);
  font-weight: 600;
}

/* Info Cards */
.book-info-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.book-info-card table td {
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

/* Contact Cards */
.contact-card {
  transition: border-color 0.2s ease;
}

.contact-card:hover {
  border-color: var(--primary) !important;
}

/* Key Concepts Summary */
.key-concepts-summary ul {
  padding-left: 1.25rem;
}

.key-concepts-summary li {
  margin-bottom: 0.25rem;
}

/* Reproducibility Section */
.reproducibility pre {
  margin: 0;
  font-size: 0.875rem;
}
