body.dark-mode {
    background-color: #0d1117 !important;
    color: #e6ecf1;
    font-family: 'Raleway', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .fact-link {
  color: rgb(167 200 247)!important;
}

body.dark-mode .map-gradient-overlay {
    background:
        linear-gradient(to right,
            #0d1117 0%,
            rgba(13, 17, 23, 0.55) 5%,
            transparent 18%
        ),
        linear-gradient(to left,
            #0d1117 0%,
            rgba(13, 17, 23, 0.55) 5%,
            transparent 18%
        ),
        linear-gradient(to top,
            #0d1117              0%,
            rgba(13,17,23,.96)   7%,
            rgba(13,17,23,.85)   16%,
            rgba(13,17,23,.60)   30%,
            rgba(13,17,23,.30)   46%,
            rgba(13,17,23,.08)   62%,
            transparent          76%
        );
}

body.dark-mode .navbar {
    background-color: rgba(22, 27, 34, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    border-bottom: none;
}

body.dark-mode #theme-toggle {
  color: #e6ecf1;
}

body.dark-mode .navbar-brand,
body.dark-mode .nav-link {
    color: #e6ecf1 !important;
}

body.dark-mode .nav-link:hover {
    color: #ffffff !important;
}

body.dark-mode .card {
    background-color: #1c2128;
    color: #e6ecf1;
    border: 1px solid #2d333b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .post-hero-title {
    color: #e6ecf1;
}

body.dark-mode .card-overlay {
    background: rgba(13, 17, 23, 0.7);
    color: #e6ecf1;
}

body.dark-mode .badge {
    background-color: #30363d;
    color: #c9d1d9;
}

body.dark-mode .btn-light {
    background-color: #30363d;
    color: #ffffff;
    border: none;
}

body.dark-mode .btn-light:hover {
    background-color: #424a53;
}

body.dark-mode footer {
    background-color: #0a0f14;
    color: #ccc;
}

body.dark-mode footer a {
    color: #68c3e8;
}

body.dark-mode .play-overlay svg polygon {
    fill: #ffffff;
}

body.dark-mode .play-overlay svg circle {
    fill: rgba(200, 220, 255, 0.3);
}

body.dark-mode .post-img-overflow-hidden {
    background-color: #0d1117;
}

body.dark-mode .modal-content {
    background-color: #1c2128;
    color: #e6ecf1;
    border: 1px solid #2d333b;
  }

  body.dark-mode .modal-header,
  body.dark-mode .modal-footer {
    border-color: #30363d;
  }

  body.dark-mode .modal-title {
    color: #e6ecf1;
  }

  body.dark-mode .btn-close {
    filter: invert(1);
  }

  body.dark-mode table,
  body.dark-mode table.table,
  body.dark-mode table.dataTable {
    background-color: #1c2128 !important;
    color: #e6ecf1 !important;
    border-color: #2d333b !important;
  }

  body.dark-mode table th,
  body.dark-mode table td {
    background-color: inherit !important;
    color: inherit !important;
    border-color: #2d333b !important;
  }

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd),
body.dark-mode .dataTable tbody tr:nth-child(odd) {
  background-color: #242b33 !important;
}

body.dark-mode .table-hover > tbody > tr:hover,
body.dark-mode .dataTable tbody tr:hover {
  background-color: #2a323b !important;
}

body.dark-mode .dataTables_wrapper select,
body.dark-mode .dataTables_wrapper input {
  background-color: #30363d !important;
  color: #e6ecf1 !important;
  border: 1px solid #2d333b !important;
}

body.dark-mode .paginate_button {
    background-color: #30363d !important;
    color: #e6ecf1 !important;
    border: 1px solid #2d333b !important;
  }

  body.dark-mode .paginate_button.current {
    background-color: #0d6efd !important;
    color: #ffffff !important;
  }

body.dark-mode .dropdown-menu {
    background-color: #2b2b2b;
    color: #f8f9fa;
}

body.dark-mode .dropdown-menu .dropdown-item {
    color: #f8f9fa;
}

body.dark-mode .dropdown-menu .dropdown-item:hover,
body.dark-mode .dropdown-menu .dropdown-item:focus {
    background-color: #444;
    color: #fff;
}

body.dark-mode .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba%28255, 255, 255, 1%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

body.dark-mode .text-muted {
  color: #adb5bd !important;
}

body.dark-mode #side-panel {
  background: rgba(0, 0, 0, 0.6);
}

body.dark-mode .map-controls {
  background: rgba(22, 27, 34, 0.95);
}

body.dark-mode .list-group-item,
body.dark-mode .list-group{
  background-color: rgba(var(--bs-dark-rgb), var(--bs-bg-opacity)) !important;
  color: rgba(var(--bs-light-rgb), var(--bs-text-opacity)) !important;
  border-color: #242b33 !important;
}

body.dark-mode {
  --cmt-surface:         #1c2128;
  --cmt-border:          rgba(255, 255, 255, 0.07);
  --cmt-text:            #e6ecf1;
  --cmt-muted:           #8b949e;
  --cmt-link:            #7cb9ff;
  --cmt-avatar-bg:       #21262d;
  --cmt-reply-line:      #21262d;
  --cmt-input-bg:        #161b22;
  --cmt-input-border:    #30363d;
  --cmt-reply-pill-bg:   rgba(124, 185, 255, 0.1);
  --cmt-reply-pill-text: #7cb9ff;
}

body.dark-mode .gallery-filters {
  background: rgba(13, 17, 23, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

body.dark-mode .gf-seg {
  background: rgba(255, 255, 255, 0.07);
}

body.dark-mode .gf-type {
  color: rgba(255, 255, 255, 0.35);
}

body.dark-mode .gf-type:hover:not(.active) {
  color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .gf-type.active {
  background: #1c2128;
  color: #7cb9ff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

body.dark-mode .weather-card {
  background: linear-gradient(145deg, #0a1e35 0%, #0d2847 55%, #0f3260 100%);
}

body.dark-mode .weather-label     { color: rgba(140, 190, 230, 0.5); }
body.dark-mode .weather-condition  { color: #a8d4f0; }
body.dark-mode .weather-temp       { color: #d4eaf8; }
body.dark-mode .weather-feels      { color: rgba(140, 190, 230, 0.55); }
body.dark-mode .weather-stats      { border-top-color: rgba(100, 160, 210, 0.15); }
body.dark-mode .weather-stat       { color: #a8d4f0; }
body.dark-mode .weather-stat-muted { color: rgba(140, 190, 230, 0.45); }

body.dark-mode .admin-fab-btn {
  background: #30363d;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
}

body.dark-mode .admin-fab-btn:hover {
  background: #424a53;
}

body.dark-mode .admin-fab-menu {
  background-color: #1c2128;
  border-color: #2d333b;
  color: #e6ecf1;
}

body.dark-mode .admin-fab-menu .dropdown-item {
  color: #e6ecf1;
}

body.dark-mode .admin-fab-menu .dropdown-item:hover {
  background-color: #2d333b;
}

body.dark-mode .admin-fab-menu .dropdown-divider {
  border-color: #2d333b;
}

body.dark-mode .admin-fab-menu .dropdown-header {
  color: #8b949e;
}

body.dark-mode .track-legend-card {
  background: #1c2128;
}

body.dark-mode .track-legend-name {
  color: #e6ecf1;
}

body.dark-mode .tls-val {
  color: #c9d1d9;
}

/* Post edit & detail dark mode overrides */
body.dark-mode .media-edit-card {
  background-color: #1c2128;
  border-color: rgba(255, 255, 255, 0.07);
}

body.dark-mode .media-edit-card--new {
  border-color: rgba(42, 127, 168, 0.45);
}

body.dark-mode .media-upload-zone {
  color: #e6ecf1;
}

body.dark-mode .post-article {
  background-color: #1c2128;
}

body.dark-mode .post-day-tag {
  color: #68c3e8;
  background: rgba(104, 195, 232, 0.1);
  border-color: rgba(104, 195, 232, 0.2);
}
