/*
 * MTB3H Theme
 * Custom theme overrides for Sneat Bootstrap 5 admin template.
 * Primary: #009e69 (green) — inherited from the original MTB3H design.
 * ---------------------------------------------------------------------------
 */

/* ===== Light Mode (default) ===== */
:root,
[data-bs-theme="light"] {
  /* Primary palette - MTB3H green */
  --bs-primary: #009e69;
  --bs-primary-rgb: 0, 158, 105;
  --bs-primary-bg-subtle: #e0f5ed;
  --bs-primary-border-subtle: #b3e6d2;
  --bs-primary-text-emphasis: #006b47;

  /* Secondary - neutral gray */
  --bs-secondary: #8592A3;
  --bs-secondary-rgb: 133, 146, 163;

  /* Success */
  --bs-success: #28a745;
  --bs-success-rgb: 40, 167, 69;
  --bs-success-bg-subtle: #e2f5e7;
  --bs-success-border-subtle: #b8e5c4;
  --bs-success-text-emphasis: #1a7430;

  /* Info */
  --bs-info: #17a2b8;
  --bs-info-rgb: 23, 162, 184;
  --bs-info-bg-subtle: #e0f4f7;
  --bs-info-border-subtle: #b3e4ec;
  --bs-info-text-emphasis: #0f6e7d;

  /* Warning */
  --bs-warning: #ffc107;
  --bs-warning-rgb: 255, 193, 7;
  --bs-warning-bg-subtle: #fff8e1;
  --bs-warning-border-subtle: #ffecb3;
  --bs-warning-text-emphasis: #997404;

  /* Danger */
  --bs-danger: #dc3545;
  --bs-danger-rgb: 220, 53, 69;
  --bs-danger-bg-subtle: #fce4e6;
  --bs-danger-border-subtle: #f5b7be;
  --bs-danger-text-emphasis: #962430;

  /* Body & text */
  --bs-body-color: #646e78;
  --bs-body-bg: #f5f5f9;
  --bs-heading-color: #384551;
  --bs-secondary-color: #8592A3;
  --bs-border-color: #dbdfe5;

  /* Card / paper background */
  --bs-paper-bg: #ffffff;

  /* Link colors */
  --bs-link-color: #009e69;
  --bs-link-hover-color: #006b47;
}

/* ===== Dark Mode ===== */
[data-bs-theme="dark"] {
  /* Primary - lighter green for dark backgrounds */
  --bs-primary: #2fbf8b;
  --bs-primary-rgb: 47, 191, 139;
  --bs-primary-bg-subtle: #1a3a2e;
  --bs-primary-border-subtle: #2a6b52;
  --bs-primary-text-emphasis: #6fd9b3;

  /* Secondary */
  --bs-secondary: #8592A3;
  --bs-secondary-rgb: 133, 146, 163;

  /* Success */
  --bs-success: #48c76e;
  --bs-success-rgb: 72, 199, 110;
  --bs-success-bg-subtle: #1a3a22;
  --bs-success-border-subtle: #2a6b3a;

  /* Info */
  --bs-info: #3bbdd0;
  --bs-info-rgb: 59, 189, 208;
  --bs-info-bg-subtle: #1a3040;
  --bs-info-border-subtle: #2a5a6b;

  /* Warning */
  --bs-warning: #ffd148;
  --bs-warning-rgb: 255, 209, 72;
  --bs-warning-bg-subtle: #3a3420;
  --bs-warning-border-subtle: #6b5a2a;

  /* Danger */
  --bs-danger: #e5606e;
  --bs-danger-rgb: 229, 96, 110;
  --bs-danger-bg-subtle: #3a1a20;
  --bs-danger-border-subtle: #6b2a34;

  /* Body & surfaces */
  --bs-body-color: #C5CAD3;
  --bs-body-bg: #1A1D2E;
  --bs-heading-color: #DFE2E7;
  --bs-secondary-color: #8592A3;
  --bs-border-color: #3b3f54;

  /* Card / paper background */
  --bs-paper-bg: #232640;

  /* Link colors */
  --bs-link-color: #2fbf8b;
  --bs-link-hover-color: #6fd9b3;

  color-scheme: dark;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Typography Refinements ===== */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Selection Color ===== */
::selection {
  background: var(--bs-primary);
  color: #ffffff;
}

/* ===== Layout Fixes ===== */

/* Sidebar branding */
.menu .app-brand {
  height: 64px;
  margin-top: 12px;
}

/* Sidebar always expanded - never collapse to icon-only */
@media (min-width: 1200px) {
  .layout-menu {
    width: 16.25rem !important;
    transform: translate3d(0, 0, 0) !important;
  }
  .layout-menu .menu-inner > .menu-item > .menu-link .menu-text,
  .layout-menu .menu-inner > .menu-item .menu-sub,
  .layout-menu .menu-inner > .menu-item .menu-toggle::after,
  .layout-menu .menu-header {
    opacity: 1 !important;
    overflow: visible !important;
  }
}

/* Brand logo */
.app-brand-logo {
  flex-shrink: 0;
}
.app-brand-logo img {
  height: 2.5rem;
  width: auto;
  display: block;
}

/* Auth page brand logo - larger for centered auth pages */
.authentication-wrapper .app-brand-logo img {
  height: 3rem;
}

/* Brand text styling */
.app-brand-text {
  font-size: 1.75rem;
  letter-spacing: -0.5px;
}

/* Navbar z-index fix */
.content-wrapper .navbar {
  z-index: auto;
}

/* ===== Skip Navigation Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  inset-inline-start: 0;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--bs-primary);
  color: #ffffff;
  text-decoration: none;
  border-start-start-radius: 0;
  border-start-end-radius: 0;
  border-end-start-radius: 0;
  border-end-end-radius: 0.375rem;
}
.skip-link:focus {
  top: 0;
  color: #ffffff;
}

/* ===== Cookie Banner ===== */
.cookie-banner {
  background: rgba(var(--bs-body-bg-rgb), 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--bs-box-shadow);
}

/* ===== HR Text Divider ===== */
.hr-text {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  margin: 1rem 0;
}
.hr-text > span {
  position: relative;
  display: inline-block;
}
.hr-text > span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 9999px;
  height: 1px;
  background: var(--bs-border-color);
  inset-inline-start: 100%;
  margin-inline-start: 1rem;
}

/* ===== Mobile Touch Targets ===== */
@media (max-width: 767.98px) {
  /* Admin action buttons — meet 44px minimum touch target */
  .card .btn,
  .card-body .btn,
  .table .btn {
    min-height: 44px;
  }

  /* Table action links */
  .table td a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Form controls */
  .form-control,
  .form-select {
    min-height: 44px;
  }
}

/* ===== Utility ===== */
.reset-after::after {
  content: none;
}
.plan-preload,
.plan-no-animation {
  opacity: 1;
  animation: none;
}
