/* COLOR VARIABLES*/
:root {
  --header-bg-color: #0d47a1;
  --header-ft-color: #fff;
  --highlight-light: #5e92f3;
  --highlight-dark: #003c8f;
  --accent-dim: #eee;
  --font-color: #34393e;
  --card-box-shadow: 0 1px 2px 0 rgba(61, 65, 68, 0.06), 0 1px 3px 1px rgba(61, 65, 68, 0.16);
  --under-box-shadow: 0 4px 4px -2px #eee;
  --search-box-shadow: 0px 0px 5px 0px rgba(255,255,255,1);
}

/* Fix for homepage scrolling issue - override DocFX's height constraint */
html, body {
  height: auto !important;
  min-height: 100%;
}

body {
  color: var(--font-color);
  font-family: "Roboto", sans-serif;
  line-height: 1.5;
  font-size: 16px;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  word-wrap: break-word;
}

/* HIGHLIGHT COLOR */

button,
a {
  color: var(--highlight-dark);
  cursor: pointer;
}

button:hover,
button:focus,
a:hover,
a:focus {
  color: var(--highlight-light);
  text-decoration: none;
}

.toc .nav > li.active > a {
  color: var(--highlight-dark);
}

.toc .nav > li.active > a:hover,
.toc .nav > li.active > a:focus {
  color: var(--highlight-light);
}

.pagination > .active > a {
  background-color: var(--header-bg-color);
  border-color: var(--header-bg-color);
}

.pagination > .active > a,
.pagination > .active > a:focus,
.pagination > .active > a:hover,
.pagination > .active > span,
.pagination > .active > span:focus,
.pagination > .active > span:hover {
  background-color: var(--highlight-light);
  border-color: var(--highlight-light);
}

/* HEADINGS */

h1 {
  font-weight: 600;
  font-size: 32px;
}

h2 {
  font-weight: 600;
  font-size: 24px;
  line-height: 1.8;
}

h3 {
  font-weight: 600;
  font-size: 20px;
  line-height: 1.8;
}

h5 {
  font-size: 16px;
  font-weight: 600;
  padding: 10px 0px;
}

article h1,
article h2,
article h3,
article h4 {
  margin-top: 35px;
  margin-bottom: 15px;
}

article h4 {
  font-size: 20px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 2px solid #ddd;
}

/* Content width optimization - Override Bootstrap container widths */
.container {
  max-width: 100% !important;
}

@media (min-width: 768px) {
  .container {
    width: 95% !important;
    max-width: 1400px !important;
  }
}

@media (min-width: 992px) {
  .container {
    width: 95% !important;
    max-width: 1400px !important;
  }
}

@media (min-width: 1200px) {
  .container {
    width: 90% !important;
    max-width: 1400px !important;
  }
}

/* Make article take more space */
article {
  max-width: 100%;
  padding: 0 20px;
}

/* Override Bootstrap grid for article pages with col-md-10 layout */
.article.row .col-md-10 {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
}

.article.row .col-md-10 article {
  max-width: 900px !important;
  margin: 0 auto !important;
  padding: 0 20px;
}

/* Override column widths for better content distribution */
@media (min-width: 992px) {
  .sideaffix {
    width: 220px !important;
  }
  
  .sidetoc,
  .col-md-3 {
    width: 260px !important;
    max-width: 260px !important;
  }
  
  /* Main content column - give it more space */
  article,
  .col-md-9 {
    width: calc(100% - 520px) !important;
    max-width: 900px !important;
    flex: 0 0 auto !important;
  }
  
  /* For col-md-10 layout (articles with TOC) */
  .article.row .col-md-10 {
    flex: 0 0 83.333333% !important;
    max-width: 83.333333% !important;
  }
  
  .article.row .col-md-10 article {
    max-width: 900px !important;
    width: 100% !important;
  }
}

@media (min-width: 1200px) {
  article,
  .col-md-9 {
    width: calc(100% - 520px) !important;
    max-width: 1400px !important;
  }
  
  /* For col-md-10 layout at larger screens */
  .article.row .col-md-10 {
    flex: 0 0 75% !important;
    max-width: 75% !important;
  }
  
  .article.row .col-md-10 article {
    max-width: 1400px !important;
    width: 100% !important;
  }
}

@media (max-width: 991px) {
  article {
    max-width: 100%;
    padding: 0 15px;
  }
  
  .article.row .col-md-10 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* NAVBAR */

.navbar-brand > img {
  color: var(--header-ft-color);
}

.navbar {
  border: none;
  /* Both navbars use box-shadow */
  -webkit-box-shadow: var(--card-box-shadow);
  -moz-box-shadow: var(--card-box-shadow);
  box-shadow: var(--card-box-shadow);
}

.subnav {
  border-top: 1px solid #ddd;
  background-color: #fff;
}

.navbar-inverse {
  background-color: var(--header-bg-color);
  z-index: 100;
}

.navbar-inverse .navbar-nav > li > a,
.navbar-inverse .navbar-text {
  color: var(--header-ft-color);
  background-color: var(--header-bg-color);
  border-bottom: 3px solid transparent;
  padding-bottom: 12px;
}

.navbar-inverse .navbar-nav > li > a:focus,
.navbar-inverse .navbar-nav > li > a:hover {
  color: var(--header-ft-color);
  background-color: var(--header-bg-color);
  border-bottom: 3px solid white;
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:focus,
.navbar-inverse .navbar-nav > .active > a:hover {
  color: var(--header-ft-color);
  background-color: var(--header-bg-color);
  border-bottom: 3px solid white;
}

.navbar-form .form-control {
  border: 0;
  border-radius: 0;
}

.navbar-form .form-control:hover {
  box-shadow: var(--search-box-shadow);
}

.toc-filter > input:hover {
  box-shadow: var(--under-box-shadow);
}

/* NAVBAR TOGGLED (small screens) */

.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {
  border: none;
}
.navbar-inverse .navbar-toggle {
  box-shadow: var(--card-box-shadow);
  border: none;
}

.navbar-inverse .navbar-toggle:focus,
.navbar-inverse .navbar-toggle:hover {
  background-color: var(--header-ft-color);
}

/* SIDEBAR */

.toc .level1 > li {
  font-weight: 400;
}

.toc .nav > li > a {
  color: var(--font-color);
}

.sidefilter {
  background-color: #fff;
  border-left: none;
  border-right: none;
}

.sidefilter {
  background-color: #fff;
  border-left: none;
  border-right: none;
}

.toc-filter {
  padding: 10px;
  margin: 0;
}

.toc-filter > input {
  border: none;
  border-bottom: 2px solid var(--accent-dim);
}

.toc-filter > .filter-icon {
  display: none;
}

.sidetoc > .toc {
  background-color: #fff;
  overflow-x: hidden;
}

.sidetoc {
  background-color: #fff;
  border: none;
}

/* ALERTS */

.alert {
  padding: 0px 0px 5px 0px;
  color: inherit;
  background-color: inherit;
  border: none;
  box-shadow: var(--card-box-shadow);
}

.alert > p {
  margin-bottom: 0;
  padding: 5px 10px;
}

.alert > ul {
  margin-bottom: 0;
  padding: 5px 40px;
}

.alert > h5 {
  padding: 10px 15px;
  margin-top: 0;
  text-transform: uppercase;
  font-weight: bold;
  border-radius: 4px 4px 0 0;
}

.alert-info > h5 {
  color: #1976d2;
  border-bottom: 4px solid #1976d2;
  background-color: #e3f2fd;
}

.alert-warning > h5 {
  color: #f57f17;
  border-bottom: 4px solid #f57f17;
  background-color: #fff3e0;
}

.alert-danger > h5 {
  color: #d32f2f;
  border-bottom: 4px solid #d32f2f;
  background-color: #ffebee;
}

/* CODE HIGHLIGHT */
pre {
  padding: 16px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
  background-color: #f6f8fa;
  color: #24292e;
  border-radius: 6px;
  border: 1px solid #e1e4e8;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

pre code {
  white-space: pre;
  display: block;
  overflow-x: visible;
  word-break: normal;
  word-wrap: normal;
  padding: 0;
  background: transparent;
  color: inherit;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
}

/* Inline code */
code:not(pre code) {
  background-color: rgba(27, 31, 35, 0.05);
  color: #d73a49;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

/* Mobile-specific adjustments for code blocks */
@media (max-width: 768px) {
  pre {
    font-size: 13px;
    padding: 12px;
  }
  
  pre code {
    font-size: 13px;
  }
}

/* Copy button styles - overlaid on code block */
.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #586069;
  border: 1px solid #d1d5da;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  backdrop-filter: blur(8px);
}

/* Show copy button on hover */
pre:hover .copy-button {
  opacity: 1;
}

.copy-button:hover {
  background: #f6f8fa;
  border-color: #0366d6;
  color: #0366d6;
}

.copy-button:active {
  transform: scale(0.95);
}

.copy-button.copied {
  background: #28a745;
  color: white;
  border-color: #28a745;
  opacity: 1;
}

.copy-button .copy-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

/* STYLE FOR IMAGES */

.article .small-image {
  margin-top: 15px;
  box-shadow: var(--card-box-shadow);
  max-width: 350px;
}

.article .medium-image {
  margin-top: 15px;
  box-shadow: var(--card-box-shadow);
  max-width: 550px;
}

.article .large-image {
  margin-top: 15px;
  box-shadow: var(--card-box-shadow);
  max-width: 700px;
}

/* SCREENSHOT GALLERY STYLES */

.screenshot-gallery {
  margin: 2rem 0;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.screenshot-item {
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-item:hover {
  animation: bounce-hover 0.5s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.screenshot-clickable {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.screenshot-clickable:hover {
  opacity: 0.95;
  transform: scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,0.2);
}

.screenshot-caption {
  padding: 1.25rem;
  background: white;
  border-top: 1px solid #e9ecef;
}

.screenshot-caption h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-weight: 600;
}

.screenshot-caption p {
  margin: 0;
  color: #666;
}

/* Bounce animation for hover effects */
@keyframes bounce-hover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Simple screenshot with click-to-view functionality */
.screenshot-simple {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: var(--card-box-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-simple:hover {
  animation: bounce-hover 0.5s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Modal for full-screen image viewing */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

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

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  animation: zoomIn 0.3s ease;
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
}

.image-modal-close:hover {
  color: #ccc;
}

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

@keyframes zoomIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

@media (max-width: 768px) {
  .screenshot-grid {
    grid-template-columns: 1fr;
  }
}

/* FOOTER STYLES */

/* Fix for DocFX affix/wrapper issues */
#wrapper {
  min-height: auto !important;
}

body {
  padding-bottom: 0 !important;
}

.phobos-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  margin-top: 60px;
  padding: 40px 0 0;
  font-size: 14px;
  position: relative !important;
  z-index: 1 !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  clear: both;
}

.phobos-footer .footer-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 30px;
}

.phobos-footer .footer-section h4 {
  color: var(--header-bg-color);
  font-weight: 600;
  margin: 0 0 8px 0;
  font-size: 20px;
}

.phobos-footer .footer-section h5 {
  color: var(--font-color);
  font-weight: 600;
  margin: 0 0 15px 0;
  padding: 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.phobos-footer .footer-logo p {
  color: #6c757d;
  margin: 0 0 20px 0;
}

.phobos-footer .copyright p {
  color: #6c757d;
  margin: 0;
  line-height: 1.6;
}

.phobos-footer .social-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.phobos-footer .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.05);
  color: #495057;
  transition: all 0.2s ease;
}

.phobos-footer .social-links a:hover {
  background-color: var(--highlight-light);
  color: white;
  transform: translateY(-2px);
}

.phobos-footer .social-links svg {
  width: 18px;
  height: 18px;
}

.phobos-footer .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.phobos-footer .footer-links li {
  margin-bottom: 10px;
}

.phobos-footer .footer-links a {
  color: #495057;
  text-decoration: none;
  transition: color 0.2s ease;
}

.phobos-footer .footer-links a:hover {
  color: var(--highlight-light);
  text-decoration: none;
}

.phobos-footer .footer-bottom {
  background-color: transparent;
  padding: 20px 0;
  margin-top: 20px;
  border-top: 1px solid #dee2e6;
}

.phobos-footer .footer-bottom-content {
  text-align: center;
}

.phobos-footer .footer-bottom-content p {
  color: #6c757d;
  margin: 0;
  font-size: 13px;
}

.phobos-footer .footer-bottom-content a {
  color: var(--highlight-dark);
  text-decoration: none;
  font-weight: 500;
}

.phobos-footer .footer-bottom-content a:hover {
  color: var(--highlight-light);
}


/* Responsive design for tablets */
@media (max-width: 1024px) {
  .phobos-footer .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .phobos-footer {
    padding: 30px 0 0;
  }
  
  .phobos-footer .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 15px 30px;
  }
  
  .phobos-footer .footer-section {
    text-align: center;
  }
  
  .phobos-footer .footer-bottom-content {
    padding: 0 15px;
  }

  .phobos-footer .social-links {
    justify-content: center;
  }
}