/* Tour Mate brand theme for GeoMonitor web
   Activate with: body[data-theme="theme-TourMate"] */

@font-face {
  font-family: "CreatoDisplay";
  src: url("/assets/fonts/CreatoDisplay-Regular.otf") format("opentype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

[data-theme="theme-TourMate"] {
  --primary-color: #059c1c;
  --accent-color: #0b4883;
  --primary-rgb: 5, 156, 28;
  --accent-rgb: 11, 72, 131;
  --theme-color1: #059c1c;
  --theme-color2: #13a922;
  --theme-color3: #0b4883;
  --theme-color4: #012501;
  --theme-color5: #898a8a;
  --theme-color6: #f8bd26;
  --secondary-color: #13a922;
  --primary-gradient: linear-gradient(135deg, #012501, #059c1c, #13a922);

  --tm-ink: #111212;
  --tm-navy: #012501;
  --tm-muted: #898a8a;
  --tm-border: #edeeee;
  --tm-card: #f6f7f7;
  --tm-soft: #f2f4f7;
  --tm-surface: #ffffff;
  --tm-online: #14c36e;
  --tm-offline: #d11100;
  --tm-warning: #f8bd26;
  --tm-critical: #d11100;
  --tm-radius: 16px;
  --tm-radius-card: 20px;

  --gm-glass-bg: #f6f7f7;
  --gm-glass-bg-strong: #ffffff;
  --gm-glass-bg-subtle: #f2f4f7;
  --gm-glass-border: #edeeee;
  --gm-glass-border-soft: #edeeee;
  --gm-glass-shadow: 0 3px 12px rgba(17, 18, 18, 0.05);
  --gm-glass-shadow-hover: 0 8px 22px rgba(17, 18, 18, 0.08);
  --gm-glass-blur: 0px;
  --gm-glass-blur-strong: 0px;
  /* Flat soft page — no green glow / glass stack */
  --gm-page-bg: #f6f7f7;
  --gm-orb-1: transparent;
  --gm-orb-2: transparent;
  --gm-orb-3: transparent;
  --g1-color: #f6f7f7;
  --g2-color: #f6f7f7;

  --bs-primary: #059c1c;
  --bs-primary-rgb: 5, 156, 28;
  --bs-link-color: #059c1c;
  --bs-link-hover-color: #048018;
  --bs-body-color: #111212;
  --bs-secondary-color: #898a8a;
  --bs-border-color: #edeeee;
  --bs-body-font-family: "CreatoDisplay", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-border-radius: 16px;
  --bs-border-radius-lg: 20px;
}

html[data-bs-theme="dark"] body[data-theme="theme-TourMate"],
html[data-theme="dark"] body[data-theme="theme-TourMate"] {
  --gm-glass-bg: #1c212b;
  --gm-glass-bg-strong: #161a22;
  --gm-glass-bg-subtle: #161a22;
  --gm-glass-border: #2a3140;
  --gm-glass-border-soft: #2a3140;
  --gm-glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --gm-page-bg: linear-gradient(180deg, #0a0b0f 0%, #10131a 50%, #0d1016 100%);
  --gm-orb-1: rgba(5, 156, 28, 0.18);
  --gm-orb-2: rgba(56, 189, 248, 0.1);
  --gm-orb-3: rgba(248, 189, 38, 0.08);
  --bs-body-color: #f8fafc;
  --bs-secondary-color: #94a3b8;
  --bs-border-color: #2a3140;
  --tm-ink: #f8fafc;
  --tm-muted: #94a3b8;
  --tm-card: #1c212b;
  --tm-border: #2a3140;
  --tm-surface: #0a0b0f;
}

/* Global type */
body[data-theme="theme-TourMate"],
body[data-theme="theme-TourMate"] .title-font,
body[data-theme="theme-TourMate"] .btn,
body[data-theme="theme-TourMate"] .form-control,
body[data-theme="theme-TourMate"] .form-select,
body[data-theme="theme-TourMate"] .nav-link,
body[data-theme="theme-TourMate"] .menu-list,
body[data-theme="theme-TourMate"] .dropdown-menu {
  font-family: "CreatoDisplay", system-ui, -apple-system, "Segoe UI", sans-serif !important;
}

body[data-theme="theme-TourMate"] .text-gradient,
body[data-theme="theme-TourMate"] .brand-icon span,
body[data-theme="theme-TourMate"] .gm-brand-title,
body[data-theme="theme-TourMate"] a.brand-icon {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  color: var(--primary-color) !important;
}

/* Soft page surface — solid, no green wash behind glass */
body[data-theme="theme-TourMate"],
body[data-theme="theme-TourMate"].bg-gradient,
body[data-theme="theme-TourMate"].gm-iframe-body {
  background: #f6f7f7 !important;
  background-image: none !important;
}

body[data-theme="theme-TourMate"].bg-gradient::after,
body[data-theme="theme-TourMate"].gm-iframe-body {
  background: #f6f7f7 !important;
}

body[data-theme="theme-TourMate"].bg-gradient::before,
body[data-theme="theme-TourMate"].gm-iframe-body::before {
  display: none !important;
  background: none !important;
}

body[data-theme="theme-TourMate"] #mainContent,
body[data-theme="theme-TourMate"] #mainContent.main_content {
  background: #f6f7f7 !important;
}

body[data-theme="theme-TourMate"] #spinner {
  background: #f6f7f7 !important;
}

/* Shell chrome */
body[data-theme="theme-TourMate"].svgstroke-a main .sidebar {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-right: 1px solid var(--tm-border) !important;
  box-shadow: 4px 0 18px rgba(17, 18, 18, 0.04) !important;
}

body[data-theme="theme-TourMate"].svgstroke-a header,
body[data-theme="theme-TourMate"].bg-gradient header {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--tm-border) !important;
  box-shadow: 0 2px 12px rgba(17, 18, 18, 0.04) !important;
}

body[data-theme="theme-TourMate"].svgstroke-a .sidebar .offcanvas-body > .d-flex.align-items-start.mb-4 {
  background: var(--tm-card) !important;
  border: 1px solid var(--tm-border) !important;
  border-radius: var(--tm-radius-card) !important;
  box-shadow: none !important;
}

body[data-theme="theme-TourMate"] .menu-list a {
  border-radius: 14px !important;
  color: var(--tm-ink) !important;
}

body[data-theme="theme-TourMate"] .menu-list a.active,
body[data-theme="theme-TourMate"] .menu-list a:hover {
  color: var(--primary-color) !important;
  background: rgba(var(--primary-rgb), 0.1) !important;
}

body[data-theme="theme-TourMate"] .menu-list a.active .svg-stroke,
body[data-theme="theme-TourMate"] .menu-list a:hover .svg-stroke,
body[data-theme="theme-TourMate"] .svg-stroke {
  stroke: currentColor;
}

body[data-theme="theme-TourMate"] .menu-list a.active .svg-stroke {
  stroke: var(--primary-color) !important;
}

/* Soft cards everywhere */
body[data-theme="theme-TourMate"] .gm-glass,
body[data-theme="theme-TourMate"] .card,
body[data-theme="theme-TourMate"] .gm-stat-card,
body[data-theme="theme-TourMate"] .gm-tile,
body[data-theme="theme-TourMate"] .modal-content,
body[data-theme="theme-TourMate"] .dropdown-menu {
  background: var(--gm-glass-bg-strong) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--tm-border) !important;
  border-radius: var(--tm-radius-card) !important;
  box-shadow: var(--gm-glass-shadow) !important;
}

body[data-theme="theme-TourMate"] .gm-stat-card,
body[data-theme="theme-TourMate"] .card.gm-glass,
body[data-theme="theme-TourMate"] .gm-glass,
body[data-theme="theme-TourMate"] .stat-card {
  background: var(--tm-card) !important;
  border-radius: var(--tm-radius-card) !important;
}

body[data-theme="theme-TourMate"],
html[data-gm-color-theme="TourMate"] body {
  overflow-x: hidden;
}

body[data-theme="theme-TourMate"] .btn,
body[data-theme="theme-TourMate"] .btn-primary,
body[data-theme="theme-TourMate"] .btn-fill {
  border-radius: var(--tm-radius) !important;
}

body[data-theme="theme-TourMate"] .btn-primary,
body[data-theme="theme-TourMate"] .btn.btn-primary,
body[data-theme="theme-TourMate"] .btn-fill.btn-primary,
body[data-theme="theme-TourMate"] .badge.bg-primary,
body[data-theme="theme-TourMate"] .bg-primary {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body[data-theme="theme-TourMate"] .btn-outline-primary,
body[data-theme="theme-TourMate"] .btn-link {
  color: var(--primary-color) !important;
}

body[data-theme="theme-TourMate"] .btn-outline-primary {
  border-color: #b3b4b6 !important;
}

/* Hover fills with primary — force white label (same readability as .btn-primary). */
body[data-theme="theme-TourMate"] .btn-outline-primary:hover,
body[data-theme="theme-TourMate"] .btn-outline-primary:focus-visible,
body[data-theme="theme-TourMate"] .btn-outline-primary:active,
body[data-theme="theme-TourMate"] .btn-outline-primary.active,
body[data-theme="theme-TourMate"] .btn-outline-secondary:hover,
body[data-theme="theme-TourMate"] .btn-outline-secondary:focus-visible,
body[data-theme="theme-TourMate"] .btn-outline-secondary:active,
body[data-theme="theme-TourMate"] .btn-outline-danger:hover,
body[data-theme="theme-TourMate"] .btn-outline-danger:focus-visible,
body[data-theme="theme-TourMate"] .btn-outline-danger:active {
  color: #fff !important;
}

body[data-theme="theme-TourMate"] .btn-outline-primary:hover,
body[data-theme="theme-TourMate"] .btn-outline-primary:focus-visible,
body[data-theme="theme-TourMate"] .btn-outline-primary:active,
body[data-theme="theme-TourMate"] .btn-outline-primary.active {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

body[data-theme="theme-TourMate"] .form-control,
body[data-theme="theme-TourMate"] .form-select {
  border-radius: 12px !important;
  border-color: var(--tm-border) !important;
  background: var(--tm-surface) !important;
}

body[data-theme="theme-TourMate"] .form-control:focus,
body[data-theme="theme-TourMate"] .form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15) !important;
}

body[data-theme="theme-TourMate"] .table thead th {
  color: var(--tm-muted) !important;
  border-bottom-color: var(--tm-border) !important;
}

body[data-theme="theme-TourMate"] .nav-pills .nav-link.active,
body[data-theme="theme-TourMate"] .page-item.active .page-link {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

/* Login */
body[data-theme="theme-TourMate"].login-page-bg {
  background-color: #012501;
  background-image:
    linear-gradient(135deg, rgba(1, 37, 1, 0.92), rgba(5, 156, 28, 0.78)),
    url("/assets/images/login_backgroud.jpeg");
}

body[data-theme="theme-TourMate"].login-page-bg::before {
  background: transparent;
}

body[data-theme="theme-TourMate"].login-page-bg .login-panel {
  background: #fff !important;
  border: 1px solid #edeeee !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 28px rgba(17, 18, 18, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-theme="theme-TourMate"].login-page-bg .login-logo-frame {
  border-radius: 16px;
  border: 1px solid #edeeee;
  background: #fff;
}

body[data-theme="theme-TourMate"].login-page-bg .login-panel footer a,
body[data-theme="theme-TourMate"].login-page-bg .gm-brand-title {
  color: #059c1c !important;
}

body[data-theme="theme-TourMate"].login-page-bg #loginButton.btn-primary {
  background-color: #059c1c !important;
  border-color: #059c1c !important;
}

/* Status accents */
body[data-theme="theme-TourMate"] .gm-stat-card.online .value,
body[data-theme="theme-TourMate"] .gm-stat-card.online .icon { color: var(--tm-online) !important; }
body[data-theme="theme-TourMate"] .gm-stat-card.offline .value,
body[data-theme="theme-TourMate"] .gm-stat-card.offline .icon { color: var(--tm-offline) !important; }
body[data-theme="theme-TourMate"] .gm-stat-card.warning .value,
body[data-theme="theme-TourMate"] .gm-stat-card.warning .icon { color: var(--tm-warning) !important; }
body[data-theme="theme-TourMate"] .gm-stat-card.critical .value,
body[data-theme="theme-TourMate"] .gm-stat-card.critical .icon { color: var(--tm-critical) !important; }
body[data-theme="theme-TourMate"] .gm-stat-card.facilities .value { color: var(--primary-color) !important; }

/* Theme picker UI — only menu items, never html/body */
a[data-gm-color-theme].active,
.dropdown-item[data-gm-color-theme].active {
  background: rgba(var(--primary-rgb, 5, 156, 28), 0.12) !important;
  color: var(--primary-color, #059c1c) !important;
  font-weight: 600;
}

html[data-gm-color-theme="TourMate"],
html[data-gm-color-theme="TourMate"].active {
  background: #f6f7f7 !important;
  color: inherit !important;
  font-weight: inherit !important;
}

.gm-theme-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 0.55rem;
  vertical-align: -2px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.gm-theme-swatch--cerulean { background: linear-gradient(135deg, #00b8d6, #00a686); }
.gm-theme-swatch--tourmate { background: linear-gradient(135deg, #012501, #059c1c); }

.gm-theme-toggle-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem !important;
  border-radius: 999px !important;
  border: 1px solid var(--tm-border, #edeeee) !important;
  background: #fff !important;
  color: var(--tm-ink, #111212) !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
}

.gm-theme-toggle-btn:hover,
.gm-theme-toggle-btn:focus,
.gm-theme-toggle-btn.show {
  border-color: var(--primary-color, #059c1c) !important;
  color: var(--primary-color, #059c1c) !important;
}

.gm-theme-toggle-btn .gm-theme-toggle-label {
  line-height: 1;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-theme="theme-TourMate"] .gm-theme-toggle-btn {
  background: #ffffff !important;
  border-color: var(--tm-border) !important;
}

/* Keep theme menu above iframe content */
body.svgstroke-a header.sticky-top {
  z-index: 1040 !important;
  overflow: visible !important;
}

body.svgstroke-a header .header-menu,
body.svgstroke-a header .header-menu .dropdown,
body.svgstroke-a header .nav-item.dropdown {
  overflow: visible !important;
  position: relative;
  z-index: 1041;
}

body.svgstroke-a header .header-menu .dropdown-menu {
  z-index: 1050 !important;
  display: none;
}

body.svgstroke-a header .header-menu .dropdown-menu.show {
  display: block !important;
}

/* Mobile offcanvas under Tour Mate */
@media (max-width: 1199.98px) {
  body[data-theme="theme-TourMate"].svgstroke-a .offcanvas#offcanvas_Navbar {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-right: 1px solid var(--tm-border) !important;
  }

  body[data-theme="theme-TourMate"].svgstroke-a .offcanvas#offcanvas_Navbar .offcanvas-header {
    background: var(--tm-card) !important;
    border-bottom: 1px solid var(--tm-border) !important;
    backdrop-filter: none !important;
  }
}
