/**
 * Cherry Blossom Tax - Custom Styles
 * Modern animations, effects, and brand styling
 */

/* ===== CSS Custom Properties ===== */
:root {
  --navy: #0A2342;
  --gold: #BFA356;
  --gold-dark: #CBA137;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;

  --font-heading: "Montserrat", sans-serif;
  --font-body: "Open Sans", sans-serif;

  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ===== Placeholder Safety System (Pre-Launch) ===== */
/*
 * CRITICAL: These styles highlight placeholder content that MUST be replaced
 * before deploying to production. The warning banner and counter help prevent
 * accidental deployment with incomplete data.
 */

/* Level 1: Text Placeholders - Bright yellow for text that needs replacing */
.placeholder {
  background: linear-gradient(135deg, #FEF08A 0%, #FDE047 100%) !important;
  color: #713F12 !important;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px dashed #CA8A04;
  font-weight: inherit;
  position: relative;
}

.placeholder::before {
  content: '!';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 16px;
  height: 16px;
  background: #DC2626;
  color: white;
  font-size: 10px;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Level 2: Integration Placeholders - Orange for links/integrations pending */
.placeholder-integration {
  background: linear-gradient(135deg, #FED7AA 0%, #FDBA74 100%) !important;
  color: #9A3412 !important;
  padding: 2px 8px;
  border-radius: 4px;
  border: 2px dashed #EA580C;
  position: relative;
}

.placeholder-integration::after {
  content: 'INTEGRATION NEEDED';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #EA580C;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
  z-index: 1;
}

/* Level 3: Image Placeholders - Labeled overlay for stock images */
.placeholder-image {
  position: relative;
  overflow: hidden;
}

.placeholder-image::after {
  content: 'REPLACE WITH REAL PHOTO';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(234, 88, 12, 0.95));
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 24px 12px 12px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Global Warning Banner */
#placeholder-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(90deg, #DC2626 0%, #B91C1C 100%);
  color: white;
  padding: 12px 16px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

#placeholder-warning .warning-pulse {
  animation: warningPulse 1.5s ease-in-out infinite;
}

@keyframes warningPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#placeholder-warning .dismiss-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#placeholder-warning .dismiss-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Placeholder Counter Dashboard (Dev Only) */
#placeholder-dashboard {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  z-index: 9998;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  min-width: 200px;
}

#placeholder-dashboard .dashboard-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#placeholder-dashboard .dashboard-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #EF4444;
  border-radius: 50%;
  animation: warningPulse 1.5s ease-in-out infinite;
}

#placeholder-dashboard .dashboard-stats {
  display: flex;
  gap: 16px;
}

#placeholder-dashboard .stat {
  text-align: center;
}

#placeholder-dashboard .stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

#placeholder-dashboard .stat-value.text { color: #FDE047; }
#placeholder-dashboard .stat-value.integration { color: #FDBA74; }
#placeholder-dashboard .stat-value.image { color: #FCA5A5; }

#placeholder-dashboard .stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

#placeholder-dashboard .close-dashboard {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
}

#placeholder-dashboard .close-dashboard:hover {
  color: white;
}

/* Adjust body padding when warning banner is visible */
body.has-placeholder-warning {
  padding-top: 48px;
}

/* Hide placeholder system in print */
@media print {
  .placeholder,
  .placeholder-integration {
    background: transparent !important;
    color: inherit !important;
    padding: 0;
    border: none;
  }

  .placeholder::before,
  .placeholder-integration::after,
  .placeholder-image::after {
    display: none !important;
  }

  #placeholder-warning,
  #placeholder-dashboard {
    display: none !important;
  }
}

/* ===== Base Styles ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: var(--font-body);
  color: var(--navy);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.font-heading {
  font-family: var(--font-heading);
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  z-index: 100;
  transition: top var(--transition-base);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ===== Focus States ===== */
*:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ===== Icon Styles ===== */
.logo-icon {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 48;
}

.filled-icon {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ===== Brand Logo Styles ===== */
.brand picture,
.brand img {
  display: block;
}

/* ===== Navigation Link Styles ===== */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--gold);
  transition: width var(--transition-base);
}

.nav-link:hover::after {
  width: 100%;
}

/* ===== Button Styles ===== */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left var(--transition-slow);
}

.btn-primary:hover::before {
  left: 100%;
}

/* ===== Header Scroll Effect ===== */
#header.scrolled {
  box-shadow: var(--shadow-md);
}

/* ===== Mobile Menu ===== */
#mobile-menu.is-open {
  pointer-events: auto;
}

#mobile-menu.is-open .mobile-menu-backdrop {
  opacity: 1;
}

#mobile-menu.is-open .mobile-menu-drawer {
  transform: translateX(0);
}

.mobile-nav-link {
  position: relative;
  transition: all var(--transition-base);
}

.mobile-nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background-color: var(--gold);
  border-radius: 2px;
  transition: height var(--transition-base);
}

.mobile-nav-link:hover::before {
  height: 60%;
}

/* ===== Card Hover Effects ===== */
.service-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.service-card:hover .w-16 {
  transform: scale(1.1);
  transition: transform var(--transition-base);
}

.testimonial-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ===== Scroll Animations ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays */
.animate-on-scroll[style*="animation-delay: 0.1s"] { transition-delay: 0.1s; }
.animate-on-scroll[style*="animation-delay: 0.2s"] { transition-delay: 0.2s; }
.animate-on-scroll[style*="animation-delay: 0.3s"] { transition-delay: 0.3s; }
.animate-on-scroll[style*="animation-delay: 0.4s"] { transition-delay: 0.4s; }

/* ===== FAQ Accordion ===== */
.faq-item summary {
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] summary {
  color: var(--gold);
}

.faq-item > div {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Form Styles ===== */
input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(191, 163, 86, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: #9CA3AF;
}

/* Form loading state */
.form-loading button[type="submit"] {
  pointer-events: none;
  opacity: 0.7;
}

/* ===== Notification Toast ===== */
.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: slideInUp 0.3s ease-out;
}

.notification.success {
  background-color: #10B981;
  color: white;
}

.notification.error {
  background-color: #EF4444;
  color: white;
}

.notification.fade-out {
  animation: fadeOutDown 0.3s ease-out forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* ===== Cherry Blossom Decorative Elements ===== */
.cherry-blossom-bg {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(191, 163, 86, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(191, 163, 86, 0.08) 0%, transparent 40%);
}

/* Hero Background Pattern Animation */
.hero-pattern {
  animation: heroDrift 60s linear infinite;
}

@keyframes heroDrift {
  from {
    transform: translateX(0) translateY(0);
  }
  to {
    transform: translateX(120px) translateY(120px);
  }
}

/* Hero Content Staggered Animation */
.hero-content > * {
  opacity: 0;
  transform: translateY(30px);
  animation: heroReveal 0.8s var(--ease-smooth, ease-out) forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.3s; }
.hero-content > *:nth-child(4) { animation-delay: 0.4s; }
.hero-content > *:nth-child(5) { animation-delay: 0.5s; }
.hero-content > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Primary CTA Pulse Animation */
.btn-primary.cta-pulse {
  animation: ctaPulse 2s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(191, 163, 86, 0.4);
  }
  50% {
    box-shadow: 0 4px 30px rgba(191, 163, 86, 0.6),
                0 0 0 8px rgba(191, 163, 86, 0.1);
  }
}

/* ===== Gradient Text ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--navy) 0%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Loading Spinner ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Prose Styles (Legal Pages) ===== */
.prose {
  max-width: 65ch;
  line-height: 1.75;
}

.prose h2 {
  font-family: var(--font-heading);
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.prose h3 {
  font-family: var(--font-heading);
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p {
  margin-bottom: 1.25rem;
  color: rgba(10, 35, 66, 0.8);
}

.prose ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
  color: rgba(10, 35, 66, 0.8);
}

.prose a {
  color: var(--gold-dark);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.prose a:hover {
  color: var(--navy);
}

/* ===== Print Styles ===== */
@media print {
  header,
  footer,
  #mobile-menu,
  .btn-primary,
  .skip-link,
  #portal,
  form {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: black;
    background: white;
  }

  h1, h2, h3, h4 {
    page-break-after: avoid;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    color: #666;
  }

  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* ===== Trust Badge Tooltips ===== */
.trust-badge-wrapper {
  transition: transform var(--transition-base);
}

.trust-badge-wrapper:hover {
  transform: translateY(-4px);
}

.trust-badge-tooltip {
  pointer-events: none;
}

/* Hide tooltips on mobile (touch devices) */
@media (max-width: 768px) {
  .trust-badge-tooltip {
    display: none !important;
  }
}

/* ===== Testimonial Card Enhancements ===== */
.testimonial-card {
  transform-origin: center bottom;
}

.testimonial-card:hover {
  transform: translateY(-8px);
}

/* ===== Availability Pulse Animation ===== */
@keyframes availability-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* ===== Mobile Sticky CTA Bar ===== */
#mobile-cta-bar {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Add bottom padding on mobile for sticky CTA */
@media (max-width: 1023px) {
  body {
    padding-bottom: 64px; /* Height of sticky CTA bar */
  }

  footer {
    padding-bottom: 80px; /* Extra padding in footer */
  }
}

/* ===== Responsive Utilities ===== */
@media (max-width: 640px) {
  .service-card:hover,
  .testimonial-card:hover {
    transform: none;
  }

  .trust-badge-wrapper:hover {
    transform: none;
  }

  /* Improved mobile typography */
  .hero-content h1 {
    font-size: 2rem;
  }

  /* Better tap targets */
  .btn-primary,
  button,
  a {
    min-height: 44px;
  }
}
