/* ═══════════════════════════════════════════════════════════
   EMMACULATE CRM — Base Styles
   Reset, global styles, keyframe animations
   ═══════════════════════════════════════════════════════════ */

/* ── Modern Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  height: 100%;
  overflow: hidden;
  transition: var(--transition-theme);
  user-select: none;
  -webkit-user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* ── Typography Defaults ── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

h5 {
  font-size: var(--text-md);
}

h6 {
  font-size: var(--text-base);
}

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  opacity: 0.85;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

/* ── Material Icons — Global Consistency ── */
.material-icons-round {
  font-size: 20px !important;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  vertical-align: middle;
}

/* Size variants for specific contexts */
.material-icons-round.icon-sm { font-size: 16px !important; width: 16px; height: 16px; }
.material-icons-round.icon-lg { font-size: 24px !important; width: 24px; height: 24px; }
.material-icons-round.icon-xl { font-size: 28px !important; width: 28px; height: 28px; }

/* Nav icons need to be 24px */
.nav-item-icon .material-icons-round { font-size: 24px !important; width: 24px; height: 24px; }

/* Splash icons */
.splash-logo .material-icons-round { font-size: 36px !important; width: 36px; height: 36px; }

/* Auth logo */
.auth-logo .material-icons-round { font-size: 28px !important; width: 28px; height: 28px; }

/* App bar button icons */
.app-bar-btn .material-icons-round { font-size: 22px !important; width: 22px; height: 22px; }
.app-bar-back .material-icons-round { font-size: 24px !important; width: 24px; height: 24px; }

/* Empty state */
.empty-state-icon .material-icons-round { font-size: 32px !important; width: 32px; height: 32px; }

/* FAB */
.fab .material-icons-round { font-size: 24px !important; width: 24px; height: 24px; }

/* Email illustration */
.email-sent-illustration .material-icons-round { font-size: 40px !important; width: 40px; height: 40px; }

/* Confirm dialog */
.confirm-dialog .confirm-icon .material-icons-round { font-size: 24px !important; width: 24px; height: 24px; }

/* Small context icons (detail items, session details) */
.booking-detail-item .material-icons-round,
.session-detail .material-icons-round { font-size: 16px !important; width: 16px; height: 16px; }

/* Star rating */
.star-rating .star { font-size: 18px; }

/* Small button icons */
.btn-icon-sm .material-icons-round { font-size: 18px !important; width: 18px; height: 18px; }

/* Stat change icons */
.stat-change .material-icons-round { font-size: 14px !important; width: 14px; height: 14px; }

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

ul,
ol {
  list-style: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--color-gray-700);
}

/* ── Focus Ring ── */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Selection ── */
::selection {
  background-color: var(--color-blue-100);
  color: var(--color-blue);
}

/* ── Utility Classes ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-medium {
  font-weight: var(--font-medium);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-bold {
  font-weight: var(--font-bold);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.text-3xl {
  font-size: var(--text-3xl);
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-tertiary {
  color: var(--text-tertiary);
}

.text-blue {
  color: var(--color-blue);
}

.text-success {
  color: var(--color-success);
}

.text-warning {
  color: var(--color-warning);
}

.text-danger {
  color: var(--color-danger);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

.flex-1 {
  flex: 1;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

.relative {
  position: relative;
}

.mt-1 {
  margin-top: var(--space-1);
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-1 {
  margin-bottom: var(--space-1);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-3 {
  margin-bottom: var(--space-3);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.p-3 {
  padding: var(--space-3);
}

.p-4 {
  padding: var(--space-4);
}

.p-5 {
  padding: var(--space-5);
}

.p-6 {
  padding: var(--space-6);
}

.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.px-5 {
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.py-2 {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.py-3 {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

/* ── Keyframe Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }

  50% {
    transform: scale(1.05);
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes progressBar {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

@keyframes dotPulse {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* ── Animation Utility Classes ── */
.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-default) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-down {
  animation: fadeInDown var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-scale {
  animation: fadeInScale var(--duration-slow) var(--ease-out) forwards;
}

.animate-slide-up {
  animation: slideUp var(--duration-slow) var(--ease-out) forwards;
}

.animate-bounce-in {
  animation: bounceIn var(--duration-slower) var(--ease-bounce) forwards;
}

.animate-shake {
  animation: shake 0.5s var(--ease-default);
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-pulse {
  animation: pulse 2s var(--ease-default) infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Staggered children animation */
.stagger-children>* {
  opacity: 0;
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.stagger-children>*:nth-child(1) {
  animation-delay: 0ms;
}

.stagger-children>*:nth-child(2) {
  animation-delay: 60ms;
}

.stagger-children>*:nth-child(3) {
  animation-delay: 120ms;
}

.stagger-children>*:nth-child(4) {
  animation-delay: 180ms;
}

.stagger-children>*:nth-child(5) {
  animation-delay: 240ms;
}

.stagger-children>*:nth-child(6) {
  animation-delay: 300ms;
}

.stagger-children>*:nth-child(7) {
  animation-delay: 360ms;
}

.stagger-children>*:nth-child(8) {
  animation-delay: 420ms;
}

.stagger-children>*:nth-child(9) {
  animation-delay: 480ms;
}

.stagger-children>*:nth-child(10) {
  animation-delay: 540ms;
}