/* Billington Mobile Site Styles */

/* ============================================
   BRAND COLOR SYSTEM
   From Billington_Structures_Guidelines_V1_2024.pdf
   and GMISBlazor custom.css
   ============================================ */
:root {
  /* Primary Brand Colors */
  --billington-red: rgb(195, 32, 40);      /* Pantone 200c, #C32028 */
  --billington-blue: rgb(34, 22, 70);      /* Pantone 275c, #221646 */

  /* Brand Blue Tints (from brand guidelines) */
  --billington-blue-80: rgb(78, 69, 107);  /* 80% tint - #4E456B */
  --billington-blue-60: rgb(122, 115, 144); /* 60% tint - #7A7390 */

  /* Brand Red Tints (from brand guidelines) */
  --billington-red-80: rgb(207, 77, 83);   /* 80% tint - #CF4D53 */
  --billington-red-60: rgb(219, 121, 126); /* 60% tint - #DB797E */

  /* Brand Blue Light Tints (for backgrounds) */
  --billington-blue-10: rgb(233, 232, 238); /* 10% tint - #E9E8EE */

  /* Neutral Grays (from GMISBlazor) */
  --g-light-grey: rgb(193, 193, 193);      /* #C1C1C1 */
  --g-medium-grey: rgb(160, 160, 160);     /* #A0A0A0 */
  --g-dark-grey: rgb(76, 76, 76);          /* #4C4C4C */

  /* Brand Typography (from brand guidelines - Digital Font) */
  --brand-font: Calibri, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --brand-text-color: #212529;

  /* Override Bootstrap primary to Billington blue */
  --bs-primary: var(--billington-blue);
  --bs-primary-rgb: 34, 22, 70;

  /* Override Bootstrap body background */
  --bs-body-bg: var(--billington-blue-10);
  --bs-body-font-family: var(--brand-font);
  --bs-body-color: var(--brand-text-color);
}

/* Brand Background Utilities */
.bg-brand-80 {
  background-color: var(--billington-blue-80);
  color: white;
}

.bg-brand-60 {
  background-color: var(--billington-blue-60);
  color: white;
}

/* Brand Buttons */
.btn-brand {
  background-color: var(--billington-blue);
  border-color: var(--billington-blue);
  color: white;
}

.btn-brand:hover,
.btn-brand:focus {
  background-color: #1a1240;
  border-color: #1a1240;
  color: white;
}

.btn-brand:active {
  background-color: #110d2e;
  border-color: #110d2e;
  color: white;
}

/* 80% tint button */
.btn.btn-brand-80 {
  background-color: var(--billington-blue-80);
  border-color: var(--billington-blue-80);
  color: white;
}

.btn.btn-brand-80:hover,
.btn.btn-brand-80:focus {
  background-color: rgb(60, 52, 86);
  border-color: rgb(60, 52, 86);
  color: white;
}

.btn.btn-brand-80:active,
.btn.btn-brand-80:active:focus,
.btn.btn-brand-80.active {
  background-color: var(--billington-blue-60);
  border-color: var(--billington-blue-60);
  color: white;
}

/* 80% tint outline button */
.btn.btn-outline-brand-80 {
  background-color: transparent;
  border-color: var(--billington-blue-80);
  color: var(--billington-blue-80);
}

.btn.btn-outline-brand-80:hover,
.btn.btn-outline-brand-80:focus {
  background-color: var(--billington-blue-80);
  border-color: var(--billington-blue-80);
  color: white;
}

.btn.btn-outline-brand-80:active,
.btn.btn-outline-brand-80:active:focus {
  background-color: var(--billington-blue-60);
  border-color: var(--billington-blue-60);
  color: white;
}

/* Red button (for cancel/secondary actions) - 100% with 80% active */
.btn.btn-red-80 {
  background-color: var(--billington-red);
  border-color: var(--billington-red);
  color: white;
}

.btn.btn-red-80:hover,
.btn.btn-red-80:focus {
  background-color: rgb(175, 29, 36);
  border-color: rgb(175, 29, 36);
  color: white;
}

.btn.btn-red-80:active,
.btn.btn-red-80:active:focus {
  background-color: var(--billington-red-80);
  border-color: var(--billington-red-80);
  color: white;
}

/* 60% tint button */
.btn-brand-60 {
  background-color: var(--billington-blue-60);
  border-color: var(--billington-blue-60);
  color: white;
}

.btn-brand-60:hover,
.btn-brand-60:focus {
  background-color: rgb(100, 94, 120);
  border-color: rgb(100, 94, 120);
  color: white;
}

/* Circular icon button
   Creates a perfect circle button for icon-only actions.
   Use with color classes like btn-brand-80.
   Example: <button class="btn btn-circle btn-brand-80"><i class="fas fa-plus"></i></button>
*/
.btn.btn-circle {
  width: 40px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  align-self: center;
}

.btn-brand-60:active {
  background-color: rgb(80, 75, 100);
  border-color: rgb(80, 75, 100);
  color: white;
}

/* Grey buttons */
.btn-grey-dark {
  background-color: var(--g-dark-grey);
  border-color: var(--g-dark-grey);
  color: white;
}

.btn-grey-dark:hover,
.btn-grey-dark:focus {
  background-color: rgb(56, 56, 56);
  border-color: rgb(56, 56, 56);
  color: white;
}

.btn-grey-dark:active,
.btn-grey-dark:active:focus,
.btn-grey-dark.active {
  background-color: rgb(66, 66, 66);
  border-color: rgb(66, 66, 66);
  color: white;
}

.btn-grey-medium {
  background-color: var(--g-medium-grey);
  border-color: var(--g-medium-grey);
  color: white;
}

.btn-grey-medium:hover,
.btn-grey-medium:focus {
  background-color: rgb(140, 140, 140);
  border-color: rgb(140, 140, 140);
  color: white;
}

.btn-grey-medium:active {
  background-color: rgb(120, 120, 120);
  border-color: rgb(120, 120, 120);
  color: white;
}

html {
  font-size: 16px; /* Consistent size - prevents iOS zoom on form inputs */
  position: relative;
  min-height: 100%;
}

/* Body styles removed - using Bootstrap flex utilities for sticky footer */

/* Navbar Logo - Maintains navbar height (for unauthenticated users) */
.navbar-logo {
  height: 20px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Page Header Pattern - for page titles with optional back button */
.page-header {
  min-height: 44px;              /* Touch target minimum */
  padding-bottom: 1rem;          /* Breathing room below header */
  display: flex;
  align-items: center;           /* Vertically center content */
}

/* Back Button - PWA-friendly navigation for drill-down pages
   Styled to match hamburger menu button */
.page-back-btn {
  width: 44px;                   /* Slightly smaller than hamburger (56px) */
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;        /* Top-align in header, not center */
  border-radius: 50%;            /* Circular like hamburger */
  background-color: rgba(108, 117, 125, 0.85);  /* Match hamburger */
  border: none;
  color: white;
  font-size: 1.25rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.page-back-btn:hover {
  background-color: rgba(108, 117, 125, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-back-btn:active {
  background-color: rgba(108, 117, 125, 1);
  transform: scale(0.96);
}

/* Focus state for accessibility */
.page-back-btn:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* App Context Bar - Persistent header for authenticated users
   Shows brand (red) or project context (blue) with integrated hamburger menu */
.app-context-bar {
  position: sticky;
  top: 0;
  z-index: 1020;                   /* Below modals (1055), above content */
  color: white;
  padding: 0.5rem 0.75rem;         /* 8px 12px - compact padding */
  min-height: 48px;                /* Slightly taller to accommodate button */
  display: flex;
  align-items: center;
  justify-content: space-between;  /* Push menu button to right */
  font-size: 1.25rem;              /* 20px - matches card headers */
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Content wrapper - allows text truncation while button stays fixed */
.app-context-bar .context-bar-content {
  display: flex;
  align-items: center;
  min-width: 0;                    /* Allow flex item to shrink below content size */
  flex: 1;
}

/* Hamburger menu button - integrated into context bar */
.context-bar-menu-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.5rem;
  margin-left: 0.75rem;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.context-bar-menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.context-bar-menu-btn:active {
  background-color: rgba(255, 255, 255, 0.35);
  transform: scale(0.96);
}

.context-bar-menu-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Brand state - Red with logo only */
.app-context-bar--brand {
  background-color: var(--billington-red);
}

.app-context-bar--brand .context-bar-logo {
  height: 20px;
  width: auto;
}

/* Project state - Blue with project info */
.app-context-bar--project {
  background-color: var(--billington-blue);
}

.app-context-bar--project .project-code {
  font-weight: 700;
  flex-shrink: 0;
}

.app-context-bar--project .project-separator {
  opacity: 0.7;
  flex-shrink: 0;
}

.app-context-bar--project .project-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Menu Drawer - Modern minimal navigation */
.menu-drawer {
  background-color: #fff;
}

/* Dark grey header strip */
.menu-drawer-header {
  background-color: var(--g-dark-grey);
  padding: 0.25rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}

/* Header buttons - shared styles */
.menu-header-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  color: white;
  font-size: 1.25rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.menu-header-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
}

.menu-header-btn:active {
  background-color: rgba(255, 255, 255, 0.25);
}

.menu-header-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Logout button - text style with background */
.menu-logout-btn {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: white;
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.15);
  transition: background-color 0.2s ease;
}

.menu-logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  color: white;
}

.menu-logout-btn:active {
  background-color: rgba(255, 255, 255, 0.35);
}

/* Navigation list */
.menu-nav-list {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

/* Navigation items */
.menu-nav-item {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.25rem;
  margin: 0 1rem;
  color: #212529;
  text-decoration: none;
  border-bottom: 1px solid var(--g-light-grey);
  transition: background-color 0.15s ease;
}

.menu-nav-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: #212529;
  text-decoration: none;
}

.menu-nav-item:active {
  background-color: rgba(0, 0, 0, 0.08);
}

/* Section header - Billington blue with white text */
.menu-section-header {
  background-color: var(--billington-blue);
  color: white;
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  letter-spacing: 0.025em;
  margin-top: 0.5rem;
}



/* Page content section - full width available, no hamburger concerns */
.page-content {
  /* Content can use full width - positioned below header */
}

/* Mobile-optimised max width - keeps layout comfortable on desktop */
body {
  background-color: var(--g-dark-grey);
}

.app-shell {
  max-width: 576px;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--bs-body-bg);
}

/* Constrain offcanvas menu to app column on desktop viewports */
@media (min-width: 577px) {
  .offcanvas.offcanvas-end {
    right: calc(50% - 288px);
    transition: none;
  }

  .offcanvas.offcanvas-end.hiding {
    visibility: hidden;
  }
}

/* Page Bottom Spacing - Ensures breathing room at bottom of all pages */
main.flex-fill > .container-fluid {
  padding-bottom: 1.5rem;
}

/* Mobile-first responsive utilities */
.box-shadow {
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

/* HTMX Loading Indicators with 500ms Delay - No Layout Shift */

/* Hide indicator completely by default */
.htmx-indicator {
  display: none;
}

/* Button setup for loading state */
.btn {
  position: relative;
  min-width: var(--btn-min-width, auto);
}

/* Position indicator absolutely so it never affects layout */
.btn .htmx-indicator.htmx-request {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  /* Initially invisible, show after 500ms */
  opacity: 0;
  animation: showAfterDelay 0s step-end 0.5s forwards;
}

/* Show indicator instantly after 500ms delay */
@keyframes showAfterDelay {
  to {
    opacity: 1;
  }
}

/* Keep text visible and properly aligned */
.btn .btn-text {
  display: inline-flex;
  align-items: center;
}

/* Hide text after 500ms when indicator is active */
.btn:has(.htmx-indicator.htmx-request) .btn-text {
  animation: hideAfterDelay 0s step-end 0.5s forwards;
}

/* Fallback for browsers without :has() support */
.btn .htmx-indicator.htmx-request ~ .btn-text {
  animation: hideAfterDelay 0s step-end 0.5s forwards;
}

/* Hide text instantly after 500ms delay */
@keyframes hideAfterDelay {
  to {
    opacity: 0;
  }
}

/* Disable button interaction during request */
.btn:has(.htmx-indicator.htmx-request) {
  pointer-events: none;
  cursor: wait;
}

/* Enhanced pressed state for better tactile feedback */
.btn:active:not(:disabled):not(:has(.htmx-indicator.htmx-request)) {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* Ensure Bootstrap spinner sizing in buttons */
.btn .spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
  vertical-align: middle;
}

/* Avatar components */
.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
}

.avatar-title {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Offcanvas menu header - matches login navbar height */
.offcanvas-header.bg-primary {
  min-height: 56px; /* Match Bootstrap navbar default height */
  padding: 0.5rem 1rem;
  border-bottom: none;
}

/* Avatar inverted colors for blue header */
.offcanvas-header.bg-primary .avatar-title.bg-white {
  color: #0d6efd;
  font-weight: 600;
}

/* User email subtle appearance */
.offcanvas-header.bg-primary small.opacity-90 {
  opacity: 0.9;
}

/* Close button sizing and positioning on blue header */
.offcanvas-header.bg-primary .btn-close-white {
  width: 1.5em;
  height: 1.5em;
  margin-left: auto;
}

/* ============================================
   CUSTOM COMPONENTS (gm* Tag Helpers)
   ============================================ */

/* Ensure cards and list items have white background (needed with tinted body background) */
.card,
.list-group-item {
  background-color: #fff;
}

/* Square corners on cards */
.card {
  border-radius: 0;
}

/* gmCard - Reusable card component with clickable styling
   Usage: <gmCard title="..." icon="..." clickable="true">content</gmCard>
   Wrap in HTMX div or anchor tag for interactive behavior
*/
.card-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Remove anchor styling when wrapping clickable cards
   Usage: <a href="..." class="card-link"><gmCard clickable="true">...</gmCard></a>
*/
a.card-link {
  text-decoration: none;
  color: inherit;
}

a.card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Hover state - card lifts and shadow increases */
.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Active state - card returns to normal position with feedback */
.card-clickable:active {
  transform: translateY(0);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Prevent child elements from interfering with click events */
.card-clickable * {
  pointer-events: none;
}

/* Touch-friendly active state for mobile devices */
@media (hover: none) {
  .card-clickable:active {
    background-color: rgba(0, 0, 0, 0.02);
  }
}

/* Wizard card - fills available vertical space with buttons at bottom
   Usage: <gmCard card-class="wizard-card" body-class="wizard-body">
          <div class="wizard-content">...step content...</div>
          <partial name="_WizardNavButtons" />
          </gmCard>
*/
.wizard-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  max-height: calc(100vh - 130px);
}

.wizard-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden; /* Prevent body from overflowing */
}

.wizard-content {
  flex: 1;
  overflow-y: auto; /* Scroll when content overflows */
  padding-bottom: 0.5rem;
}

/* gmTitleBar - Section header bar below navbar
   Usage: <gmTitleBar title="..." back-url="..." header-action="..." />
   Displays: [back button] [title] [action buttons]
*/
.titlebar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  height: 44px;
  background-color: #ffffff;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 0.75rem;
}

.titlebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--brand-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Unified text color for cards */
.card-header {
  color: var(--brand-text-color);
}

.card-header h5 {
  font-weight: 600;
}

.card-body {
  color: var(--brand-text-color);
}

/* Section headers for unified list containers - matches gmCard header style */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--brand-text-color);
  background-color: #fff;
  border-bottom: 1px solid var(--bs-border-color);
}

.section-header i {
  font-size: 1.25rem;
}

/* Add top border to section headers that follow a list-group (divider between sections) */
.list-group + .section-header {
  border-top: 1px solid var(--bs-border-color);
}

/* Collapsible section headers */
.section-header[data-bs-toggle="collapse"] {
  cursor: pointer;
}

.section-header[data-bs-toggle="collapse"]:hover {
  background-color: var(--bs-gray-100);
}

.section-header .section-chevron {
  transition: transform 0.2s ease;
}

.section-header[aria-expanded="false"] .section-chevron {
  transform: rotate(-90deg);
}

.section-header[aria-expanded="false"] {
  border-bottom: none;
}

.titlebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #495057;
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.titlebar-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.titlebar-btn:active {
  color: var(--billington-red, #dc3545);
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ============================================
   FEATURE-SPECIFIC STYLES
   ============================================ */

/* Mobile-First File Upload Styles */
.file-upload-area {
  position: relative;
}

/* Hide file gallery placeholder when gallery items are present */
.file-gallery-empty:has(~ .file-gallery-item) {
  display: none;
}

.file-select-btn {
  min-height: 60px;
  border: 2px dashed #dee2e6;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.file-select-btn:hover {
  border-color: #0d6efd;
  background-color: #f8f9fa;
}

/* Consistent button sizing - applied at all screen sizes for visual consistency */
.btn {
  min-height: 44px;
  padding: 0.75rem 1rem;
}

.btn-lg {
  min-height: 48px;
  font-size: 1.1rem;
}

/* ============================================
   Login Page Styles
   ============================================ */

/* Login Page Layout */
.login-page {
  min-height: 100vh;
  background-color: white;
  display: flex;
  flex-direction: column;
}

.login-header {
  background-color: var(--billington-blue);
  padding: 2rem;
  text-align: center;
}

.login-logo {
  max-height: 60px;
  width: auto;
}

.login-holdings-logo {
  max-width: 280px;
  width: 100%;
  height: auto;
}

.login-content {
  flex: 1;
  padding: 2rem;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.login-title {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--billington-blue);
  font-weight: 600;
}

.login-footer {
  text-align: center;
  color: #6c757d;
  font-size: 0.875rem;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* Microsoft Sign-In Button - Billington Red */
.btn-microsoft {
  background-color: var(--billington-red);
  border-color: var(--billington-red);
  color: white;
  font-weight: 500;
}

.btn-microsoft:hover {
  background-color: rgb(175, 29, 36);
  border-color: rgb(175, 29, 36);
  color: white;
}

.btn-microsoft:active,
.btn-microsoft:focus {
  background-color: var(--billington-red-80);
  border-color: var(--billington-red-80);
  color: white;
  box-shadow: 0 0 0 0.25rem rgba(195, 32, 40, 0.25);
}

/* Login Divider - "OR" separator */
.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--g-medium-grey);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--g-light-grey);
}

.login-divider span {
  padding: 0 1rem;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Touch-friendly form elements - iOS Zoom Prevention (mobile-only) */
@media (max-width: 768px) {
  /* Standard form controls - prevents iOS zoom and improves touch targets */
  .form-control, .form-select {
    min-height: 44px;
    font-size: 16px; /* CRITICAL: Prevents iOS zoom on focus */
    padding: 0.5rem 0.75rem; /* Comfortable touch padding */
  }

  /* Large variants for emphasis screens */
  .form-control-lg, .form-select-lg {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Ensure textarea also prevents zoom */
  textarea.form-control {
    font-size: 16px;
  }

  /* Date and time inputs need explicit sizing */
  input[type="date"].form-control,
  input[type="time"].form-control,
  input[type="datetime-local"].form-control {
    font-size: 16px;
    min-height: 44px;
  }
}

/* Credential cards mobile optimization */
.credential-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Progress indicators */
.upload-progress {
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
}

/* Mobile-friendly alerts */
@media (max-width: 576px) {
  .alert {
    font-size: 0.9rem;
  }
  
  .alert .btn-close {
    font-size: 1.2rem;
  }
}

/* Improved touch targets for mobile */
.list-group-item {
  min-height: 80px;
}

.btn-group .btn {
  min-width: 44px;
  min-height: 44px;
}

/* Loading states for better UX */
.htmx-request .spinner-border,
.htmx-request .progress-bar-animated {
  animation-duration: 0.75s;
}

/* Ensure proper spacing on mobile */
@media (max-width: 576px) {
  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .card-body {
    padding: 1rem 0.75rem;
  }
}

/* Timeline styles - Required for activity timeline visualization */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  height: 100%;
  width: 2px;
  background: #dee2e6;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6c757d;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #dee2e6;
}

.timeline-icon {
  margin-left: -2rem;
}

@media (max-width: 768px) {
  .timeline {
    padding-left: 1.5rem;
  }
}

/* ============================================
   Credential Thumbnails
   ============================================ */

/* Credential thumbnail container - 100x100px for images and icons */
.credential-thumbnail {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0.25rem;
}

/* Shimmer skeleton loader for containers with images */
.credential-thumbnail:has(img) {
  background:
    linear-gradient(90deg,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.6) 50%,
      rgba(255, 255, 255, 0) 60%
    ),
    #f0f0f0;
  background-size: 300% 100%;
  background-position: -100% 0;
  animation: shimmer 2s ease-in-out infinite;
}

/* Thumbnail images - cropped to square, rounded corners, subtle border */
.credential-thumbnail img {
  object-fit: cover;
  border-color: #dee2e6;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show image when loaded */
.credential-thumbnail img[loading="lazy"] {
  opacity: 1;
}

/* Shimmer animation for loading state */
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================
   PDF VIEWER
   Fullscreen PDF viewer using PDF.js
   ============================================ */

.pdf-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1060;
  background: var(--billington-blue);
}

.pdf-viewer-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  z-index: 10;
  transition: opacity 300ms ease;
}

.pdf-viewer-header.hidden {
  opacity: 0;
  pointer-events: none;
}

.pdf-viewer-close {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pdf-viewer-close:hover,
.pdf-viewer-close:focus {
  opacity: 0.8;
  outline: none;
}

.pdf-viewer-close:active {
  opacity: 0.6;
}

.pdf-viewer-page-indicator {
  font-size: 0.875rem;
  opacity: 0.9;
}

.pdf-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: opacity 300ms ease, background 200ms ease;
}

.pdf-viewer-nav-prev {
  left: 12px;
  padding-right: 10px;
}

.pdf-viewer-nav-next {
  right: 12px;
  padding-left: 10px;
}

.pdf-viewer-nav:hover,
.pdf-viewer-nav:focus {
  background: rgba(0, 0, 0, 0.5);
  outline: none;
}

.pdf-viewer-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.pdf-viewer-nav.hidden {
  opacity: 0;
  pointer-events: none;
}

.pdf-viewer-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.pdf-viewer-canvas-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-viewer-canvas {
  transform-origin: center center;
  transition: transform 100ms ease-out;
}
