/**
 * Porsche GT Dynamic Social Proof & Scarcity Booking Calendar Engine
 * Designed for humancodeofhiring.com (Porsche GT Carbon / Defense Cockpit Standard)
 * Design Tokens:
 *   Canvas Black: #05070c | Cockpit BG: #0b0e14 | Card Surface: #0f131d | Surface Elevated: #131822
 *   Guards Red: #f43f5e | Racing Red Hover: #e11d48
 *   Tactical Green: #22c55e | Radar Cyan: #38bdf8 | Amber Warning: #f59e0b
 *   Pure White: #ffffff | Silver Slate: #cbd5e1 | Muted Steel: #94a3b8 | Dark Steel: #64748b
 *   Border Subtle: #475569 | Border Focus: #94a3b8 | Border Chrome: #cbd5e1
 *   Fonts: Space Grotesk (Primary Sans), JetBrains Mono (Technical Telemetry)
 */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
  --hch-bg-canvas: #05070c;
  --hch-bg-cockpit: #0b0e14;
  --hch-bg-card: #0f131d;
  --hch-bg-surface-elevated: #131822;
  --hch-bg-carbon-inset: #090c12;
  --hch-border-subtle: #475569;
  --hch-border-focus: #94a3b8;
  --hch-border-chrome: #cbd5e1;
  --hch-guards-red: #f43f5e;
  --hch-racing-red-hover: #e11d48;
  --hch-tactical-green: #22c55e;
  --hch-radar-cyan: #cbd5e1;
  --hch-amber-warn: #f59e0b;
  --hch-pure-white: #ffffff;
  --hch-silver-slate: #cbd5e1;
  --hch-muted-steel: #94a3b8;
  --hch-dark-steel: #64748b;
  --hch-font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --hch-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
}

#dynamic-booking-calendar-container,
.hch-dynamic-calendar,
.hch-calendar-container {
  scroll-margin-top: 2rem;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Master Container - Expanded to 100% full width with Authentic Porsche GT Metallic Silver Border & Glow */
.hch-calendar-container {
  font-family: var(--hch-font-sans);
  background-color: #0b0e14;
  background-image: 
    linear-gradient(180deg, rgba(19, 24, 34, 0.94) 0%, rgba(10, 14, 20, 0.98) 100%),
    linear-gradient(45deg, #131722 25%, transparent 25%, transparent 75%, #131722 75%, #131722),
    linear-gradient(45deg, #131722 25%, #080a0f 25%, #080a0f 75%, #131722 75%, #131722);
  background-size: 100% 100%, 8px 8px, 8px 8px;
  background-position: 0 0, 0 0, 4px 4px;
  color: var(--hch-pure-white);
  border: 1px solid #94a3b8 !important;
  border-radius: 8px !important;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.98), 
    0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 1px 0 0 rgba(255, 255, 255, 0.15),
    inset -1px 0 0 rgba(255, 255, 255, 0.15),
    0 0 35px rgba(226, 232, 240, 0.12) !important;
  padding: 28px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.hch-calendar-container * {
  box-sizing: border-box;
}

/* Hairline Glowing Silver Chrome Top Accent (Matching humancodeofhiring.com homepage) */
.hch-calendar-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffffff, #cbd5e1, #ffffff, transparent) !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.7) !important;
  opacity: 1 !important;
  z-index: 2;
}

/* Header Area */
.hch-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.hch-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.hch-badge-cockpit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(203, 213, 225, 0.08);
  border: 1px solid #94a3b8;
  color: #e2e8f0;
  font-family: var(--hch-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hch-badge-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  animation: hchPulse 2s infinite;
}

@keyframes hchPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hch-buffer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--hch-amber-warn);
  font-family: var(--hch-font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hch-title {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--hch-pure-white);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}

.hch-subtitle {
  font-size: 14px;
  color: var(--hch-silver-slate);
  line-height: 1.5;
  margin: 0;
}

/* Scarcity / High Demand Urgency Banner */
.hch-urgency-banner {
  background: linear-gradient(180deg, rgba(19, 24, 34, 0.95) 0%, rgba(10, 14, 20, 0.98) 100%);
  border: 1px solid #94a3b8;
  border-left: 3px solid var(--hch-guards-red);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hch-urgency-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hch-urgency-icon {
  font-size: 16px;
  line-height: 1;
  color: var(--hch-guards-red);
}

.hch-urgency-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--hch-pure-white);
}

.hch-urgency-text strong {
  color: var(--hch-guards-red);
}

.hch-urgency-stats {
  font-family: var(--hch-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--hch-guards-red);
  background: var(--hch-bg-carbon-inset);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(244, 63, 94, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Date Selector Navigation */
.hch-date-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #475569 transparent;
}

.hch-date-selector::-webkit-scrollbar {
  height: 4px;
}
.hch-date-selector::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.hch-day-pill {
  flex: 1;
  min-width: 140px;
  background: #0b0e14;
  border: 1px solid #64748b;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  user-select: none;
}

.hch-day-pill:hover {
  border-color: #94a3b8;
  background: #131822;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hch-day-pill.active {
  background: linear-gradient(180deg, #1e2430 0%, #0f131d 100%);
  border: 1px solid #ffffff !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 0 16px rgba(255, 255, 255, 0.2) !important;
}

.hch-day-pill.active .hch-day-name {
  color: #ffffff !important;
}

.hch-day-label {
  font-family: var(--hch-font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--hch-amber-warn);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.hch-day-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--hch-pure-white);
  margin-bottom: 4px;
}

.hch-day-availability {
  font-family: var(--hch-font-mono);
  font-size: 11px;
  color: var(--hch-silver-slate);
}

.hch-day-availability.scarce {
  color: var(--hch-tactical-green);
  font-weight: 600;
}

/* Time Slots Wrapper */
.hch-slots-wrapper {
  background: #080a0f;
  background-image: linear-gradient(180deg, rgba(16, 20, 28, 0.8) 0%, rgba(6, 8, 11, 0.95) 100%);
  border: 1px solid #475569;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 20px;
}

.hch-slots-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #475569;
  font-family: var(--hch-font-mono);
  font-size: 12px;
  color: var(--hch-silver-slate);
}

.hch-timezone-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
}

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

/* Individual Slot Card */
.hch-slot-card {
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 84px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

/* Open / Available Slot - Tactical Green Theme with Porsche GT silver highlight */
.hch-slot-card.open {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.12) 0%, rgba(11, 20, 16, 0.95) 100%);
  border: 1px solid #22c55e;
  cursor: pointer;
  box-shadow: 
    0 0 15px rgba(34, 197, 94, 0.25), 
    0 0 0 1px rgba(255, 255, 255, 0.18), 
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hch-slot-card.open:hover {
  transform: translateY(-2px);
  border-color: #4ade80;
  box-shadow: 
    0 0 25px rgba(34, 197, 94, 0.45), 
    0 0 0 1px rgba(255, 255, 255, 0.3), 
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.18) 0%, rgba(13, 26, 20, 0.98) 100%);
}

.hch-slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hch-slot-time {
  font-family: var(--hch-font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--hch-pure-white);
}

.hch-slot-card.open .hch-slot-time {
  color: var(--hch-pure-white);
}

.hch-slot-status-pill {
  font-family: var(--hch-font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.hch-slot-card.open .hch-slot-status-pill {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.38);
  color: var(--hch-tactical-green);
  animation: hchPulse 2s infinite;
}

.hch-slot-action-text {
  font-size: 12px;
  color: var(--hch-tactical-green);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hch-slot-card.open:hover .hch-slot-action-text {
  color: #4ade80;
}

/* Claimed / Booked Slot - Metallic Steel Theme */
.hch-slot-card.claimed {
  background: rgba(11, 14, 20, 0.88);
  border: 1px solid #334155;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0.72;
  cursor: not-allowed;
}

.hch-slot-card.claimed .hch-slot-time {
  color: #64748b;
  text-decoration: line-through;
  text-decoration-color: rgba(244, 63, 94, 0.65);
}

.hch-slot-card.claimed .hch-slot-status-pill {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--hch-guards-red);
}

.hch-claimed-meta {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--hch-font-sans);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal Overlay & Dialog */
.hch-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hch-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.hch-modal-dialog {
  background-color: #0b0e14;
  background-image: linear-gradient(180deg, rgba(19, 24, 34, 0.96) 0%, rgba(10, 14, 20, 0.98) 100%);
  border: 1px solid #94a3b8;
  border-radius: 8px;
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.98), 
    0 0 0 1px rgba(255, 255, 255, 0.2), 
    inset 0 1px 0 rgba(255, 255, 255, 0.5), 
    0 0 35px rgba(226, 232, 240, 0.15);
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hch-modal-overlay.active .hch-modal-dialog {
  transform: translateY(0) scale(1);
}

.hch-modal-header {
  background: #131822;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #475569;
  position: relative;
}

.hch-modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #475569;
  color: var(--hch-silver-slate);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hch-modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #ffffff;
  border-color: var(--hch-guards-red);
}

.hch-modal-slot-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(203, 213, 225, 0.08);
  border: 1px solid #94a3b8;
  color: #ffffff;
  font-family: var(--hch-font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hch-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--hch-pure-white);
  margin: 0 0 4px;
}

.hch-modal-subtitle {
  font-size: 13px;
  color: var(--hch-silver-slate);
  margin: 0;
}

/* Modal Form Body */
.hch-modal-body {
  padding: 22px 24px;
}

.hch-form-group {
  margin-bottom: 16px;
}

.hch-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--hch-silver-slate);
  margin-bottom: 6px;
}

.hch-form-label span.req {
  color: var(--hch-guards-red);
}

.hch-form-input,
.hch-form-textarea {
  width: 100%;
  background: #090c12;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--hch-font-sans);
  font-size: 13px;
  color: var(--hch-pure-white);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.hch-form-input:focus,
.hch-form-textarea:focus {
  outline: none;
  border-color: #cbd5e1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 12px rgba(203, 213, 225, 0.2);
  background: #0d121c;
}

.hch-form-textarea {
  resize: vertical;
  min-height: 60px;
}

.hch-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hch-modal-footer {
  padding: 16px 24px 22px;
  border-top: 1px solid #475569;
  background: var(--hch-bg-surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Primary Porsche GT Action Button */
.hch-btn-submit {
  background: var(--hch-guards-red);
  color: #ffffff;
  font-family: var(--hch-font-sans);
  font-size: 14px;
  font-weight: 700;
  padding: 13px;
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.01em;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.25);
}

.hch-btn-submit:hover {
  background: var(--hch-racing-red-hover);
  border-color: var(--hch-guards-red);
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.45);
  transform: translateY(-1px);
}

.hch-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.hch-legal-note {
  font-size: 11px;
  color: var(--hch-muted-steel);
  text-align: center;
  line-height: 1.4;
}

/* Success Confirmation State */
.hch-success-view {
  padding: 30px 24px;
  text-align: center;
}

.hch-success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid var(--hch-tactical-green);
  color: var(--hch-tactical-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.hch-success-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--hch-pure-white);
  margin-bottom: 8px;
}

.hch-success-desc {
  font-size: 14px;
  color: var(--hch-silver-slate);
  line-height: 1.5;
  margin-bottom: 20px;
}

.hch-dossier-pill {
  background: var(--hch-bg-carbon-inset);
  border: 1px solid #475569;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  padding: 14px;
  margin-bottom: 20px;
  font-family: var(--hch-font-mono);
  font-size: 12px;
  text-align: left;
}

.hch-dossier-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hch-dossier-row:last-child {
  margin-bottom: 0;
}

.hch-dossier-label {
  color: var(--hch-muted-steel);
}

.hch-dossier-val {
  color: var(--hch-pure-white);
  font-weight: 700;
}

.hch-cal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.hch-btn-cal {
  font-family: var(--hch-font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.hch-btn-cal.primary {
  background: var(--hch-tactical-green);
  color: #ffffff;
  border: 1px solid rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.25);
}

.hch-btn-cal.primary:hover {
  background: #16a34a;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.45);
  color: #ffffff;
}

.hch-btn-cal.secondary {
  background: var(--hch-bg-surface-elevated);
  color: var(--hch-silver-slate);
  border: 1px solid #475569;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hch-btn-cal.secondary:hover {
  background: #1e2430;
  color: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Mobile Responsive Refinements */
@media (max-width: 640px) {
  .hch-calendar-container {
    padding: 18px 14px;
    border-radius: 8px;
  }
  .hch-title {
    font-size: 1.25rem;
  }
  .hch-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .hch-day-pill {
    min-width: 120px;
    padding: 10px;
  }
  .hch-slots-grid {
    grid-template-columns: 1fr;
  }
}
