/**********************************************/
/* MekHQ Guide Styles                         */
/**********************************************/

/* Sidebar */
.guide-sidebar {
  position: fixed;
  top: 70px;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 20px 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(40, 40, 40, 0.98) 0%, rgba(30, 30, 30, 0.98) 100%);
  border-right: 1px solid rgba(255, 250, 205, 0.2);
}

.sidebar-sticky {
  padding: 0 15px;
}

.guide-logo {
  color: #fffacd;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 250, 205, 0.2);
}

.guide-logo h5 {
  color: #fffacd;
  font-weight: 600;
  margin-bottom: 0;
}

/* Progress Bar */
.guide-progress {
  padding: 10px 0;
}

.guide-progress .progress-label {
  color: #adb5bd;
  margin-bottom: 5px;
}

.guide-progress .progress {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Navigation */
.guide-nav .nav-link {
  color: #dadfe1;
  padding: 10px 15px;
  border-radius: 8px;
  margin: 2px 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-nav .nav-link:hover {
  background: rgba(255, 250, 205, 0.1);
  color: #fffacd;
}

.guide-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(255, 250, 205, 0.2) 0%, transparent 100%);
  color: #fffacd;
  border-left: 3px solid #fffacd;
  font-weight: 600;
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 250, 205, 0.2);
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  color: #fffacd;
}

.guide-nav .nav-link.active .section-number {
  background: #fffacd;
  color: #282828;
}

/* Quick Links */
.quick-links h6 {
  color: #adb5bd;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quick-links .nav-link {
  color: #6c757d;
  padding: 5px 0;
  font-size: 0.85rem;
}

.quick-links .nav-link:hover {
  color: #fffacd;
}

/* Main Content Area */
.guide-content {
  padding-top: 20px;
  padding-bottom: 40px;
}

.guide-container {
  background-color: var(--background-color);
  min-height: calc(100vh - 70px);
}

/* Breadcrumb */
.guide-breadcrumb .breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

.guide-breadcrumb .breadcrumb-item a {
  color: var(--accent-color);
}

.guide-breadcrumb .breadcrumb-item.active {
  color: var(--text-color);
}

/* Page Header */
.guide-header {
  border-bottom: 2px solid rgba(255, 250, 205, 0.3);
  padding-bottom: 20px;
}

.guide-title {
  color: var(--text-color);
  font-weight: 700;
  text-align: left;
}

.guide-description {
  color: var(--text-color);
  opacity: 0.8;
}

/* Table of Contents */
.guide-toc {
  background: var(--card-color);
  border: 1px solid rgba(255, 250, 205, 0.2);
}

.guide-toc .card-header {
  background: rgba(255, 250, 205, 0.1);
  color: var(--text-color);
  font-weight: 600;
}

.guide-toc .card-body {
  padding: 15px;
}

.guide-toc ul {
  margin-bottom: 0;
  padding-left: 0;
}

.guide-toc ul li:before {
  content: none;
}

.guide-toc a {
  color: var(--accent-color);
  text-decoration: none;
}

.guide-toc a:hover {
  color: var(--accent-color-alternate);
}

/* Content Sections */
.guide-body h2 {
  color: var(--text-color);
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(128, 128, 128, 0.3);
  text-align: left;
}

.guide-body h3 {
  color: var(--accent-color-alternate);
  margin-top: 30px;
  text-align: left;
}

.guide-body h4 {
  color: var(--text-color);
  margin-top: 25px;
  text-align: left;
}

/* Images */
.guide-figure {
  margin: 25px 0;
  text-align: center;
}

.guide-image {
  max-width: 100%;
  border-radius: 8px;
  border: 2px solid rgba(255, 250, 205, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.guide-image:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 250, 205, 0.2);
  border-color: #fffacd;
}

.guide-caption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
  font-style: italic;
}

/* Tables */
.guide-table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  background: var(--card-color);
  border-radius: 8px;
  overflow: hidden;
}

.guide-table thead {
  background: linear-gradient(90deg, rgba(255, 250, 205, 0.2) 0%, rgba(255, 250, 205, 0.1) 100%);
}

.guide-table th {
  color: #fffacd;
  font-weight: 600;
  padding: 12px 15px;
  text-align: left;
  border-bottom: 2px solid rgba(255, 250, 205, 0.3);
}

.guide-table td {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
  color: var(--text-color);
}

.guide-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.1);
}

.guide-table tbody tr:hover {
  background: rgba(255, 250, 205, 0.05);
}

/* Callout Boxes */
.guide-callout {
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid;
}

.guide-callout-info {
  background: rgba(0, 123, 255, 0.1);
  border-color: #007bff;
}

.guide-callout-info .callout-title {
  color: #007bff;
}

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

.guide-callout-warning .callout-title {
  color: #ffc107;
}

.guide-callout-tip {
  background: rgba(40, 167, 69, 0.1);
  border-color: #28a745;
}

.guide-callout-tip .callout-title {
  color: #28a745;
}

.guide-callout-danger {
  background: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
}

.guide-callout-danger .callout-title {
  color: #dc3545;
}

.guide-callout-success {
  background: rgba(40, 167, 69, 0.15);
  border-color: #28a745;
}

.guide-callout-success .callout-title {
  color: #28a745;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Step Boxes */
.guide-step {
  display: flex;
  gap: 20px;
  margin: 25px 0;
  padding: 20px;
  background: var(--card-color);
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.2);
}

.step-number {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #fffacd 0%, #e6dfa0 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: #282828;
}

.step-content h4 {
  margin-top: 0;
  color: var(--text-color);
}

.step-content p:last-child {
  margin-bottom: 0;
}

/* Navigation Footer */
.guide-nav-footer {
  border-top: 1px solid rgba(128, 128, 128, 0.3);
  padding-top: 20px;
}

.btn-nav-prev,
.btn-nav-next {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px 20px;
  min-width: 200px;
  text-decoration: none;
}

.btn-nav-next {
  align-items: flex-end;
}

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

.nav-title {
  font-size: 1rem;
  font-weight: 600;
}

/* Collapsible Sections */
.guide-collapse-header {
  cursor: pointer;
  padding: 15px 20px;
  background: var(--card-color);
  border-radius: 8px;
  margin: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease;
}

.guide-collapse-header:hover {
  background: rgba(255, 250, 205, 0.1);
}

.guide-collapse-header .collapse-icon {
  transition: transform 0.2s ease;
}

.guide-collapse-header[aria-expanded="true"] .collapse-icon {
  transform: rotate(180deg);
}

/* Code Blocks in Guide */
.guide-body pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 250, 205, 0.2);
  border-radius: 8px;
  padding: 15px;
}

.guide-body code {
  color: #fffacd;
}

/* Glossary Entries */
.glossary-entry {
  padding: 20px;
  margin-bottom: 15px;
  background: var(--card-color);
  border-radius: 8px;
  border: 1px solid rgba(255, 250, 205, 0.2);
  transition: all 0.3s ease;
}

.glossary-entry:target,
.glossary-entry.glossary-highlight {
  border-color: #fffacd;
  box-shadow: 0 0 20px rgba(255, 250, 205, 0.3);
}

.glossary-term {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.glossary-term h3 {
  color: #fffacd;
  margin: 0;
  font-size: 1.25rem;
}

.glossary-anchor {
  color: rgba(255, 250, 205, 0.4);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.glossary-anchor:hover {
  color: #fffacd;
}

.glossary-definition {
  color: var(--text-color);
  line-height: 1.6;
}

.glossary-definition ul {
  margin-top: 10px;
  padding-left: 20px;
}

.glossary-link {
  color: var(--accent-color);
  text-decoration: none;
}

.glossary-link:hover {
  color: #fffacd;
}

/* Glossary Tooltips */
.glossary-term-link {
  color: #fffacd;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 250, 205, 0.5);
  cursor: help;
  position: relative;
}

.glossary-term-link:hover {
  color: #fff;
  border-bottom-color: #fffacd;
}

.glossary-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  border: 1px solid rgba(255, 250, 205, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  width: 300px;
  max-width: 90vw;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.glossary-term-link:hover .glossary-tooltip,
.glossary-term-link:focus .glossary-tooltip {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 10px);
}

.glossary-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(255, 250, 205, 0.3);
}

.glossary-tooltip-title {
  color: #fffacd;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.glossary-tooltip-title i {
  font-size: 0.8rem;
}

.glossary-tooltip-text {
  color: #ccc;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

.glossary-tooltip-more {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: rgba(255, 250, 205, 0.6);
}

/* Video Embeds */
.guide-video {
  margin: 25px 0;
  background: var(--card-color);
  border-radius: 8px;
  border: 1px solid rgba(255, 250, 205, 0.2);
  overflow: hidden;
}

.guide-video .video-header {
  background: rgba(255, 250, 205, 0.1);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fffacd;
  font-weight: 600;
}

.guide-video .video-header i {
  color: #ff0000;
}

.guide-video .video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.guide-video .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Keyboard Shortcuts */
kbd {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.85em;
  color: #fff;
  box-shadow: 0 2px 0 #1a1a1a;
}

/* Mobile Responsive */
@media (max-width: 767.98px) {
  .guide-sidebar {
    position: static;
    height: auto;
    padding: 15px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 250, 205, 0.2);
  }

  .guide-content {
    padding: 15px;
  }

  .btn-nav-prev,
  .btn-nav-next {
    min-width: auto;
    padding: 10px 15px;
  }

  .guide-step {
    flex-direction: column;
    text-align: center;
  }

  .step-number {
    margin: 0 auto;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Section Divider */
.guide-divider {
  display: flex;
  align-items: center;
  margin: 50px 0 30px;
  gap: 20px;
}

.guide-divider::before,
.guide-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 205, 0.4), transparent);
}

.guide-divider span {
  color: rgba(255, 250, 205, 0.7);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* TOC Divider */
.guide-toc .toc-divider {
  list-style: none;
  margin: 15px 0 10px;
  padding: 0;
}

.guide-toc .toc-divider hr {
  border: none;
  border-top: 1px solid rgba(255, 250, 205, 0.2);
  margin: 0 0 8px;
}

.guide-toc .toc-divider span {
  color: rgba(255, 250, 205, 0.5);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Animation for sections */
.guide-body section {
  animation: fadeIn 0.3s ease-out;
}

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