/**
 * Empty States Component System
 * Purpose: CSS-only illustrations for empty data states
 * Author: BUILDER
 * Date: 2025-01-15
 * 
 * Integration: Include this file in your main stylesheet or link directly:
 * <link rel="stylesheet" href="/css/components/empty-states.css">
 */

/* ============================================
   BASE EMPTY STATE CONTAINER
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 400px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  opacity: 0.6;
}

/* ============================================
   ILLUSTRATION CONTAINER
   ============================================ */

.empty-state__illustration {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon {
  width: 100%;
  height: 100%;
  position: relative;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ============================================
   CONTENT STYLES
   ============================================ */

.empty-state__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state__title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  line-height: 1.4;
}

.empty-state__description {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  max-width: 280px;
  margin: 0;
}

.empty-state__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.empty-state__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.empty-state__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -2px rgba(59, 130, 246, 0.4);
}

.empty-state__secondary {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}

.empty-state__secondary:hover {
  color: #3b82f6;
}

/* ============================================
   VARIANT 1: EMPTY BOOKINGS (Calendar)
   ============================================ */

.empty-icon.empty-bookings .calendar-body {
  width: 56px;
  height: 56px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  position: relative;
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: #cbd5e1;
  }
  50% {
    border-color: #94a3b8;
  }
}

.calendar-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  border-radius: 6px 6px 0 0;
}

.calendar-header::before,
.calendar-header::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 6px;
  height: 10px;
  background: #94a3b8;
  border-radius: 2px;
}

.calendar-header::before {
  left: 12px;
}

.calendar-header::after {
  right: 12px;
}

.calendar-grid {
  position: absolute;
  top: 20px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
}

.grid-cell {
  background: #e2e8f0;
  border-radius: 2px;
  transition: background 0.2s ease;
}

.grid-cell.active {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  animation: pulse-cell 2s ease-in-out infinite;
}

@keyframes pulse-cell {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ============================================
   VARIANT 2: EMPTY CLIENTS (People)
   ============================================ */

.people-group {
  position: relative;
  width: 100%;
  height: 100%;
}

.person {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.person--main {
  left: 10px;
  top: 8px;
  z-index: 2;
  animation: float-person 3s ease-in-out infinite;
}

.person--secondary {
  right: 10px;
  top: 16px;
  transform: scale(0.75);
  opacity: 0.6;
  z-index: 1;
}

@keyframes float-person {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.person-head {
  width: 24px;
  height: 24px;
  border: 2px solid #64748b;
  border-radius: 50%;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.person-body {
  width: 32px;
  height: 20px;
  border: 2px solid #64748b;
  border-radius: 16px 16px 4px 4px;
  margin-top: -4px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.plus-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  animation: pulse-plus 2s ease-in-out infinite;
  z-index: 3;
}

@keyframes pulse-plus {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ============================================
   VARIANT 3: EMPTY SERVICES (Layers)
   ============================================ */

.layers-stack {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 10px auto;
}

.layer {
  position: absolute;
  width: 48px;
  height: 16px;
  left: 6px;
  border: 2px solid #64748b;
  border-radius: 4px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  transition: transform 0.3s ease;
}

.layer--back {
  top: 0;
  opacity: 0.4;
  transform: scaleX(0.9);
}

.layer--middle {
  top: 18px;
  opacity: 0.7;
  transform: scaleX(0.95);
}

.layer--front {
  top: 36px;
  opacity: 1;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
}

.empty-icon.empty-services:hover .layer--back {
  transform: scaleX(0.9) translateY(-4px);
}

.empty-icon.empty-services:hover .layer--front {
  transform: translateY(4px);
}

.dotted-line {
  position: absolute;
  right: -8px;
  top: 50%;
  width: 20px;
  height: 2px;
  border-top: 2px dotted #94a3b8;
  transform: translateY(-50%);
  animation: dash-move 1.5s linear infinite;
}

@keyframes dash-move {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 20;
  }
}

/* ============================================
   VARIANT 4: EMPTY SEARCH (Magnifier)
   ============================================ */

.search-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.magnifier {
  position: relative;
  animation: search-sway 3s ease-in-out infinite;
}

@keyframes search-sway {
  0%, 100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

.magnifier-glass {
  width: 36px;
  height: 36px;
  border: 3px solid #64748b;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.8) 0%, rgba(226, 232, 240, 0.6) 100%);
  position: relative;
}

.magnifier-glass::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 8px;
  width: 12px;
  height: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, transparent 100%);
  border-radius: 50%;
  transform: rotate(-45deg);
}

.magnifier-handle {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 16px;
  height: 4px;
  background: #64748b;
  border-radius: 2px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.no-results {
  position: absolute;
  bottom: 12px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.no-results__line {
  display: block;
  height: 3px;
  background: #ef4444;
  border-radius: 2px;
  animation: fade-lines 2s ease-in-out infinite;
}

.no-results__line:first-child {
  width: 16px;
}

.no-results__line:last-child {
  width: 10px;
  margin-left: auto;
}

@keyframes fade-lines {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* ============================================
   VARIANT 5: EMPTY NOTIFICATIONS (Bell)
   ============================================ */

.bell-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bell {
  position: relative;
  animation: gentle-swing 4s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes gentle-swing {
  0%, 100% {
    transform: rotate(-3deg);
  }
  25% {
    transform: rotate(3deg);
  }
  50% {
    transform: rotate(-2deg);
  }
  75% {
    transform: rotate(2deg);
  }
}

.bell-top {
  width: 8px;
  height: 6px;
  background: #64748b;
  border-radius: 4px 4px 0 0;
  margin: 0 auto;
}

.bell-body {
  width: 40px;
  height: 32px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 2px solid #64748b;
  border-radius: 20px 20px 4px 4px;
  position: relative;
}

.bell-body::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #94a3b8;
  border-radius: 50%;
}

.bell-clapper {
  width: 12px;
  height: 8px;
  background: #64748b;
  border-radius: 0 0 6px 6px;
  margin: -2px auto 0;
}

.zzz-group {
  position: absolute;
  top: 8px;
  right: 4px;
}

.zzz {
  position: absolute;
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  opacity: 0;
  animation: zzz-float 3s ease-in-out infinite;
}

.zzz--1 {
  right: 0;
  animation-delay: 0s;
}

.zzz--2 {
  right: 8px;
  top: -8px;
  font-size: 12px;
  animation-delay: 0.5s;
}

.zzz--3 {
  right: 16px;
  top: -16px;
  font-size: 10px;
  animation-delay: 1s;
}

@keyframes zzz-float {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-12px) translateX(8px);
  }
}

/* ============================================
   VARIANT 6: EMPTY DATA (Database)
   ============================================ */

.database-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.database {
  position: relative;
}

.database-cylinder {
  width: 44px;
  height: 48px;
  position: relative;
}

.cylinder-top {
  width: 44px;
  height: 12px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border: 2px solid #64748b;
  border-radius: 50%;
  position: relative;
  z-index: 3;
}

.cylinder-body {
  width: 44px;
  height: 32px;
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  border: 2px solid #64748b;
  border-top: none;
  border-bottom: none;
  margin-top: -6px;
  position: relative;
}

.cylinder-body::before,
.cylinder-body::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: #cbd5e1;
  border-radius: 1px;
}

.cylinder-body::before {
  top: 8px;
}

.cylinder-body::after {
  top: 18px;
}

.cylinder-bottom {
  width: 44px;
  height: 12px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border: 2px solid #64748b;
  border-radius: 50%;
  margin-top: -6px;
  position: relative;
  z-index: 1;
}

.data-particles {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float 2s ease-in-out infinite;
}

.particle:nth-child(1) {
  left: 0;
  top: 20px;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  right: 0;
  top: 30px;
  animation-delay: 0.6s;
}

.particle:nth-child(3) {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  animation-delay: 1.2s;
}

@keyframes particle-float {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 480px) {
  .empty-state {
    padding: 32px 20px;
    margin: 0 16px;
  }
  
  .empty-state__illustration {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
  }
  
  .empty-state__title {
    font-size: 16px;
  }
  
  .empty-state__description {
    font-size: 13px;
  }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
  .empty-state {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-color: rgba(71, 85, 105, 0.5);
  }
  
  .empty-state__title {
    color: #f1f5f9;
  }
  
  .empty-state__description {
    color: #94a3b8;
  }
  
  .empty-state__secondary {
    color: #94a3b8;
  }
  
  .empty-state__secondary:hover {
    color: #60a5fa;
  }
  
  /* Dark mode icon adjustments */
  .empty-icon.empty-bookings .calendar-body {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #475569;
  }
  
  .person-head,
  .person-body {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-color: #94a3b8;
  }
  
  .layer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #64748b;
  }
  
  .layer--front {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
    border-color: #60a5fa;
  }
  
  .bell-body {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  }
  
  .cylinder-top,
  .cylinder-bottom {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
  }
  
  .cylinder-body {
    background: linear-gradient(90deg, #334155 0%, #1e293b 50%, #334155 100%);
  }
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .empty-icon,
  .grid-cell.active,
  .plus-badge,
  .magnifier,
  .bell,
  .zzz,
  .particle,
  .person--main {
    animation: none;
  }
  
  .dotted-line {
    animation: none;
  }
}