/*
 * Phase 6: unified SPORTONOM design system, Google Sign-In and live notification bell.
 * This file loads last so the legacy phase styles keep their markup contracts while
 * sharing one visual language.
 */

:root {
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --radius-sm: .65rem;
  --radius-md: .9rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --shadow-sm: 0 4px 14px rgba(7,17,31,.07);
  --shadow-md: 0 14px 34px rgba(7,17,31,.11);
  --shadow-lg: 0 24px 70px rgba(7,17,31,.18);
  --focus-ring: 0 0 0 4px rgba(73,163,255,.2);
  --transition-fast: 160ms ease;
  --transition: 220ms ease;
}

html { scroll-padding-top: 5rem; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
button, a, input, select, textarea, .ground-card, .sport-tile, .workspace-card, .owner-card, .admin-card, .review-card {
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}
.btn { min-height: 44px; border-radius: var(--radius-md); }
.btn-sm { min-height: 38px; border-radius: var(--radius-sm); }
.btn:active { transform: translateY(0) scale(.98); }
.nav-link, .user-pill, .text-link, .footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
.navbar-toggler { min-width: 44px; min-height: 44px; border-radius: var(--radius-sm); }
.site-header { backdrop-filter: blur(18px); }
.site-header .navbar { padding-top: .8rem; padding-bottom: .8rem; }
.brand-logo { border-radius: .7rem; }
.brand-wordmark { white-space: nowrap; }
.hero-copy, .hero-visual { position: relative; z-index: 1; }
.hero-copy .btn, .workspace-actions .btn { box-shadow: var(--shadow-md); }
.search-panel { box-shadow: 0 16px 42px rgba(0,0,0,.14); }
.section-heading { align-items: center; }
.section-heading h2 { max-width: 750px; }
.sport-tile, .ground-card, .metric-card, .workspace-card, .owner-card, .admin-card, .review-card, .qr-pass-card {
  box-shadow: var(--shadow-sm);
}
.sport-tile:hover, .ground-card:hover, .metric-card:hover { box-shadow: var(--shadow-md); }
.ground-card, .sport-tile, .metric-card, .workspace-card, .owner-card, .admin-card, .review-card, .qr-pass-card { border-radius: var(--radius-lg); }
.ground-card { transform: translateZ(0); }
.ground-card:hover { transform: translateY(-4px); }
.ground-image { min-height: 180px; }
.filter-bar, .admin-filter-bar, .owner-filter-bar { border: 1px solid #e4edf2; box-shadow: var(--shadow-sm); }
.filter-bar select, .admin-filter-bar input, .admin-filter-bar select, .owner-filter-bar input, .owner-filter-bar select {
  min-height: 44px;
}
.table-responsive { border-radius: var(--radius-md); scrollbar-color: #9bb1c0 transparent; }
.table-responsive:after { content: "Swipe horizontally to see more"; display: none; color: #8aa0af; font-size: .68rem; padding: .5rem .7rem; }
.status-badge { white-space: nowrap; line-height: 1.35; }
.flash-wrap { max-width: 960px; }
.alert { box-shadow: var(--shadow-sm); }
.auth-form input:not([type="checkbox"]), .auth-form select, .payment-form input, .payment-form select, .payment-form textarea,
.admin-form input, .admin-form select, .admin-form textarea, .owner-form input, .owner-form select, .owner-form textarea {
  min-height: 46px;
  border-radius: var(--radius-sm);
}
.auth-form button, .payment-form button { min-height: 48px; }
.form-help, .field-help { line-height: 1.5; }
.notification-bell-button, .push-enable-button, .install-app-button { min-width: 44px; }
.notification-bell-button { border-radius: 50%; }
.notification-panel { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.notification-panel-item { min-height: 64px; }
.notification-panel-item:hover { background: #edf7ff; }
.notification-panel-item.is-unread strong:before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 .4rem .1rem 0; border-radius: 50%; background: #ff3b5c; }
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading:after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1rem; height: 1rem; margin: -.5rem 0 0 -.5rem;
  border: 2px solid rgba(255,255,255,.72); border-right-color: transparent; border-radius: 50%; animation: sportonom-spin .7s linear infinite;
}
.motion-reveal { opacity: 1; }
.js-ready .motion-reveal { opacity: 0; transform: translateY(14px); }
.js-ready .motion-reveal.is-visible { opacity: 1; transform: translateY(0); transition: opacity 520ms ease var(--reveal-delay, 0ms), transform 520ms ease var(--reveal-delay, 0ms); }
.install-app-button[hidden] { display: none !important; }
.install-app-wrap { position: relative; }
.install-app-help {
  position: absolute; z-index: 1060; top: calc(100% + .55rem); right: 0; width: min(280px, calc(100vw - 2rem));
  padding: .7rem .8rem; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-md);
  background: #102337; color: #dceaf3; box-shadow: var(--shadow-lg); font-size: .72rem; line-height: 1.45;
}
.install-app-help-inline {
  position: static; display: inline-block; width: auto; max-width: 310px; padding: .65rem .8rem;
  background: #102337; border: 0; box-shadow: none; vertical-align: middle;
}
.install-app-help-inline[hidden] { display: none; }
.install-section { overflow: hidden; }
.install-panel {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 2rem; align-items: center;
  padding: clamp(1.5rem, 4vw, 3.2rem); border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #ffffff 0%, #edf7ff 100%); border: 1px solid #dcecf5; box-shadow: var(--shadow-md);
}
.install-panel h2 { margin: .7rem 0 1rem; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.02; }
.install-panel-copy > p { max-width: 520px; color: #668197; line-height: 1.7; }
.install-action { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1.35rem; }
.install-steps { display: grid; gap: .75rem; }
.install-steps > div { display: grid; grid-template-columns: 32px 28px 1fr; align-items: center; gap: .7rem; padding: .85rem; border: 1px solid #dcecf5; border-radius: var(--radius-md); background: rgba(255,255,255,.8); }
.install-steps span { color: #1685ff; font: 700 .7rem "Space Grotesk",sans-serif; }
.install-steps i { color: #1685ff; font-size: 1.1rem; }
.install-steps strong { color: #07111f; font-size: .85rem; }
.install-steps small { grid-column: 3; color: #7890a1; font-size: .7rem; margin-top: -.55rem; }
.owner-notification-actions { display: flex; justify-content: flex-end; margin-bottom: .55rem; }

@keyframes sportonom-spin { to { transform: rotate(360deg); } }

@media (max-width: 991.98px) {
  .site-header .navbar-collapse { padding: .5rem 0 1rem; }
  .site-header .navbar-nav { gap: .15rem!important; }
  .site-header .nav-link { border-radius: var(--radius-sm); padding-left: .75rem!important; }
  .site-header .nav-link:hover, .site-header .nav-link.active { background: rgba(255,255,255,.08); }
  .nav-actions { flex-wrap: wrap; }
  .hero-visual { margin-top: 1rem; }
}

@media (max-width: 767.98px) {
  .section-space { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .section-heading h2 { font-size: clamp(2rem, 8vw, 3rem); }
  .install-panel { grid-template-columns: 1fr; }
  .page-hero h1 { font-size: clamp(2.8rem, 12vw, 4.5rem); }
  .workspace-top { align-items: flex-start; }
  .workspace-top h1 { font-size: clamp(2.4rem, 10vw, 4rem); }
  .table-responsive:after { display: block; }
  .admin-table, .sportonom-table { min-width: 680px; }
  .notification-panel { max-width: calc(100vw - 1rem); }
}

@media (max-width: 575.98px) {
  body { padding-bottom: 4.5rem; }
  .container { --bs-gutter-x: 1.25rem; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.2rem); }
  .hero-lede { font-size: 1rem; }
  .hero-trust { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-visual { transform: none; margin: 0; min-height: 300px; }
  .visual-card-main { transform: rotate(2deg); }
  .floating-stat-top { right: -4px; top: 14px; }
  .floating-stat-bottom { left: -4px; bottom: 12px; }
  .floating-stat { padding: .65rem .75rem; }
  .footer-links { display: grid; grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; }
  .workspace-actions .btn, .workspace-actions { width: 100%; }
  .workspace-actions .btn { justify-content: center; }
  .metric-card strong { font-size: 2.1rem; }
  .booking-row { align-items: flex-start; flex-wrap: wrap; }
  .booking-row .status-badge { margin-left: auto; }
  .compact-empty { align-items: flex-start; }
  .auth-copy h1 { font-size: clamp(3rem, 14vw, 4rem); }
  .notification-panel { top: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; }
  .js-ready .motion-reveal { opacity: 1; transform: none; }
}

.google-signin-slot { display: flex; justify-content: center; margin: .35rem 0; min-height: 44px; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: #8fa2b3; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin: .85rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #dbe7ed; }

.notification-bell-wrap { position: relative; }
.notification-bell-button { position: relative; }
.notification-bell-count {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px; background: #ff3b5c; color: #fff; font-size: .62rem; font-weight: 700;
  display: none; align-items: center; justify-content: center; line-height: 1;
}
.notification-bell-count.has-unread { display: flex; }

.notification-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 320px; max-height: 380px; overflow-y: auto;
  background: #fff; border-radius: 14px; box-shadow: 0 18px 40px rgba(7,17,31,.25); border: 1px solid #e5eef2;
  z-index: 1050; display: none; padding: .4rem;
}
.notification-panel.is-open { display: block; }
.notification-panel-empty { padding: 1.2rem .75rem; text-align: center; color: #7890a1; font-size: .8rem; }
.notification-panel-item {
  display: block; padding: .65rem .7rem; border-radius: 10px; text-decoration: none; color: inherit;
  border-bottom: 1px solid #f0f4f7; cursor: pointer;
}
.notification-panel-item:last-child { border-bottom: 0; }
.notification-panel-item.is-unread { background: #f2f8ff; }
.notification-panel-item strong { display: block; font-size: .8rem; color: #07111f; margin-bottom: .15rem; }
.notification-panel-item span { display: block; font-size: .74rem; color: #647a8b; line-height: 1.4; }
.notification-panel-item small { display: block; margin-top: .3rem; font-size: .65rem; color: #9caebd; }

@media (max-width: 480px) {
  .notification-panel { position: fixed; top: 64px; right: 8px; left: 8px; width: auto; }
}

/* Unread-notification count on sidebar tabs (admin / owner / customer) */
.nav-count {
  margin-left: auto; flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #ff3b5c; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 1; font-style: normal;
}
.nav-count[hidden] { display: none; }

/* Booking views (Upcoming / History / All) and the used-pass state */
.booking-view-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1rem; }
.booking-view-tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 999px; background: #eef3f8; color: #3d5368; font-weight: 600; font-size: .88rem; text-decoration: none; border: 1px solid transparent; transition: background .15s ease, color .15s ease; }
.booking-view-tabs a:hover { background: #e2ecf6; }
.booking-view-tabs a.active { background: #07111f; color: #fff; }
.booking-view-tabs a span { min-width: 1.35rem; padding: .05rem .4rem; border-radius: 999px; background: rgba(7, 17, 31, .1); font-size: .76rem; font-weight: 700; text-align: center; }
.booking-view-tabs a.active span { background: rgba(255, 255, 255, .22); }
.qr-pass-card.qr-used .qr-used-note i { color: #1f9d55; }
.qr-pass-card.qr-used .qr-used-note { background: #eaf8ef; border-radius: 14px; padding: 1.1rem; }
.sportonom-table td small { display: block; }
