html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Fix checkbox checked state visibility across the site */
.form-check-input,
input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
}

input[type="checkbox"]:not(.form-check-input) {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  vertical-align: top;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 0.25em;
}

.form-check-input:checked,
input[type="checkbox"]:checked {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 70% !important;
}

.form-check-input:checked[type="checkbox"],
input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
}

/* Premium UI foundation shared across the app */
:root {
  --gd-ui-primary: #052f8b;
  --gd-ui-primary-hover: #1248b3;
  --gd-ui-accent: #15c5cf;
  --gd-ui-accent-2: #24dde8;
  --gd-ui-bg: #f7fafd;
  --gd-ui-surface: #ffffff;
  --gd-ui-surface-alt: #f8fbff;
  --gd-ui-border: rgba(5, 47, 139, 0.12);
  --gd-ui-border-strong: rgba(5, 47, 139, 0.18);
  --gd-ui-text: #132238;
  --gd-ui-muted: #5d6b82;
  --gd-ui-shadow: 0 12px 32px rgba(18, 38, 63, 0.08);
  --gd-ui-shadow-strong: 0 22px 56px rgba(18, 38, 63, 0.12);
  --gd-ui-radius: 20px;
  --gd-ui-radius-lg: 26px;
}

body.premium-ui-page {
  background:
    radial-gradient(circle at top right, rgba(36, 221, 232, 0.10), transparent 24%),
    radial-gradient(circle at left 12%, rgba(5, 47, 139, 0.08), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, var(--gd-ui-bg) 100%);
  color: var(--gd-ui-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.premium-ui-page .card,
body.premium-ui-page .modal-content,
body.premium-ui-page .dropdown-menu,
body.premium-ui-page .list-group-item,
body.premium-ui-page .alert,
body.premium-ui-page .table,
body.premium-ui-page .form-control,
body.premium-ui-page .form-select,
body.premium-ui-page .input-group-text {
  border-color: var(--gd-ui-border);
}

body.premium-ui-page .card,
body.premium-ui-page .modal-content,
body.premium-ui-page .dropdown-menu,
body.premium-ui-page .alert,
body.premium-ui-page .table,
body.premium-ui-page .list-group-item {
  border-radius: var(--gd-ui-radius);
  box-shadow: var(--gd-ui-shadow);
  background-color: var(--gd-ui-surface);
}

body.premium-ui-page .card-header {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(242, 247, 253, 0.98));
  border-bottom: 1px solid rgba(5, 47, 139, 0.08);
  font-weight: 700;
  color: var(--gd-ui-text);
}

body.premium-ui-page .btn {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 700;
}

body.premium-ui-page .btn-primary,
body.premium-ui-page .btn-success,
body.premium-ui-page .btn-info,
body.premium-ui-page .btn-danger,
body.premium-ui-page .btn-warning {
  border: 0;
  box-shadow: 0 10px 22px rgba(5, 47, 139, 0.16);
}

body.premium-ui-page .btn-primary,
body.premium-ui-page .btn-success {
  background: linear-gradient(135deg, var(--gd-ui-primary) 0%, var(--gd-ui-primary-hover) 58%, var(--gd-ui-accent) 100%);
}

body.premium-ui-page .btn-primary:hover,
body.premium-ui-page .btn-primary:focus,
body.premium-ui-page .btn-success:hover,
body.premium-ui-page .btn-success:focus {
  background: linear-gradient(135deg, var(--gd-ui-primary-hover) 0%, var(--gd-ui-primary) 58%, var(--gd-ui-accent-2) 100%);
  box-shadow: 0 14px 28px rgba(5, 47, 139, 0.20);
}

body.premium-ui-page .btn-outline-primary {
  border-color: var(--gd-ui-border-strong);
  color: var(--gd-ui-primary);
  background: rgba(5, 47, 139, 0.03);
}

body.premium-ui-page .btn-outline-primary:hover,
body.premium-ui-page .btn-outline-primary:focus {
  color: #fff;
  background: linear-gradient(135deg, var(--gd-ui-primary) 0%, var(--gd-ui-primary-hover) 100%);
  border-color: transparent;
}

body.premium-ui-page .form-control,
body.premium-ui-page .form-select {
  min-height: 48px;
  border-radius: 14px;
  background-color: #fff;
  box-shadow: none;
}

body.premium-ui-page .form-control:focus,
body.premium-ui-page .form-select:focus {
  border-color: rgba(5, 47, 139, 0.35);
  box-shadow: 0 0 0 0.2rem rgba(5, 47, 139, 0.10);
}

body.premium-ui-page .badge {
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font-weight: 700;
}

body.premium-ui-page .table thead th {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 246, 252, 0.98));
  color: var(--gd-ui-text);
  border-bottom-color: rgba(5, 47, 139, 0.08);
}

body.premium-ui-page .nav-pills .nav-link,
body.premium-ui-page .nav-tabs .nav-link {
  border-radius: 999px;
  font-weight: 700;
}

body.premium-ui-page .nav-pills .nav-link.active,
body.premium-ui-page .nav-tabs .nav-link.active {
  background: linear-gradient(135deg, var(--gd-ui-primary) 0%, var(--gd-ui-accent) 100%);
}

body.premium-ui-page .breadcrumb {
  background: transparent;
  border-radius: 999px;
  padding: 0;
}

body.premium-ui-page .alert {
  border: 1px solid var(--gd-ui-border);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Top Navigation Active Menu Highlighting */
.navbar-nav .nav-link.active {
  color: #052F8B !important;
  font-weight: 500;
  position: relative;
}

.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #052F8B 0%, #15C5CF 100%);
  border-radius: 999px;
}

.navbar-nav .nav-link:hover {
  color: #052F8B !important;
  transition: color 0.2s ease;
}

/* Login and Register Button Styles */
.auth-btn {
  transition: all 0.3s ease;
}

.auth-btn.active {
  background: linear-gradient(135deg, #052F8B 0%, #15C5CF 100%) !important;
  border-color: #052F8B !important;
  color: white !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(5, 47, 139, 0.24) !important;
  transform: translateY(-1px);
}
.auth-btn:hover,
.auth-btn:active,
.auth-btn:focus {
    background: linear-gradient(135deg, #052F8B 0%, #15C5CF 100%) !important;
    color: #fff !important;
    border-color: #052F8B !important;
    box-shadow: 0 4px 12px rgba(5, 47, 139, 0.24) !important;
    font-weight: 600;
    transform: translateY(-1px);
}

.auth-btn.active:hover {
  background: linear-gradient(135deg, #052F8B 0%, #15C5CF 100%) !important;
  border-color: #052F8B !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(5, 47, 139, 0.24) !important;
}

/* Company News & Notifications Widget Styles */
.company-news-widget {
  padding-left: 15px;
  padding-right: 15px;
  /* Ensure sidebar column aligns to top of the row instead of stretching to the bottom */
  align-self: flex-start;
}

.sticky-sidebar {
  position: sticky;
  /* Keep the sidebar pinned beneath the fixed header (layout uses 70px padding-top) */
  top: 70px;
  max-height: none; /* Allow natural height */
  overflow-y: visible; /* No scrollbar - use page scroll */
  overflow-x: hidden;
  padding-right: 5px;
  z-index: 20; /* stay above content when sticking */
}

/* Ensure role-home rows align their columns to the top so sidebars sit at top-right */
.container-fluid.full-bleed > .row,
.container-fluid > .row.full-bleed,
.container-fluid.mt-2.full-bleed > .row {
  align-items: flex-start !important;
}

/* Stronger sticky rule to override any page-level overrides */
.company-news-widget .sticky-sidebar {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 70px !important;
}

/* Scrollbar styling for sidebar */
.sticky-sidebar::-webkit-scrollbar {
  width: 6px;
}

.sticky-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.sticky-sidebar::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Ensure sidebar cards don't have extra margins on mobile */
@media (max-width: 767.98px) {
  .company-news-widget {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 20px;
  }

  .sticky-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    overflow-y: visible;
  }
}

/* Keep left and right sidebars visible while the middle content scrolls
   NOTE: removed internal scrollbar for left sidebar by allowing it to expand
   naturally. This disables the card's max-height and overflow so the main
   page scroll handles overflow instead of an inner scrollbar. */
.row > aside.col-md-3 > .card {
  position: sticky;
  top: 1rem; /* adjust if header height changes */
  max-height: none;
  overflow: visible;
}

/* Make middle content scrollable independently and limit height */
main.col-md-6 > .card,
main.col-md-6 > .card .card-body > #mainContent {
  max-height: calc(100vh - 6rem);
  overflow: auto;
}

/* Inline submenu spacing */
.submenu-container {
  margin-left: 0.5rem;
}

/* Make active left/level-2 and level-3 submenu items more noticeable */
.list-group-item.active {
  background-color: transparent;
  border-color: transparent;
  color: inherit;
}

/* Sidebar item styles: default / hover / active with left blue indicator */
.sidebar-item {
  padding: 10px 16px;
  color: #333;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background-color: #F5F7FA; /* light grey */
}

.sidebar-item.active {
  /* Visible selected state for left-side menu: light blue background, blue left indicator and text */
  background-color: #E6F0FF; /* light blue */
  color: #0B5ED7; /* blue text */
  border-left: 3px solid #0B5ED7; /* blue bar */
  font-weight: 500;
  transition: background-color 120ms linear, color 120ms linear;
}

/* Right column card headers (Company News, Advertisement) - visible background */
/* Only apply gray background to card headers without specific bg classes */
.card-header:not(.bg-primary):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-danger):not(.bg-dark) {
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #dee2e6 !important;
  font-weight: 600 !important;
  color: #495057 !important;
  padding: 0.75rem 1rem !important;
}

/* Maintain padding for colored card headers */
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-warning,
.card-header.bg-danger,
.card-header.bg-dark {
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125) !important;
}

/* Ensure company-news-widget cards match the visual style used on Index page */
.company-news-widget .card {
  border: 1px solid #dee2e6 !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
  background-color: transparent !important;
}

.company-news-widget .card-body {
  padding: 1rem !important;
  background-color: #ffffff !important;
}

.company-news-widget .card + .card {
  margin-top: 0.75rem; /* spacing between stacked cards */
}

/* Right column cards styling */
aside.custom-col-2-5 .card,
aside.custom-col-right .card {
  border: 1px solid #dee2e6 !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Card body padding for right column */
aside.custom-col-2-5 .card-body,
aside.custom-col-right .card-body {
  padding: 1rem !important;
  background-color: #ffffff !important;
}

/* Reduce size of a few right-sidebar icons (home / phone / whatsapp) to improve layout on index page */
aside.company-news-widget i.bi.bi-house,
aside.company-news-widget i.bi.bi-phone,
aside.company-news-widget i.bi.bi-whatsapp,
aside.company-news-widget i.bi.bi-house-fill,
aside.company-news-widget i.bi.bi-telephone-fill {
  font-size: 0.85rem !important;
  line-height: 1 !important;
}

/* Fallback: slightly reduce any icon directly inside the right sidebar */
aside.company-news-widget i.bi {
  font-size: 0.95rem;
}

/* Global mobile responsiveness helpers for role pages
   Applied broadly to improve layout on the pages listed by making
   card content stack, tables scroll, and form controls fill width. */
@media (max-width: 576px) {
  /* Reduce base font slightly for very small screens */
  html, body { font-size: 14px; }

  /* Tighter spacing for cards on mobile */
  .card { padding: 0.65rem !important; }

  /* Make rows inside cards stack vertically by default on narrow screens */
  .card .row { flex-direction: column; }
  .card .col-auto, .card .col, .card [class*="col-"] { width: 100% !important; max-width: 100% !important; }

  /* Labels appear above inputs and take full width when space is constrained */
  .form-label { display: block; margin-bottom: 0.35rem; }
  .form-control, .form-select, .input-group { width: 100% !important; }

  /* Make primary actions full-width inside cards/forms for easier tapping */
  .card .btn, .container-fluid .btn { width: 100% !important; display: block; }

  /* Ensure small tables don't break layout; allow horizontal scroll inside card */
  .card table, .card .table, .table-responsive, .table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card table th, .card table td { white-space: nowrap; }

  /* Reduce heading sizes in role pages for better fit */
  h1, h2, h3, h4 { font-size: 1.05rem; }

  /* Reduce padding of left menu and right columns to maximize center content width */
  .container-fluid.full-bleed { padding-left: 6px !important; padding-right: 6px !important; }

  /* Specific: make PIN/input pages and similar forms comfortable on mobile */
  input[type="password"], input[type="text"], input[type="number"], textarea { font-size: 1rem !important; padding: 0.5rem 0.65rem !important; }

  /* Avoid sticky sidebars covering content on small screens */
  .sticky-sidebar { position: relative !important; top: 0 !important; }
}

/* Subscription gradient styles */
.bg-gradient-subscription {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Offering gradient styles - matching Index.cshtml */
.bg-gradient-cbse-6 {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%) !important;
}

.bg-gradient-cbse-7 {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%) !important;
}

.bg-gradient-cbse-8 {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%) !important;
}

.bg-gradient-cbse-9 {
  background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%) !important;
}

.bg-gradient-cbse-10 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.bg-gradient-cbse-11 {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

.bg-gradient-cbse-12 {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
}

/* Yearly subscription variants - darker shades */
.bg-gradient-cbse-6-yearly {
  background: linear-gradient(135deg, #5b21b6 0%, #4c1d95 100%) !important;
}

.bg-gradient-cbse-7-yearly {
  background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%) !important;
}

.bg-gradient-cbse-8-yearly {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%) !important;
}

.bg-gradient-cbse-9-yearly {
  background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%) !important;
}

.bg-gradient-cbse-10-yearly {
  background: linear-gradient(135deg, #084298 0%, #0556b3 100%) !important;
}

.bg-gradient-cbse-11-yearly {
  background: linear-gradient(135deg, #e0a800 0%, #d6a100 100%) !important;
}

.bg-gradient-cbse-12-yearly {
  background: linear-gradient(135deg, #0f5132 0%, #146c43 100%) !important;
}

.bg-gradient-mh-6 {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
}

.bg-gradient-mh-7 {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
}

.bg-gradient-mh-8 {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%) !important;
}

.bg-gradient-mh-9 {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

.bg-gradient-mh-10 {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
}

.bg-gradient-mh-11 {
  background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%) !important;
}

.bg-gradient-mh-12 {
  background: linear-gradient(135deg, #198754 0%, #146c43 100%) !important;
}
