/**
 * Article Side Panel Styles
 * Clean, modern slide-in panel for articles
 */

/* Side Panel Container */
.article-side-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
}

.article-side-panel.open {
  pointer-events: auto;
}

/* Overlay */
.side-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.article-side-panel.open .side-panel-overlay {
  opacity: 1;
}

/* Panel Content */
.side-panel-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 650px;
  max-width: 90vw;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.article-side-panel.open .side-panel-content {
  transform: translateX(0);
}

/* Disable transition during resize for smooth dragging */
.side-panel-content.resizing {
  transition: none !important;
}

/* Resize Handle */
.resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.2s ease;
}

.resize-handle:hover {
  background: rgba(14, 104, 202, 0.1);
}

.resize-handle:hover .resize-handle-indicator {
  opacity: 1;
  background: #0e68ca;
}

/* Resize Handle Visual Indicator */
.resize-handle-indicator {
  width: 3px;
  height: 40px;
  background: #dee2e6;
  border-radius: 2px;
  opacity: 0.5;
  transition: all 0.2s ease;
  pointer-events: none;
}

/* Body cursor during resize */
body.modal-resizing {
  cursor: ew-resize !important;
  user-select: none;
}

body.modal-resizing * {
  cursor: ew-resize !important;
  user-select: none;
}

/* Header */
.side-panel-header {
  flex-shrink: 0;
  padding: 24px;
  border-bottom: 2px solid #e9ecef;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.side-panel-header .header-content {
  flex: 1;
  min-width: 0;
}

.side-panel-header .article-breadcrumbs {
  margin-bottom: 12px;
}

.side-panel-header .article-breadcrumbs a {
  display: inline-block;
  background: #0e68ca;
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.side-panel-header .article-breadcrumbs a:hover {
  background: #0c5ab5;
  color: #fff;
  text-decoration: none;
}

.side-panel-header .article-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.3;
}

/* Header Buttons Container */
.side-panel-header .header-buttons {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-panel-header .view-full-article {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  color: #6c757d;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.side-panel-header .view-full-article:hover {
  background: #0e68ca;
  border-color: #0e68ca;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(14, 104, 202, 0.3);
}

.side-panel-header .view-full-article i {
  font-size: 0.875rem;
}

/* Close Button */
.side-panel-header .close-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.side-panel-header .close-btn:hover {
  background: #0e68ca;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(14, 104, 202, 0.3);
}

.side-panel-header .close-btn:hover i {
  color: #fff;
}

.side-panel-header .close-btn i {
  font-size: 1.125rem;
  color: #495057;
}

/* Body */
.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
}

/* Article Content */
.article-body {
  font-size: 1rem;
  line-height: 1.6;
  color: #747474;
}

/* Ensure consistent font size and color for all body text */
.article-body p,
.article-body li,
.article-body span,
.article-body div:not(.kb-table-of-contents):not(.kb-table-of-contents-container),
.article-body strong,
.article-body em,
.article-body code {
  font-size: 1rem !important;
  color: #747474 !important;
}

/* Keep links blue but consistent size */
.article-body a {
  font-size: 1rem !important;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #212529;
  margin: 1.5rem 0 0.75rem 0;
}

.article-body p {
  margin-bottom: 1rem;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin: 0.5rem 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-body figure {
  margin: 1.5rem 0;
}

.article-body a {
  color: #0e68ca;
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

/* Hide table of contents */
.article-body .kb-table-of-contents,
.article-body .kb-table-of-contents-container {
  display: none;
}

/* Table Styles */
.article-body figure.table {
  overflow-x: auto;
  margin: 20px 0;
  display: inline-block;
  max-width: 100%;
}

.article-body figure.table table {
  width: auto !important;
  max-width: 100%;
  display: table;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.article-body table td,
.article-body table th {
  min-width: 80px;
  padding: 0.4em;
  border: 1px solid hsl(0, 0%, 90%);
  vertical-align: top;
}

.article-body table td:empty,
.article-body table th:empty {
  height: 20px;
}

/* Legacy table styles */
.article-body figure.table-legacy table td,
.article-body figure.table-legacy table th {
  min-width: unset !important;
  width: auto !important;
}

.article-body figure.table-legacy table thead th {
  white-space: normal !important;
}

/* Disable alternating row backgrounds for legacy tables */
.article-body figure.table-legacy table tbody tr:nth-child(odd) td,
.article-body figure.table-legacy table tbody tr:nth-child(even) td {
  background-color: transparent;
}

/* Feature comparison table styles */
.article-body table td.feature-header,
.article-body .kb-article-body-content table td.feature-header {
  background-color: #A7E163 !important;
  border: 1px solid hsl(0, 0%, 90%) !important;
}

.article-body table td.feature-unavailable,
.article-body .kb-article-body-content table td.feature-unavailable {
  background-color: #ffcccc !important;
  border: 1px solid hsl(0, 0%, 90%) !important;
}

.article-body table td.feature-cell,
.article-body .kb-article-body-content table td.feature-cell {
  border: 1px solid hsl(0, 0%, 90%) !important;
}

.article-body .feature-text-center {
  text-align: center !important;
}

.article-body .feature-large-text {
  font-size: 30px !important;
}

.article-body .feature-unavailable-text {
  color: hsl(6, 59%, 50%) !important;
}

/* Pre/Code Block Styles (for troubleshooting information, etc.) */
.article-body pre,
.article-body .kb-editor-content pre,
.article-body .kb-article-body-content pre {
  padding: 1em !important;
  color: #353535;
  background: hsla(0, 0%, 78%, .3) !important;
  border: 1px solid #c4c4c4;
  border-radius: 2px;
  text-align: left;
  direction: ltr;
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  white-space: pre-wrap;
  font-style: normal;
  min-width: 200px;
  margin: 1rem 0;
}

.article-body pre code,
.article-body .kb-editor-content pre code,
.article-body .kb-article-body-content pre code {
  font-size: 16px !important;
  background: none !important;
  padding: 0;
  border-radius: 0;
  border: none;
  color: #353535 !important;
}

/* Blockquote Styles */
.article-body blockquote {
  border-left: solid 5px #5e35b1 !important;
  margin: 1.5rem 0 !important;
  padding: 1rem 1rem 1rem 1.5rem !important;
  background: linear-gradient(to right, rgba(94, 53, 177, 0.08), rgba(94, 53, 177, 0.02)) !important;
  color: #5e35b1 !important;
  font-style: italic;
  position: relative;
}

.article-body blockquote::before {
  content: '"';
  font-size: 3rem;
  line-height: 1;
  position: absolute;
  left: 0.3rem;
  top: -0.5rem;
  color: #5e35b1;
  opacity: 0.3;
  font-family: Georgia, serif;
}

.article-body blockquote p,
.article-body blockquote span,
.article-body blockquote strong,
.article-body blockquote em {
  color: #5e35b1 !important;
}

.article-body blockquote p {
  margin-bottom: 0.5rem;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Callout Styles */
.article-body .kb-callout {
  border-radius: 8px;
  padding: 10px 20px;
  margin: 10px 0;
}

.article-body .kb-callout .kb-callout-delete {
  display: none !important;
}

.article-body .kb-callout .kb-callout-body {
  border: none !important;
  box-shadow: none !important;
}

/* Info Callout (Light Blue) */
.article-body .kb-callout.info {
  background: #cce5ff;
  border: 3px solid #004085;
}

.article-body .kb-callout.info .kb-callout-body {
  background: #cce5ff !important;
}

/* Warning Callout (Yellow) */
.article-body .kb-callout.warning {
  background: #fff3cd;
  border: 3px solid #856404;
}

.article-body .kb-callout.warning .kb-callout-body {
  background: #fff3cd !important;
}

/* Success Callout (Green) */
.article-body .kb-callout.success {
  background: #d4edda;
  border: 3px solid #155724;
}

.article-body .kb-callout.success .kb-callout-body {
  background: #d4edda !important;
}

/* Danger Callout (Red) */
.article-body .kb-callout.danger {
  background: #f8d7da;
  border: 3px solid #721c24;
}

.article-body .kb-callout.danger .kb-callout-body {
  background: #f8d7da !important;
}

/* Navigation Arrows - Consistent Colors */
.article-body .se-nav-button,
.article-body .se-nav-button-multi,
.article-body .se-nav-button span,
.article-body .se-nav-button-multi span,
.article-body .se-nav-button .se-nav-arrow,
.article-body .se-nav-button .se-nav-text {
  color: #333 !important;
}

.article-body .se-nav-button:visited,
.article-body .se-nav-button-multi:visited,
.article-body .se-nav-button:visited span,
.article-body .se-nav-button-multi:visited span,
.article-body .se-nav-button:visited .se-nav-arrow,
.article-body .se-nav-button:visited .se-nav-text {
  color: #333 !important;
}

/* Accordion Styles */
.article-body .kb-accordion {
  position: relative;
  border: 2px solid #e1e1e1 !important;
  margin: 10px 0;
  border-radius: 5px;
}

.article-body .kb-accordion .kb-accordion-title {
  font-size: 1.25rem !important;
  font-weight: 400 !important;
  margin: 0 !important;
  padding: 10px 60px 10px 20px;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: #212529 !important;
}

.article-body .kb-accordion .kb-accordion-body {
  display: none !important;
  margin: 0 !important;
  padding: 10px 10px 10px 20px;
  border: none !important;
  box-shadow: none !important;
}

.article-body .kb-accordion .kb-accordion-body.active-content {
  display: block !important;
}

.article-body .kb-accordion .kb-accordion-toggle {
  position: absolute !important;
  top: 12px;
  right: 12px;
  z-index: 10;
  outline: none !important;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #e1e1e1;
  border-radius: 50%;
}

.article-body .kb-accordion .kb-accordion-toggle:before {
  position: absolute;
  content: "";
  width: 7px;
  height: 7px;
  border-left: 2px solid #999;
  border-top: 2px solid #999;
  display: block;
  transform: rotate(-135deg);
  margin: -2px 0 0;
}

.article-body .kb-accordion .kb-accordion-delete {
  display: none !important;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loading-state .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e9ecef;
  border-top-color: #0e68ca;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-state p {
  color: #6c757d;
  font-size: 1rem;
  margin: 0;
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.error-state i {
  font-size: 3rem;
  color: #dc3545;
  margin-bottom: 16px;
}

.error-state h4 {
  color: #212529;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-state p {
  color: #6c757d;
  margin-bottom: 16px;
}

.error-state .btn-link {
  color: #0e68ca;
  text-decoration: none;
  font-weight: 500;
}

.error-state .btn-link:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .side-panel-content {
    width: 100%;
  }

  .side-panel-header {
    padding: 16px;
  }

  .side-panel-header .article-title {
    font-size: 1.25rem;
  }

  .side-panel-body {
    padding: 24px 16px;
  }

  .article-body {
    font-size: 0.9375rem;
  }

  .article-body h2 {
    font-size: 1.25rem;
  }

  .article-body h3 {
    font-size: 1.125rem;
  }
}

@media (min-width: 1280px) {
  .side-panel-content {
    width: 750px;
  }
}

/* Override conflicting styles */
.article-modal {
  display: none !important;
}
