/* Base Message Container */
.adsoverai-message {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--adsoverai-bg, #f5f5f5);
  border-radius: 12px;
  max-width: 100%;
}

/* AI Response Text */
.adsoverai-response {
  font-size: 15px;
  line-height: 1.6;
  color: var(--adsoverai-text, #1a1a1a);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Ads Grid Container */
.adsoverai-ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--adsoverai-border, #e0e0e0);
}

/* Individual Ad Card */
.adsoverai-ad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.adsoverai-ad-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.adsoverai-ad-card:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Ad Content */
.ad-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.ad-brand {
  font-size: 12px;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ad-product {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}

.ad-description {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-price {
  font-size: 18px;
  font-weight: 700;
  color: #007bff;
  margin-top: 4px;
}

/* CTA Button */
.ad-cta {
  margin-top: auto;
  padding: 10px 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
}

.ad-cta:hover {
  background: #0056b3;
}

.ad-cta:active {
  background: #004494;
}

/* Sponsored Label */
.ad-label {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Skeleton Styles */
.adsoverai-skeleton-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.adsoverai-skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.skeleton-image,
.skeleton-title,
.skeleton-price,
.skeleton-button,
.skeleton-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-image {
  width: 100%;
  height: 120px;
  border-radius: 6px;
}

.skeleton-title {
  width: 80%;
  height: 16px;
}

.skeleton-price {
  width: 40%;
  height: 20px;
  margin-top: 4px;
}

.skeleton-button {
  width: 100%;
  height: 40px;
  margin-top: 8px;
  border-radius: 6px;
}

/* Banner Skeleton */
.adsoverai-skeleton-banner {
  padding: 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.skeleton-line {
  width: 100%;
  height: 20px;
  margin-bottom: 8px;
}

.skeleton-line:last-child {
  width: 60%;
  margin-bottom: 0;
}

/* Minimal Skeleton */
.adsoverai-skeleton-minimal {
  padding: 12px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* Skeleton Animation */
@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Dark Theme */
[data-theme='dark'] .adsoverai-message {
  --adsoverai-bg: #2a2a2a;
  --adsoverai-text: #ffffff;
  --adsoverai-border: #404040;
}

[data-theme='dark'] .adsoverai-ad-card {
  background: #1a1a1a;
  border-color: #404040;
}

[data-theme='dark'] .ad-product {
  color: #ffffff;
}

[data-theme='dark'] .ad-description,
[data-theme='dark'] .ad-brand {
  color: #b0b0b0;
}

[data-theme='dark'] .ad-label {
  background: rgba(0, 0, 0, 0.6);
  color: #b0b0b0;
}

[data-theme='dark'] .adsoverai-skeleton-card,
[data-theme='dark'] .adsoverai-skeleton-banner {
  background: #1a1a1a;
  border-color: #404040;
}

/* Responsive Design */
@media (max-width: 768px) {
  .adsoverai-ads-grid {
    grid-template-columns: 1fr;
  }

  .adsoverai-message {
    padding: 12px;
  }

  .ad-product {
    font-size: 15px;
  }

  .ad-description {
    font-size: 13px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .adsoverai-ad-card {
    transition: none;
  }

  .skeleton-image,
  .skeleton-title,
  .skeleton-price,
  .skeleton-button,
  .skeleton-line {
    animation: none;
    background: #f0f0f0;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .adsoverai-ad-card {
    border: 2px solid #000;
  }

  .ad-cta {
    border: 2px solid #000;
  }
}