/**
 * Stock Performance Overview Shortcode Styles
 */

/* Container and resets */
.stock-performance-overview-container {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #1a202c;
  max-width: 100%;
  margin: 0 auto;
}

.stock-performance-overview-container * {
  box-sizing: border-box;
}

/* Title - removed as per design */
.stock-performance-overview-container .performance-overview-title {
  display: none;
}

/* Grid layout */
.stock-performance-overview-container .performance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
}

/* Performance cards */
.stock-performance-overview-container .performance-card {
  background: #f6f6f9;
  border-radius: 4px;
  padding: 20px;
  margin: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stock-performance-overview-container .performance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Period label */
.stock-performance-overview-container .period-label {
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  color: #080e2d;
  margin: 0 0 16px 0;
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
  font-style: normal;
}

/* Performance values container - 2 columns side by side */
.stock-performance-overview-container .performance-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

/* Stock columns */
.stock-performance-overview-container .stock-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}

/* Stock name */
.stock-performance-overview-container .stock-name {
  font-size: 11px;
  font-weight: 500;
  color: #080e2d;
  margin: 0;
  padding: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stock value */
.stock-performance-overview-container .stock-value {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  padding: 0;
  text-align: left;
}

/* Positive values (green) */
.stock-performance-overview-container .stock-value.positive {
  color: #027b66;
}

/* Negative values (red) */
.stock-performance-overview-container .stock-value.negative {
  color: #e53e3e;
}

/* N/A values */
.stock-performance-overview-container .stock-value.na {
  color: #a0aec0;
  font-style: italic;
}

/* Tablet layout - 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
  .stock-performance-overview-container .performance-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .stock-performance-overview-container .performance-card {
    padding: 18px;
  }
}

/* Mobile responsive - single column layout */
@media (max-width: 768px) {
  .stock-performance-overview-container .performance-overview-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .stock-performance-overview-container .performance-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stock-performance-overview-container .performance-card {
    padding: 16px;
  }

  .stock-performance-overview-container .period-label {
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 19px;
  }

  .stock-performance-overview-container .stock-name {
    font-size: 12px;
  }

  .stock-performance-overview-container .stock-value {
    font-size: 14px;
  }
}

/* Small desktop - maintain 4 columns but adjust font sizes */
@media (min-width: 1025px) and (max-width: 1280px) {
  .stock-performance-overview-container .stock-name {
    font-size: 10px;
  }

  .stock-performance-overview-container .stock-value {
    font-size: 13px;
  }
}

/* Breakdance Builder specific overrides */
.breakdance .stock-performance-overview-container {
  margin: 0;
  padding: 0;
}

.breakdance .stock-performance-overview-container .performance-overview-title {
  margin-top: 0;
}

.breakdance .stock-performance-overview-container .performance-grid {
  margin: 0;
  padding: 0;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .stock-performance-overview-container {
    color: #e2e8f0;
  }

  .stock-performance-overview-container .performance-overview-title {
    color: #e2e8f0;
  }

  .stock-performance-overview-container .performance-card {
    background: #2d3748;
  }

  .stock-performance-overview-container .period-label {
    color: #cbd5e0;
  }

  .stock-performance-overview-container .stock-name {
    color: #a0aec0;
  }
}

/* Loading state (optional) */
.stock-performance-overview-container.loading .performance-card {
  opacity: 0.6;
  pointer-events: none;
}

.stock-performance-overview-container.loading .stock-value {
  background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e0 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  color: transparent;
  min-width: 60px;
  display: inline-block;
}

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