/* UI Modern Global Styles - HDI CRM */

/* Font import */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&display=swap');

/* Brand variables */
:root {
  --hdi-green: #1e552a;
  --hdi-green-50: #eaf6ef;
  --hdi-green-600: #174620;
  --hdi-green-400: #4FAD5A;
  --text-strong: #374151;
  --text: #111827;
  --text-muted: #6b7280;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-lg: 12px;
}

/* Base */
html, body {
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* Header container adjustments */
#header-menu-container {
  backdrop-filter: saturate(140%) blur(6px);
}

/* Primary gradient background for header wrapper elements */
#header-menu-container .header-wrapper,
#header-menu-container .header-root {
  background: linear-gradient(360deg, var(--hdi-green) -62.88%, var(--hdi-green-400) 157.58%) !important;
  color: #fff !important;
}

/* Navigation groups in header */
#header-menu-container .group-title {
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 12px;
  transition: background .2s ease, transform .08s ease;
}
#header-menu-container .menu-group:hover .group-title,
#header-menu-container .menu-group.active .group-title {
  background: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

/* Dropdown menus - header */
#header-menu-container .dropdown,
#header-menu-container .dropdown-menu {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 32px rgba(0,0,0,0.12);
  overflow: hidden;
}

/* Dropdown menu items */
#header-menu-container .dropdown-item,
#header-menu-container .menu-item,
#header-menu-container .profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-strong);
  text-decoration: none;
  cursor: pointer;
}
#header-menu-container .dropdown-item:hover,
#header-menu-container .menu-item:hover,
#header-menu-container .profile-menu-item:hover {
  background: #f8fafc;
}

/* Search box inside header */
#header-menu-container input[type="search"],
#header-menu-container .search-input {
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 999px;
  padding: 8px 36px 8px 14px;
  outline: none;
}
#header-menu-container input[type="search"]::placeholder,
#header-menu-container .search-input::placeholder {
  color: rgba(255,255,255,0.85);
}

/* Certificate lookup button in header */
#header-menu-container .lookup-btn,
#header-menu-container .certificate-lookup-button {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  transition: background .2s ease, box-shadow .2s ease, transform .05s ease;
}
#header-menu-container .lookup-btn:hover,
#header-menu-container .certificate-lookup-button:hover {
  background: rgba(255,255,255,0.28);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* User profile section in header */
#header-menu-container .user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
#header-menu-container .user-email { color: #ffffff; opacity: 0.95; }
#header-menu-container .user-role,
#header-menu-container .role-badge {
  background: #ffffff;
  color: var(--hdi-green);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

/* General Components */
.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .2s ease, transform .05s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--hdi-green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(30,85,42,0.25);
}
.btn-primary:hover { background: var(--hdi-green-600); box-shadow: 0 6px 16px rgba(30,85,42,0.35); }
.btn-secondary {
  background: var(--hdi-green-50);
  color: var(--hdi-green);
}

.input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  min-width: 300px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.input:focus {
  outline: 3px solid rgba(30,85,42,0.18);
  border-color: #d1d5db;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.table-wrapper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
}

/* --- Responsive: Header & common elements --- */
@media (max-width: 768px) {
  /* Header: reduce logo, center section hidden, user info wrap */
  #header-menu-container .header-wrapper,
  #header-menu-container .header-root {
    padding: 0 12px;
    min-height: 60px;
  }
  #header-menu-container .logo {
    width: 36px; height: 36px;
  }
  #header-menu-container .site-name {
    font-size: 18px;
  }
  #header-menu-container .user-info {
    flex-wrap: wrap; gap: 6px;
  }
  #header-menu-container .user-email {
    font-size: 13px;
  }
  #header-menu-container .user-role {
    font-size: 10px;
  }
  /* Search & cert button stack */
  #header-menu-container .search-cert-row {
    flex-direction: column; gap: 8px;
  }
  #header-menu-container input[type="search"],
  #header-menu-container .search-input {
    min-width: 0;
  }
  /* Tables scrollable wrapper */
  .table-wrapper { overflow-x: auto; }
  .table { min-width: 640px; }
}
@media (max-width: 480px) {
  /* Even smaller logo & name */
  #header-menu-container .logo { width: 32px; height: 32px; }
  #header-menu-container .site-name { font-size: 16px; }
  /* Hide user email, keep only avatar & role */
  #header-menu-container .user-email { display: none; }
  /* Buttons full-width inside wrappers */
  #header-menu-container .lookup-btn,
  #header-menu-container .certificate-lookup-button {
    width: 100%;
    text-align: center;
  }
}

/* Shared Footer Styles */
.footer {
  margin-top: 48px;
  background: var(--bg-subtle, #f8fafc);
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-logo {
  height: 28px;
  width: auto;
  display: block;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}
@media (max-width: 600px) {
  .footer { flex-direction: column; align-items: flex-start; }
}
.table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-strong);
  font-size: 13px;
  letter-spacing: 0.2px;
}
.table tr:nth-child(even) { background: #fcfdff; }
.table tr:hover { background: #f7fbf8; }

.badge {
  display: inline-block;
  padding: 4px 8px;
  background: var(--hdi-green-50);
  color: var(--hdi-green);
  border-radius: 999px;
  font-size: 12px;
}

/* Breadcrumb unified style */
.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--hdi-green);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb a:hover { text-decoration: underline; color: var(--hdi-green-400); }

/* Utility */
.error { color: #b91c1c; font-weight: 600; }
.success { color: #065f46; font-weight: 600; }

/* Sticky mobile toolbar improvements */
.sticky-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Invite modal within header dropdown */
#header-menu-container .invite-modal,
#header-menu-container .modal-card {
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
}

/* Header center-section: hide horizontal scrollbar but keep touch/trackpad scroll */
#header-menu-container .center-section {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}
#header-menu-container .center-section::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Prevent menu items wrapping; allow overflow handled by scroll/hide */
#header-menu-container .modern-menu-container {
  flex-wrap: nowrap;
}

/* CSS fallback: show main dropdown on hover */
#header-menu-container .menu-group:hover .dropdown-container {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* CSS fallback: show subpage dropdown on hover */
#header-menu-container .page-item-with-subpages:hover + .subpage-dropdown,
#header-menu-container .subpage-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Ensure header allows dropdowns to overflow outside its 66px height */
#header-menu-container {
  overflow: visible;
}

/* Page title row with back button */
.page-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title-row .page-title { margin: 0; }
.page-title-row > h1 { margin: 0; }
.page-back-button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-strong);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.page-back-button:hover {
  background: var(--hdi-green-50);
  border-color: #cbd5e1;
}
/* Benefits section: Option A visual enhancements */
#benefits-proactive-renewal.section--tint {
  position: relative;
  border-radius: 16px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(0,108,50,.08), rgba(46,184,114,.10));
}

#benefits-proactive-renewal .kpi-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
#benefits-proactive-renewal .kpi-chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(0,108,50,.15), rgba(46,184,114,.15));
  border: 1px solid rgba(0,0,0,.06);
}

/* Responsive grid for cards */
#benefits-proactive-renewal .grid-3 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}
@media (max-width: 1024px) {
  #benefits-proactive-renewal .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  #benefits-proactive-renewal .grid-3 { grid-template-columns: 1fr; }
}

/* Gradient border cards with micro-interactions */
#benefits-proactive-renewal .card {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(#fff, #fff) padding-box,
              linear-gradient(135deg, #006C32, #2EB872) border-box;
  border: 1px solid transparent;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
#benefits-proactive-renewal .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0,0,0,.08);
}

/* Title + icon ring with gentle glow */
#benefits-proactive-renewal h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
#benefits-proactive-renewal h4 i {
  --accentA: #006C32;
  --accentB: #2EB872;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accentA), var(--accentB));
  color: #fff;
  box-shadow: 0 0 0 3px rgba(0,108,50,.15), 0 4px 10px rgba(46,184,114,.15);
}

/* Rotate accent colors per card for variety */
#benefits-proactive-renewal .grid-3 .card:nth-child(1) h4 i { --accentA: #006C32; --accentB: #2EB872; }
#benefits-proactive-renewal .grid-3 .card:nth-child(2) h4 i { --accentA: #0F9D58; --accentB: #34D399; }
#benefits-proactive-renewal .grid-3 .card:nth-child(3) h4 i { --accentA: #15803D; --accentB: #22C55E; }
#benefits-proactive-renewal .grid-3 .card:nth-child(4) h4 i { --accentA: #065F46; --accentB: #10B981; }
#benefits-proactive-renewal .grid-3 .card:nth-child(5) h4 i { --accentA: #046A38; --accentB: #2EB872; }
#benefits-proactive-renewal .grid-3 .card:nth-child(6) h4 i { --accentA: #006C32; --accentB: #22C55E; }

/* Unify list typography in notification card (and all lists in section) */
#benefits-proactive-renewal .card ul {
  margin: 6px 0 0 18px;
  padding: 0;
  list-style: disc;
  color: inherit;
  font-size: 14px;
  line-height: 1.6;
}
#benefits-proactive-renewal .card ul li { margin: 4px 0; }

/* Removed background watermark logo from benefits section */

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #benefits-proactive-renewal .card { transition: none; }
}

/* Weekly feature: Option A visual enhancements (green brand) */
#weekly-multi-month-feature {
  position: relative;
  border-radius: 16px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(0,108,50,.08), rgba(46,184,114,.10));
}

#weekly-multi-month-feature .grid-3 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}
@media (max-width: 1024px) {
  #weekly-multi-month-feature .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  #weekly-multi-month-feature .grid-3 { grid-template-columns: 1fr; }
}

#weekly-multi-month-feature .card {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(#fff, #fff) padding-box,
              linear-gradient(135deg, #006C32, #2EB872) border-box;
  border: 1px solid transparent;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
#weekly-multi-month-feature .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0,0,0,.08);
}

#weekly-multi-month-feature h2 i { margin-right: 6px; color: #006C32; }

#weekly-multi-month-feature h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
#weekly-multi-month-feature h4 i {
  --accentA: #006C32;
  --accentB: #2EB872;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accentA), var(--accentB));
  color: #fff;
  box-shadow: 0 0 0 3px rgba(0,108,50,.15), 0 4px 10px rgba(46,184,114,.15);
}

#weekly-multi-month-feature .grid-3 .card:nth-child(1) h4 i { --accentA: #006C32; --accentB: #2EB872; }
#weekly-multi-month-feature .grid-3 .card:nth-child(2) h4 i { --accentA: #0F9D58; --accentB: #34D399; }
#weekly-multi-month-feature .grid-3 .card:nth-child(3) h4 i { --accentA: #15803D; --accentB: #22C55E; }

#weekly-multi-month-feature .card ul {
  margin: 6px 0 0 18px;
  padding: 0;
  list-style: disc;
  color: inherit;
  font-size: 14px;
  line-height: 1.6;
}
#weekly-multi-month-feature .card ul li { margin: 4px 0; }

/* Removed background watermark logo from weekly feature section */
@media (prefers-reduced-motion: reduce) {
  #weekly-multi-month-feature .card { transition: none; }
}

/* Email samples – apply green brand color for links within renewal-process page */
#previews .card a { color: #006C32; }
#previews .card a:hover { color: #0A7B3E; }
