/* Dark card styling */
.card-dark {
  background-color: #353535;
  color: white;
  border: none;
}

.card-dark .card-body {
  background-color: #353535;
}

.card-dark .card-footer {
  background-color: #353535;
  border-top: 1px solid #555;
}

/* Hide bullet points for list items containing checkboxes as direct children */
li:has(> input[type="checkbox"]) {
  list-style: none;
}

/* Fallback for browsers that don't support :has() - target common checkbox list patterns */
ul li input[type="checkbox"] {
  margin-left: -1.2em;
}

li input[type="checkbox"] + * {
  margin-left: 0.3em;
}

.main-header {
  background-color: #135289;
  color: white;
  padding: 10px;
  text-align: center;
}

/* Header icon styling */
.main-header .header-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: white;
}

/* Dark navbar styling */
.navbar-dark {
  background-color: #343a40 !important;
  border-bottom: 1px solid #495057;
}

.navbar-dark .navbar-brand {
  color: white !important;
}

.navbar-dark .nav-link {
  color: rgba(255, 255, 255, 0.75) !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus {
  color: white !important;
}

.navbar-dark .nav-link.active {
  color: white !important;
  background-color: #495057;
  border-radius: 0.375rem;
}

.bg-local {
  background-color: #f8f9fa !important;
}

.bg-canary {
  background-color: #d3f9d8 !important;
}

.bg-preview {
  background-color: #d3f9d8 !important;
}

.bg-production {
  background-color: #f8d7da !important;
}

/* Custom button styling */
.btn-primary {
  background-color: #1d7fd5 !important;
  border-color: #1d7fd5 !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #1669b3 !important;
  border-color: #1669b3 !important;
}

.btn-outline-primary {
  color: #1d7fd5 !important;
  border-color: #1d7fd5 !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: #1d7fd5 !important;
  border-color: #1d7fd5 !important;
  color: white !important;
}

/* RTL (Right-to-Left) Support */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .navbar-nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-item {
  margin-left: 0;
  margin-right: 1rem;
}

[dir="rtl"] .dropdown-menu {
  right: 0;
  left: auto;
  text-align: right;
}

[dir="rtl"] .dropdown-item {
  text-align: right;
}

[dir="rtl"] .d-flex {
  flex-direction: row-reverse;
}

[dir="rtl"] .me-2 {
  margin-right: 0 !important;
  margin-left: 0.5rem !important;
}

[dir="rtl"] .card-body {
  text-align: right;
}

[dir="rtl"] .card-title {
  text-align: right;
}

[dir="rtl"] .card-text {
  text-align: right;
}

[dir="rtl"] .text-center {
  text-align: center !important;
}

[dir="rtl"] .btn {
  text-align: center;
}

/* RTL specific gap adjustments for social buttons */
[dir="rtl"] .d-flex.gap-2 {
  gap: 0.5rem;
  flex-direction: row-reverse;
}

/* RTL navbar brand alignment */
[dir="rtl"] .navbar-brand {
  flex-direction: row-reverse;
}

/* RTL dropdown toggle */
[dir="rtl"] .dropdown-toggle::after {
  margin-left: 0;
  margin-right: 0.255em;
}

/* Version Fork Visualization */
.version-timeline {
  position: relative;
  padding: 2rem 0;
}

.version-timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 120px; /* Start after the latest version */
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #1d7fd5 0%, #6c757d 30%, #6c757d 100%);
  transform: translateX(-50%);
  z-index: 1;
  border-radius: 2px;
}

.version-latest {
  position: relative;
  z-index: 3;
  margin-bottom: 2rem;
}

.version-latest .card {
  box-shadow: 0 8px 25px rgba(29, 127, 213, 0.15) !important;
  border-width: 2px !important;
}

.version-fork-indicator {
  text-align: center;
  margin: 2rem 0;
  position: relative;
  z-index: 3;
}

.version-fork-indicator .fork-text {
  background: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 3px solid #1d7fd5;
  color: #1d7fd5;
  font-weight: 700;
  display: inline-block;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(29, 127, 213, 0.2);
  position: relative;
}

.version-fork-indicator .fork-text::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 15px solid #1d7fd5;
  transform: translateX(-50%);
}

.version-historical {
  position: relative;
  z-index: 2;
  margin-bottom: 1.5rem;
}

.version-historical .card {
  border-left: 5px solid #6c757d !important;
  margin-left: 3rem;
  opacity: 0.85;
  background-color: #f8f9fa;
  border-color: #dee2e6 !important;
}

.version-historical::before {
  content: "";
  position: absolute;
  left: calc(50% - 1.5rem);
  top: 50%;
  width: 25px;
  height: 3px;
  background: #6c757d;
  transform: translateY(-50%);
  z-index: 1;
  border-radius: 2px;
}

.version-historical::after {
  content: "";
  position: absolute;
  left: calc(50% + 1px);
  top: 50%;
  width: 12px;
  height: 12px;
  background: #6c757d;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  border: 3px solid #fff;
}

/* Add a connecting dot for the latest version */
.version-latest::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1rem;
  width: 16px;
  height: 16px;
  background: #1d7fd5;
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 4;
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(29, 127, 213, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .version-timeline::before {
    left: 2.5rem;
    top: 140px;
  }

  .version-latest::after {
    left: 2.5rem;
  }

  .version-historical::before {
    left: 2.5rem;
    width: 20px;
  }

  .version-historical::after {
    left: 2.5rem;
  }

  .version-historical .card {
    margin-left: 4rem;
  }

  .version-fork-indicator {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}
