/**
 * Custom PWA Page V2 Styles
 * Scoped strictly to .blizzard-web-app
 */

/* ================================================================
   1. Page Container & Layout Setup
================================================================ */
/* Main App Shell Container */
.blizzard-web-app {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding-top: 105px;
  padding-bottom: 140px;
  background-color: #ffffff;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.blizzard-web-app *,
.blizzard-web-app *::before,
.blizzard-web-app *::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* ================================================================
   2. Primary Zone (Hero + 2-Column Grid)
================================================================ */
.web-app-primary-zone {
  position: relative;
  background-color: #0e2b4c;
  background-image: var(--web-app-hero-image);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  padding-top: 24px;
  padding-bottom: 36px;
  z-index: 1;
  min-height: 300px;
}

/* Multi-layer Dark Blue to White Fade Overlay */
.web-app-primary-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 28, 52, 0.5) 0%,
    rgba(14, 43, 76, 0.25) 40%,
    rgba(255, 255, 255, 0.5) 75%,
    #ffffff 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Mountain Ridge Silhouette Transition Divider at bottom of Primary Zone */
.web-app-mountain-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 36px;
  z-index: 2;
  pointer-events: none;
  color: #ffffff;
}

.web-app-hero,
.web-app-primary-content {
  position: relative;
  z-index: 3;
  padding-left: 16px;
  padding-right: 16px;
}

.web-app-hero {
  padding-top: 10px;
  padding-bottom: 18px;
}

.web-app-hero-headline {
  font-family: "cabin-sketch-bold", "Poppins", sans-serif;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
  letter-spacing: -1px;
  max-width: 60%;
  transform: rotate(-5deg);
}

.web-app-hero-subheadline {
  font-size: 13px;
  color: #ffffff;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  transform: rotate(-2.5deg);
  margin-left: 8px;
}

.web-app-primary-content .web-app-section-heading {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0 0 12px 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* 2-Column Primary Grid */
.web-app-primary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Primary Action Card */
.web-app-primary-action {
  position: relative;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
  min-height: 112px;
  padding: 14px 12px 12px;
  border-radius: 16px;
  text-decoration: none !important;
  color: #ffffff !important;
  overflow: hidden;
  -webkit-box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  -webkit-transition:
    -webkit-transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    -webkit-box-shadow 0.2s ease;
  transition:
    -webkit-transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    -webkit-box-shadow 0.2s ease;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    -webkit-transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    -webkit-box-shadow 0.2s ease;
  background-color: #1278e4;
  -webkit-tap-highlight-color: transparent;
}

.web-app-primary-action:hover,
.web-app-primary-action:focus {
  -webkit-transform: translateY(-2px) scale(1.01);
  -ms-transform: translateY(-2px) scale(1.01);
  transform: translateY(-2px) scale(1.01);
  -webkit-box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
  color: #ffffff !important;
}

.web-app-primary-action:active {
  -webkit-transform: scale(0.98);
  -ms-transform: scale(0.98);
  transform: scale(0.98);
}

/* Color Schemes Matching Mockup */
.web-app-primary-action.color--blue {
  background: #0042b9;
}

.web-app-primary-action.color--sky {
  background: #0087e6;
}

.web-app-primary-action.color--orange {
  background: #f86a00;
}

.web-app-primary-action.color--green {
  background: #029d17;
}

/* Mountain Silhouette Watermark at the Bottom of Cards */
.web-app-primary-action::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpolygon points='0,40 0,25 35,10 70,28 110,5 155,26 185,14 200,22 200,40' fill='%23000000' opacity='0.22'/%3E%3Cpolygon points='0,40 15,30 45,18 80,32 125,12 165,30 200,18 200,40' fill='%23ffffff' opacity='0.16'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: bottom center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* Card Header: Icon + Label */
.web-app-action-top {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  position: relative;
  z-index: 2;
  gap: 10px;
}

.web-app-primary-action .web-app-action-icon {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  color: #ffffff;
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.web-app-primary-action .web-app-action-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.web-app-primary-action .web-app-action-icon img {
  max-width: 34px;
  max-height: 34px;
  -o-object-fit: contain;
  object-fit: contain;
}

.web-app-primary-action .web-app-action-label {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #ffffff;
  word-break: break-word;
}

/* Circular Bottom-Right Arrow Indicator */
.web-app-primary-action .web-app-action-bottom {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: end;
  -webkit-justify-content: flex-end;
  -ms-flex-pack: end;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
  margin-top: 10px;
}

.web-app-action-chevron {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  -webkit-transition:
    background 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    background 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    -webkit-transform 0.2s ease;
}

.web-app-primary-action:hover .web-app-action-chevron {
  background: rgba(255, 255, 255, 0.48);
  -webkit-transform: translateX(2px);
  -ms-transform: translateX(2px);
  transform: translateX(2px);
}

/* ================================================================
   3. Secondary Zone (Full-Width Rows)
================================================================ */
.web-app-secondary-zone {
  background-color: #ffffff;
  -webkit-box-flex: 1;
  -webkit-flex-grow: 1;
  -ms-flex-positive: 1;
  flex-grow: 1;
  position: relative;
}

.web-app-secondary-content {
  padding: 6px 16px 36px;
}

.web-app-secondary-header {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: baseline;
  -webkit-align-items: baseline;
  -ms-flex-align: baseline;
  align-items: baseline;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

.web-app-secondary-header .web-app-section-heading {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #1a608b;
  text-transform: uppercase;
  margin: 0 !important;
  line-height: 1.2;
}

.web-app-secondary-tagline {
  font-family: "Poppins", cursive, sans-serif;
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  color: #8c9fae;
  line-height: 1.2;
  letter-spacing: -1px;
  text-transform: uppercase;
  margin: 0;
  -webkit-transform: rotate(-10deg) translateY(-10px);
  -ms-transform: rotate(-10deg) translateY(-10px);
  transform: rotate(-10deg) translateY(-10px);
  max-width: 27%;
}

/* Secondary List */
.web-app-secondary-list {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 10px;
}

/* Secondary Action Card */
.web-app-secondary-action {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e3e9f0;
  -webkit-box-shadow: 0 2px 6px rgba(18, 52, 86, 0.05);
  box-shadow: 0 2px 6px rgba(18, 52, 86, 0.05);
  text-decoration: none !important;
  color: #1e293b !important;
  -webkit-transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.web-app-secondary-action:hover,
.web-app-secondary-action:focus {
  background: #f8fbff;
  border-color: #b9d5f5;
  -webkit-box-shadow: 0 4px 12px rgba(18, 120, 228, 0.12);
  box-shadow: 0 4px 12px rgba(18, 120, 228, 0.12);
  -webkit-transform: translateX(2px);
  -ms-transform: translateX(2px);
  transform: translateX(2px);
}

.web-app-secondary-action:active {
  -webkit-transform: scale(0.99);
  -ms-transform: scale(0.99);
  transform: scale(0.99);
}

/* Icon in Secondary Row */
.web-app-secondary-action .web-app-action-icon {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 32px;
  font-size: 20px;
  color: #1a608b;
  margin-right: 14px;
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.web-app-secondary-action .web-app-action-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.web-app-secondary-action .web-app-action-icon img {
  max-width: 26px;
  max-height: 26px;
  -o-object-fit: contain;
  object-fit: contain;
}

.web-app-secondary-action .web-app-action-label {
  font-size: 15px;
  font-weight: 700;
  color: #1a608b;
  margin-right: auto;
  line-height: 1.3;
}

/* Optional Pill Badge (e.g. CLINICIANS) */
.web-app-action-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background-color: #1a608b;
  color: #ffffff;
  margin-right: 10px;
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

/* Chevron arrow on right edge */
.web-app-secondary-action::after {
  content: "›";
  font-size: 22px;
  font-weight: 800;
  color: #1a608b;
  line-height: 1;
  margin-left: 6px;
  -webkit-transition:
    color 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    color 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
  transition:
    transform 0.2s ease,
    color 0.2s ease,
    -webkit-transform 0.2s ease;
}

.web-app-secondary-action:hover::after {
  -webkit-transform: translateX(3px);
  -ms-transform: translateX(3px);
  transform: translateX(3px);
  color: #1a608b;
}

/* ================================================================
   5. Mobile Responsiveness (touch targets min 44px, ≤360px screens)
================================================================ */
@media screen and (max-width: 360px) {
  .web-app-primary-grid {
    gap: 8px;
  }

  .web-app-primary-action {
    min-height: 98px;
    padding: 10px 8px 8px;
  }

  .web-app-action-top {
    gap: 6px;
  }

  .web-app-primary-action .web-app-action-icon {
    font-size: 22px;
  }

  .web-app-primary-action .web-app-action-label {
    font-size: 11px;
  }

  .web-app-secondary-action {
    min-height: 48px;
    padding: 10px 12px;
  }

  .web-app-secondary-action .web-app-action-label {
    font-size: 13px;
  }
}

/* ================================================================
   6. Fixed PWA Header & Footer Layering
================================================================ */
.custom-pwa-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 999 !important;
  background: #ffffff !important;
}

.custom-pwa-footer {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 999 !important;
  background: #ffffff !important;
  -webkit-box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15) !important;
}
