/**
 * Animated Card Styles
 * Grafic animat cu efecte hover și tranziții smooth
 */

.animated-card {
  position: relative;
  width: 356px;
  overflow: hidden;
  border-radius: 1rem;
  border: 3px solid #FF8C42;
  background-color: white;
  box-shadow: 0 10px 25px -5px rgba(255, 107, 61, 0.3), 0 8px 10px -6px rgba(255, 107, 61, 0.2);
  transition: all 0.3s ease;
}

.animated-card:hover {
  box-shadow: 0 20px 35px -5px rgba(255, 107, 61, 0.4), 0 12px 15px -6px rgba(255, 107, 61, 0.3);
  transform: translateY(-5px);
  border-color: #FF6B3D;
}

/* Card Visual */
.card-visual {
  height: 180px;
  width: 356px;
  overflow: hidden;
  position: relative;
}

.visual-container {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  border-radius: 0.75rem 0.75rem 0 0;
}

/* Layers */
.layer {
  position: absolute;
  pointer-events: none;
}

/* Layer 1: Bar Chart - Slides left on hover */
.layer-1 {
  top: 0;
  left: 0;
  z-index: 6;
  transform: translateX(0);
  transition: transform 500ms cubic-bezier(0.6, 0.6, 0, 1);
}

.animated-card:hover .layer-1 {
  transform: translateX(-50%);
}

.layer-svg {
  width: 712px;
  height: auto;
}

/* Layer 2: Line Chart - Reveal effect on hover */
.layer-2 {
  position: absolute;
  top: 0;
  left: -1px;
  height: 100%;
  width: 356px;
  z-index: 2;
}

.layer-svg-full {
  height: 100%;
  width: 356px;
}

.layer-gradient {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(to right, transparent 0%, white 15%);
  transform: translateX(0);
  transition: transform 500ms cubic-bezier(0.6, 0.6, 0, 1);
}

.animated-card:hover .layer-gradient {
  transform: translateX(100%);
}

/* Layer 3: Legend badges - Fade out on hover */
.layer-3 {
  top: 1rem;
  right: 1rem;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-badge {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid #e4e4e7;
  background-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  padding: 0.125rem 0.375rem;
  transition: opacity 300ms ease-in-out;
}

.animated-card:hover .legend-badge {
  opacity: 0;
}

.legend-dot {
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 9999px;
}

.legend-text {
  margin-left: 0.25rem;
  font-size: 0.625rem;
  color: #000;
}

/* Layer 4: Tooltip - Slides down on hover */
.layer-4 {
  position: relative;
  height: 100%;
  width: 356px;
  z-index: 7;
}

.tooltip-container {
  position: absolute;
  inset: 0;
  display: flex;
  max-width: 356px;
  align-items: flex-start;
  justify-content: flex-start;
  background-color: transparent;
  padding: 1rem;
  transform: translateY(-100%);
  transition: transform 500ms cubic-bezier(0.6, 0.6, 0, 1);
}

.animated-card:hover .tooltip-container {
  transform: translateY(0);
}

.tooltip-content {
  border-radius: 0.375rem;
  border: 1px solid #e4e4e7;
  background-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  padding: 0.375rem;
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.6, 0.6, 0, 1);
}

.animated-card:hover .tooltip-content {
  opacity: 1;
}

.tooltip-title {
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #000;
}

.tooltip-desc {
  font-size: 0.75rem;
  color: #737373;
}

/* Ellipse Gradient */
.ellipse-gradient {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
}

/* Grid Layer */
.grid-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  height: 100%;
  width: 100%;
  background-color: transparent;
  background-image: 
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center;
  opacity: 0.7;
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, transparent 100%);
}

/* Card Body */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  border-top: 1px solid #e4e4e7;
  padding: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  color: #000;
  margin: 0;
}

.card-description {
  font-size: 0.875rem;
  color: #737373;
  margin: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .animated-card {
    border-color: #27272a;
    background-color: #000;
  }

  .layer-gradient {
    background: linear-gradient(to right, transparent 0%, black 15%);
  }

  .legend-badge {
    border-color: #27272a;
    background-color: rgba(0, 0, 0, 0.25);
  }

  .legend-text,
  .tooltip-title,
  .card-title {
    color: #fff;
  }

  .tooltip-content {
    border-color: #27272a;
    background-color: rgba(0, 0, 0, 0.25);
  }

  .tooltip-desc,
  .card-description {
    color: #a3a3a3;
  }

  .card-body {
    border-top-color: #27272a;
  }
}

/* Responsive */
@media (max-width: 400px) {
  .animated-card {
    width: 100%;
    max-width: 356px;
  }

  .card-visual,
  .layer-2,
  .layer-4 {
    width: 100%;
  }
}

/* Stats Grid for multiple cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 356px));
  gap: 2rem;
  justify-content: center;
  margin: 0 auto;
  padding: 2rem 1rem;
  max-width: 1200px;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
