/* =========================================
   Franchising Compliance - Cal.com Custom CSS
   Brand: Navy #2B3A4D + Sky Blue #0EA5E9
   ========================================= */

/* Hide Cal.com branding footer */
[data-testid="powered-by-calcom-logo"],
a[href*="cal.com"]:has(svg),
footer a[href*="cal.com"],
.text-muted a[href*="cal.com"] {
  display: none !important;
}

/* Root variables override */
:root {
  --cal-brand: #0EA5E9 !important;
  --cal-brand-emphasis: #0284c7 !important;
  --cal-brand-text: #ffffff !important;
  --cal-brand-subtle: rgba(14, 165, 233, 0.1) !important;
}

/* Dark mode adjustments */
.dark {
  --cal-brand: #38bdf8 !important;
  --cal-brand-emphasis: #0EA5E9 !important;
}

/* Primary accent color - buttons, links, selected states */
[data-testid="time-select"] button:hover,
button[data-testid*="time"],
.bg-brand-default {
  background-color: #0EA5E9 !important;
}

/* Selected date styling */
[data-testid="calendar"] button[data-state="active"],
[aria-selected="true"] {
  background-color: #0EA5E9 !important;
  color: white !important;
}

/* Available dates with dots */
[data-testid="calendar"] .text-brand-default,
.bg-brand-default {
  color: #0EA5E9 !important;
}

/* Card container - add subtle shadow and border */
main > div,
[data-testid="event-meta"],
.bg-default {
  border-radius: 12px !important;
}

/* Typography - use system fonts with better weight */
h1, h2, h3, .font-semibold, .font-bold {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-weight: 600 !important;
}

/* Event title styling */
[data-testid="event-title"],
.text-emphasis {
  color: #2B3A4D !important;
  font-weight: 700 !important;
}

.dark [data-testid="event-title"],
.dark .text-emphasis {
  color: #f1f5f9 !important;
}

/* Description text */
[data-testid="event-meta"] p,
.text-default {
  color: #64748b !important;
}

.dark [data-testid="event-meta"] p,
.dark .text-default {
  color: #94a3b8 !important;
}

/* Time slots - subtle hover effect */
[data-testid="time"] {
  transition: all 0.2s ease !important;
  border-radius: 8px !important;
}

[data-testid="time"]:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15) !important;
}

/* Calendar navigation arrows */
[data-testid="calendar"] button svg {
  color: #0EA5E9 !important;
}

/* Month/year header */
[data-testid="calendar"] h2,
.font-medium {
  font-weight: 600 !important;
}

/* Need help button styling */
button:contains("Need help"),
[data-testid="need-help"] {
  border-color: #0EA5E9 !important;
  color: #0EA5E9 !important;
}

/* Form inputs */
input, textarea, select {
  border-radius: 8px !important;
  border-color: #e2e8f0 !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

input:focus, textarea:focus, select:focus {
  border-color: #0EA5E9 !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1) !important;
  outline: none !important;
}

/* Submit/Confirm button */
button[type="submit"],
.bg-brand-default,
[data-testid="confirm-book-button"] {
  background: linear-gradient(135deg, #0EA5E9 0%, #38bdf8 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25) !important;
}

button[type="submit"]:hover,
.bg-brand-default:hover,
[data-testid="confirm-book-button"]:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35) !important;
}

/* Profile avatar - make it slightly larger */
[data-testid="avatar"] img,
.rounded-full {
  border: 2px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(43, 58, 77, 0.1) !important;
}

/* Success/confirmation states */
.bg-success, .text-success, [data-testid="booking-confirmed"] {
  color: #22c55e !important;
}

/* Error states */
.bg-error, .text-error {
  color: #ef4444 !important;
}

/* Smooth transitions everywhere */
* {
  transition-property: background-color, border-color, color, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

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

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

.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

/* Accessibility - focus visible states */
*:focus-visible {
  outline: 2px solid #0EA5E9 !important;
  outline-offset: 2px !important;
}

/* =========================================
   Background Pattern
   ========================================= */

/* Main body background with pattern */
body {
  background-image: url('/cal-bg-pattern.png') !important;
  background-repeat: repeat !important;
  background-size: 400px auto !important;
  background-position: center top !important;
  background-attachment: fixed !important;
}

/* Add slight overlay for better readability */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: -1;
  pointer-events: none;
}

.dark body::before {
  background: rgba(15, 23, 42, 0.92);
}

/* Main content card - add stronger background */
main > div:first-child,
[data-testid="booker"],
.bg-default {
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 4px 24px rgba(43, 58, 77, 0.08) !important;
  border-radius: 16px !important;
}

.dark main > div:first-child,
.dark [data-testid="booker"],
.dark .bg-default {
  background: rgba(30, 41, 59, 0.98) !important;
}
