/* ============================================================
   Lock+Store Internal Links Portal — css/style.css
   ============================================================ */

:root {
  --navy: #1a2d4a;
  --navy-dark: #0f1e33;
  --navy-light: #243959;
  --red: #a04545;
  --red-hover: #8c3939;
  --white: #ffffff;
  --bg: #f0f2f5;
  --border: #e2e8f0;
  --text-primary: #1a2d4a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --radius-sm: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  color: white;
  background: var(--navy);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-shrink: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.portal-title {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ── Page Layout ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 26px 28px 48px;
  max-width: 1640px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-flag {
  font-size: 1.8rem;
  line-height: 1;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.page-text {
  display: flex;
  flex-direction: column;
}

.page-text p {
  font-style: italic;
}


.section {
  margin-bottom: 28px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 12px;
}

.section-title-bar {
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}


/* ── General Links ────────────────────────────────────────── */
.general-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.general-link-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.general-link-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.gl-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.gl-info {
  flex: 1;
  min-width: 0;
}

.gl-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.gl-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-open {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-open:hover {
  background: var(--navy-dark);
}


/* ── Site List ────────────────────────────────────────────── */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 8px;
}

.site-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0 20px;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.15s, border-color 0.18s;
  user-select: none;
  -webkit-user-select: none;
}

.site-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c8d5e8;
  transform: translateY(-1px);
}

.site-card:active {
  transform: scale(0.99);
  box-shadow: var(--shadow-sm);
}

.site-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.site-code-badge {
  background: var(--red);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  font-family: inherit;
  flex-shrink: 0;
}

.site-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-card-arrow {
  color: var(--text-light);
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Hides everything except the actions panel when a site is selected */
.main-content.mode-actions>*:not(#siteActionsPanel) {
  display: none !important;
}


/* ── Site Actions Panel ───────────────────────────────────── */
#siteActionsPanel {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: fadeSlideIn 0.2s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.actions-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.btn-back-sites {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-back-sites:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: rgba(26, 45, 74, 0.04);
}

.actions-site-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.actions-site-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions-section {
  margin-bottom: 28px;
}

.actions-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px 2px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 22px 24px;
  min-height: 78px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  width: 100%;
  box-shadow: var(--shadow-sm);
  user-select: none;
  -webkit-user-select: none;
}

.action-btn:hover {
  background: var(--navy-light);
  box-shadow: var(--shadow-md);
}

.action-btn:active {
  transform: scale(0.98);
  background: var(--navy-dark);
  box-shadow: none;
}

.action-icon {
  font-size: 1.7rem;
  line-height: 1;
  flex-shrink: 0;
}

.action-label {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.1px;
  line-height: 1.3;
}

.action-arrow {
  font-size: 1.4rem;
  opacity: 0.45;
  flex-shrink: 0;
  line-height: 1;
}


/* ── QR Modal ─────────────────────────────────────────────── */
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 28, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalFadeIn 0.2s ease;
}

.qr-modal.hidden {
  display: none !important;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.qr-modal-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px 36px 32px;
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: cardSlideUp 0.22s ease;
}

@keyframes cardSlideUp {
  from {
    transform: translateY(14px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.qr-modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 2px;
}

.qr-modal-site {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.paynow-instruction {
  width: 100%;
  background: #eef4ff;
  border: 1.5px solid #bfcfef;
  border-radius: 10px;
  padding: 14px 20px;
  text-align: center;
  line-height: 1.8;
  margin: 6px 0 4px;
}

.paynow-instruction p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.paynow-ref {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: underline;
  letter-spacing: 0.5px;
  margin: 4px 0;
}

.qr-modal-img-wrap {
  width: 300px;
  height: 300px;
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  margin: 12px 0 16px;
}

.qr-modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.btn-open-url {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.18s, color 0.18s;
  margin-bottom: 8px;
}

.btn-open-url:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-back-modal {
  width: 100%;
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s;
  margin-top: 4px;
  letter-spacing: 0.1px;
}

.btn-back-modal:hover {
  background: var(--navy-light);
}

.btn-back-modal:active {
  background: var(--navy-dark);
}


/* ── Misc ─────────────────────────────────────────────────── */
.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 56px 24px;
  font-size: 0.95rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

.footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  padding: 14px 16px;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}


/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .main-content {
    padding: 22px 20px 40px;
  }

  .sites-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 900px) {
  .navbar {
    padding: 0 16px;
  }

  .portal-title {
    display: none;
  }

  .main-content {
    padding: 18px 16px 36px;
  }

  .sites-grid {
    grid-template-columns: 1fr;
  }

  .actions-grid {
    grid-template-columns: 1fr;
  }

  .action-btn {
    min-height: 72px;
    padding: 20px 22px;
  }
}

@media (max-width: 600px) {
  .navbar {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .general-links-grid {
    flex-direction: column;
  }

  .general-link-card {
    min-width: unset;
  }

  .qr-modal-card {
    padding: 32px 24px 26px;
  }

  .qr-modal-img-wrap {
    width: 260px;
    height: 260px;
  }

  .qr-modal-title {
    font-size: 1.25rem;
  }
}