/* ============================================================
   ZMLC UX STATE SYSTEM — ux-states.css
   Industry-standard loading, error, success & interaction states
   Color palette: Forest Green, Counsel Green, Mint, Midnight
   ============================================================ */

/* ─── CSS CUSTOM PROPERTIES ────────────────────────────────── */
:root {
  --ux-forest:   #1A4A2E;
  --ux-counsel:  #2E7D52;
  --ux-mint:     #EAF4EE;
  --ux-midnight: #0D2518;
  --ux-parchment:#D1D1CC;
  --ux-slate:    #6B6B66;
  --ux-error:    #DC2626;
  --ux-success:  #16A34A;
  --ux-warning:  #D97706;
}

/* ─── 1. TOP PROGRESS BAR ──────────────────────────────────── */
#page-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #2E7D52, #1A4A2E);
  z-index: 999999;
  transition: width 0.3s ease, opacity 0.4s ease;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}
#page-progress-bar.loading  { width: 70%; }
#page-progress-bar.complete { width: 100%; opacity: 0; }

/* ─── 2. GLOBAL LOADER OVERRIDE ────────────────────────────── */
#global-loader {
  background: #FFFFFF;
}
.loader-spinner {
  border: 3px solid rgba(26, 74, 46, 0.12);
  border-top-color: #1A4A2E;
}
.loader-brand-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  color: #2E7D52;
  letter-spacing: 0.08em;
  margin-top: 10px;
  opacity: 0.85;
  text-align: center;
  font-weight: 700;
}

/* ─── 3. SKELETON SHIMMER SYSTEM ───────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton-line {
  background: linear-gradient(90deg, #EAF4EE 25%, #D1D1CC 50%, #EAF4EE 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  display: block;
}

.skeleton-avatar {
  background: linear-gradient(90deg, #EAF4EE 25%, #D1D1CC 50%, #EAF4EE 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

.skeleton-rect {
  background: linear-gradient(90deg, #EAF4EE 25%, #D1D1CC 50%, #EAF4EE 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  display: block;
}

.skeleton-card {
  background: white;
  border: 1px solid #D1D1CC;
  border-radius: 12px;
  padding: 24px;
  overflow: hidden;
}

/* Stagger animation delays for visual polish */
.skeleton-card:nth-child(2) .skeleton-line,
.skeleton-card:nth-child(2) .skeleton-avatar,
.skeleton-card:nth-child(2) .skeleton-rect { animation-delay: 0.1s; }

.skeleton-card:nth-child(3) .skeleton-line,
.skeleton-card:nth-child(3) .skeleton-avatar,
.skeleton-card:nth-child(3) .skeleton-rect { animation-delay: 0.2s; }

.skeleton-card:nth-child(4) .skeleton-line,
.skeleton-card:nth-child(4) .skeleton-avatar,
.skeleton-card:nth-child(4) .skeleton-rect { animation-delay: 0.3s; }

.skeleton-card:nth-child(5) .skeleton-line,
.skeleton-card:nth-child(5) .skeleton-avatar,
.skeleton-card:nth-child(5) .skeleton-rect { animation-delay: 0.15s; }

.skeleton-card:nth-child(6) .skeleton-line,
.skeleton-card:nth-child(6) .skeleton-avatar,
.skeleton-card:nth-child(6) .skeleton-rect { animation-delay: 0.25s; }

/* ─── 4. STATE SYSTEM (error / empty) ─────────────────────── */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 40px 20px;
  text-align: center;
  grid-column: 1 / -1;
}

.state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.state-error .state-icon  { background: #FEF2F2; color: #DC2626; }
.state-empty .state-icon  { background: #EAF4EE; color: #1A4A2E; }

.state-title {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #111111;
  margin-bottom: 8px;
}

.state-desc {
  font-size: 0.875rem;
  color: #6B6B66;
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.state-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1.5px solid #2E7D52;
  color: #2E7D52;
  background: transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Inter', sans-serif;
}
.state-retry-btn:hover {
  background: #EAF4EE;
  border-color: #1A4A2E;
  color: #1A4A2E;
}

/* ─── 5. FORM VALIDATION STATES ────────────────────────────── */
.testi-input,
.contact-input,
#contact-form input,
#contact-form textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-error-state {
  border-color: #DC2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
  outline: none !important;
}

.field-success-state {
  border-color: #2E7D52 !important;
  box-shadow: 0 0 0 3px rgba(46, 125, 82, 0.1) !important;
  outline: none !important;
}

.field-error-msg {
  font-size: 0.78rem;
  color: #DC2626;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
}

.field-success-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #2E7D52;
  font-size: 0.9rem;
  pointer-events: none;
}

.form-group-relative {
  position: relative;
}

/* ─── 6. INLINE BUTTON SPINNER ─────────────────────────────── */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
  cursor: not-allowed !important;
}

.btn-loading .btn-text {
  opacity: 0;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes btn-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* For outline-style buttons */
.btn-loading.btn-outline::after {
  border-color: rgba(46, 125, 82, 0.3);
  border-top-color: #2E7D52;
}

/* ─── 7. TOAST NOTIFICATION SYSTEM ─────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0,0,0,0.06);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.toast.toast-visible { transform: translateX(0); }
.toast.toast-hiding  { transform: translateX(120%); transition: transform 0.3s ease-in; }

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success { border-left: 4px solid #2E7D52; }
.toast-success .toast-icon { background: #EAF4EE; color: #2E7D52; }

.toast-error { border-left: 4px solid #DC2626; }
.toast-error .toast-icon { background: #FEF2F2; color: #DC2626; }

.toast-info { border-left: 4px solid #1A4A2E; }
.toast-info .toast-icon { background: #EAF4EE; color: #1A4A2E; }

.toast-message {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: #111111;
  line-height: 1.5;
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #6B6B66;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  margin-left: 4px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.toast-close:hover { color: #111111; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  animation: toast-progress 4s linear forwards;
}
.toast-success .toast-progress { background: #2E7D52; }
.toast-error   .toast-progress { background: #DC2626; }
.toast-info    .toast-progress { background: #1A4A2E; }

@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ─── 8. BACK TO TOP BUTTON ─────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: #1A4A2E;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(26, 74, 46, 0.3);
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#back-to-top:hover {
  background: #0D2518;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 74, 46, 0.4);
}

/* ─── 9. CONTACT FORM SUCCESS CARD ─────────────────────────── */
.success-card {
  background: white;
  border-radius: 12px;
  border-top: 4px solid #1A4A2E;
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.success-checkmark-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #EAF4EE;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  color: #2E7D52;
  animation: success-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes success-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111111;
  margin-bottom: 8px;
}

.success-desc {
  color: #6B6B66;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ─── 10. SCROLL-ACTIVATED HEADER ──────────────────────────── */
header.scrolled,
.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
  transition: box-shadow 0.3s ease, padding 0.3s ease;
}

/* ─── 11. SCROLL ANIMATIONS ────────────────────────────────── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.animate-on-scroll:nth-child(2) { transition-delay: 0.10s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.20s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.30s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.15s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.25s; }

/* ─── 11.1 GOOGLE-STYLE SCROLL REVEAL ANIMATIONS ───────────── */
.reveal-on-scroll {
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Specific reveal effects */
.reveal-on-scroll.reveal-slide-up {
  transform: translateY(40px);
}

.reveal-on-scroll.reveal-slide-down {
  transform: translateY(-50px);
}

.reveal-on-scroll.reveal-fade-in {
  transform: none;
}

.reveal-on-scroll.reveal-scale-up {
  transform: scale(0.95);
}

/* Triggered reveal state */
.reveal-on-scroll.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Micro-delays for premium staggered grids */
.reveal-delay-100 { transition-delay: 100ms; }
.reveal-delay-200 { transition-delay: 200ms; }
.reveal-delay-300 { transition-delay: 300ms; }
.reveal-delay-400 { transition-delay: 400ms; }
.reveal-delay-500 { transition-delay: 500ms; }

/* ─── 12. RESPONSIVE ADJUSTMENTS ───────────────────────────── */
@media (max-width: 480px) {
  #toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  .toast {
    min-width: unset;
    max-width: 100%;
  }
  #back-to-top {
    bottom: 80px;
    right: 16px;
  }
}

/* ─── 13. LAWYER CARDS PREMIUM UX STATES ───────────────────── */
.lawyer-card {
  background-color: #FFFFFF !important;
  border: 1px solid rgba(46, 125, 82, 0.12) !important;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.lawyer-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 20px 35px rgba(26, 74, 46, 0.15) !important;
  border-color: #2E7D52 !important;
}

.lawyer-card:active {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 20px rgba(26, 74, 46, 0.12) !important;
}

