/* components/empty-state/empty-state.css */

/**
 * Empty State Component
 * Shows when there's no content to display
 * Full WCAG 2.2 AAA compliance
 * Three visual variants: default, file-icon, illustration
 */

/* ========================================
   Base Empty State Structure
   ======================================== */

.c-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: var(--ds-empty-state-max-width);
  margin: 0 auto;
  padding: var(--ds-space-xl) var(--ds-space-m);
  text-align: center;
  position: relative;
  min-height: 400px;
}

/* ========================================
   Header Section
   ======================================== */

.c-empty-state__header {
  position: relative;
  margin-bottom: var(--ds-empty-state-header-margin);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Background decoration for default variant */
.c-empty-state__bg-decoration {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  width: 30rem;
  height: 30rem;
  opacity: 0.6;
}

/* Concentric circles for default variant */
.c-empty-state__circles {
  width: 100%;
  height: 100%;
}

.c-empty-state__circles circle {
  fill: none;
  stroke: var(--ds-empty-state-circle-color);
  stroke-width: 1;
  opacity: 0.5;
}

/* Icon container */
.c-empty-state__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ds-empty-state-icon-size);
  height: var(--ds-empty-state-icon-size);
  background: var(--ds-color-primary);
  box-shadow: var(--ds-shadow-xs);
  border-radius: 10px;
  border: 1px solid var(--ds-color-primary);
  z-index: 10;
  /* color: var(--ds-color-text-on-accent); */
  color: var(--ds-color-text);
}

.c-empty-state__icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ========================================
   Content Section
   ======================================== */

.c-empty-state__content {
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--ds-empty-state-content-margin);
  gap: var(--ds-space-s);
  max-width: 22rem;
}

.c-empty-state__title {
  font-size: var(--ds-font-size-l);
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-color-text);
  line-height: var(--ds-line-height-s);
  margin: 0;
}

.c-empty-state__description {
  font-size: var(--ds-font-size-s);
  color: var(--ds-color-text-weak);
  line-height: var(--ds-line-height-m);
  margin: 0;
}

/* ========================================
   Footer Section
   ======================================== */

.c-empty-state__footer {
  z-index: 10;
  display: flex;
  gap: var(--ds-empty-state-footer-gap);
  flex-wrap: wrap;
  justify-content: center;
}

/* ========================================
   Variant: File Icon
   ======================================== */

.c-empty-state--file-icon .c-empty-state__header {
  margin-bottom: var(--ds-empty-state-header-margin);
}

.c-empty-state--file-icon .c-empty-state__icon {
  width: var(--ds-empty-state-icon-size-large);
  height: var(--ds-empty-state-icon-size-large);
  padding: var(--ds-space-xl);
  background: var(--ds-empty-state-bg-icon);
  border-radius: 50%;
  border: none;
  box-shadow: none;
}

.c-empty-state__file-icon {
  width: 2.5rem;
  height: 2.5rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* ========================================
   Variant: Illustration
   ======================================== */

.c-empty-state--illustration .c-empty-state__header {
  margin-bottom: var(--ds-empty-state-header-margin);
}

/* Grid background pattern */
.c-empty-state__grid-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30rem;
  height: 30rem;
  pointer-events: none;
  opacity: 0.3;
}

.c-empty-state__grid-bg line,
.c-empty-state__grid-bg rect {
  stroke: var(--ds-empty-state-grid-color);
  fill: none;
}

/* Cloud illustration container */
.c-empty-state__illustration {
  position: relative;
  width: var(--ds-empty-state-illustration-size);
  height: 8rem;
  z-index: 10;
}

.c-empty-state__cloud {
  width: 100%;
  height: 100%;
}

/* Floating search icon on cloud */
.c-empty-state__search-overlay {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--ds-empty-state-bg-overlay);
  backdrop-filter: blur(4px);
  color: white;
}

.c-empty-state__search-overlay svg {
  width: 1.75rem;
  height: 1.75rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ========================================
   Size Variants
   ======================================== */

/* Small */
.c-empty-state--small {
  min-height: 300px;
  padding: var(--ds-space-l) var(--ds-space-m);
}

.c-empty-state--small .c-empty-state__icon {
  width: 2.5rem;
  height: 2.5rem;
}

.c-empty-state--small .c-empty-state__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.c-empty-state--small .c-empty-state__content {
  max-width: 18rem;
}

.c-empty-state--small .c-empty-state__title {
  font-size: var(--ds-font-size-m);
}

/* Large */
.c-empty-state--large {
  min-height: 500px;
  padding: var(--ds-space-xxl) var(--ds-space-l);
}

.c-empty-state--large .c-empty-state__icon {
  width: 4rem;
  height: 4rem;
}

.c-empty-state--large .c-empty-state__icon svg {
  width: 2rem;
  height: 2rem;
}

.c-empty-state--large .c-empty-state__content {
  max-width: 28rem;
}

.c-empty-state--large .c-empty-state__title {
  font-size: var(--ds-font-size-xl);
}

.c-empty-state--large .c-empty-state__description {
  font-size: var(--ds-font-size-m);
}

/* ========================================
   State Modifiers
   ======================================== */

/* Loading state */
.c-empty-state--loading .c-empty-state__icon {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Error state */
.c-empty-state--error .c-empty-state__icon {
  background: var(--ds-color-status-danger);
  border-color: var(--ds-color-status-danger);
  color: white;
}

.c-empty-state--error .c-empty-state__title {
  color: var(--ds-color-text-danger);
}

/* Success state */
.c-empty-state--success .c-empty-state__icon {
  background: var(--ds-color-status-success);
  border-color: var(--ds-color-status-success);
  color: white;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 640px) {
  .c-empty-state {
    padding: var(--ds-space-l) var(--ds-space-s);
  }
  
  .c-empty-state__content {
    max-width: 100%;
  }
  
  .c-empty-state__footer {
    width: 100%;
    flex-direction: column;
  }
  
  .c-empty-state__footer .c-button {
    width: 100%;
  }
  
  .c-empty-state__bg-decoration,
  .c-empty-state__grid-bg {
    width: 20rem;
    height: 20rem;
  }
}

/* ========================================
   Accessibility
   ======================================== */

/* Focus visible */
.c-empty-state__footer .c-button:focus-visible {
  outline: var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);
  outline-offset: var(--ds-focus-ring-offset);
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .c-empty-state__icon {
    border-width: 2px;
  }
  
  .c-empty-state__bg-decoration,
  .c-empty-state__grid-bg {
    opacity: 1;
  }
  
  .c-empty-state__circles circle,
  .c-empty-state__grid-bg line {
    stroke-width: 2;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .c-empty-state--loading .c-empty-state__icon {
    animation: none;
  }
  
  .c-empty-state__bg-decoration,
  .c-empty-state__grid-bg {
    transition: none;
  }
}

/* Print styles */
@media print {
  .c-empty-state__bg-decoration,
  .c-empty-state__grid-bg,
  .c-empty-state__circles {
    display: none;
  }
  
  .c-empty-state {
    min-height: auto;
    padding: var(--ds-space-m);
  }
  
  .c-empty-state__icon {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Screen reader only text */
.c-empty-state__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}