/* Navbar utility buttons */
.dark-mode-btn,
.language-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.35rem 0.55rem;
  line-height: 1;
  border-radius: 6px;
  color: var(--navbar-text-col);
  transition: background 0.2s;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.language-toggle-btn {
  min-width: 2rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.dark-mode-btn:hover,
.language-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .dark-mode-btn:hover,
[data-theme="dark"] .language-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Documentation pages */
main > .row > div > h2 {
  margin-top: 2.75rem;
  margin-bottom: 1rem;
}

main > .row > div > h3 {
  margin-top: 2.15rem;
  margin-bottom: 0.85rem;
}

main > .row > div > h4 {
  margin-top: 1.75rem;
  margin-bottom: 0.7rem;
}

main > .row > div > h2:first-child,
main > .row > div > h3:first-child,
main > .row > div > h4:first-child {
  margin-top: 0;
}

/* Smooth transitions */
body,
.navbar-custom,
footer,
.project-card,
.modal-box,
.tag,
.contests-banner {
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}

/* Dark theme CSS variable overrides */
html[data-theme="dark"] {
  --page-col: #1e1e2e;
  --text-col: #cdd6f4;
  --link-col: #89b4fa;
  --hover-col: #74c7ec;
  --navbar-col: #181825;
  --navbar-text-col: #cdd6f4;
  --navbar-border-col: #313244;
  --footer-col: #181825;
  --footer-text-col: #a6adc8;
  --footer-link-col: #cdd6f4;
  --footer-hover-col: #74c7ec;
}

/* Hardcoded color overrides for dark mode */

[data-theme="dark"] .jumbotron {
  background: #313244;
}

/* Projects page */
[data-theme="dark"] .project-card {
  background: #24273a;
  border-color: #363a4f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .project-section-title {
  color: #a6adc8;
  border-bottom-color: #363a4f;
}

[data-theme="dark"] .card-summary {
  color: #a6adc8;
}

[data-theme="dark"] .project-meta {
  color: #6e738d;
}

[data-theme="dark"] .card-cta {
  color: #89b4fa;
}

[data-theme="dark"] .tag {
  background: #1e2030;
  color: #89b4fa;
}

[data-theme="dark"] .contests-banner {
  background: #1e2030;
  border-color: #363a4f;
}

[data-theme="dark"] .contests-banner:hover {
  background: #24273a;
}

[data-theme="dark"] .contests-banner-left h4 {
  color: #89b4fa;
}

[data-theme="dark"] .contests-banner-left p {
  color: #a6adc8;
}

[data-theme="dark"] .contests-banner-arrow {
  color: #89b4fa;
}

/* Modal */
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .modal-box {
  background: #24273a;
  color: #cdd6f4;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] #modal-details ul {
  color: #cdd6f4;
}

[data-theme="dark"] #modal-meta {
  color: #a6adc8;
}

[data-theme="dark"] .modal-close {
  color: #a6adc8;
}

[data-theme="dark"] .modal-close:hover {
  color: #cdd6f4;
}

[data-theme="dark"] .modal-links a {
  color: #89b4fa;
}

[data-theme="dark"] .legend {
  color: #6e738d;
}

/* Navbar dropdown */
[data-theme="dark"] .navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item {
  background-color: var(--navbar-col);
  color: var(--navbar-text-col);
}

[data-theme="dark"] .navbar-custom .nav-item.dropdown .dropdown-menu .dropdown-item:hover {
  background-color: #313244;
}

/* Code blocks */
[data-theme="dark"] code,
[data-theme="dark"] pre {
  background: #313244;
  color: #cdd6f4;
}
