/* Crown Banner Widget Styles - All prefixed with .cbw- to avoid conflicts */

/* CSS Custom Properties for easy color customization */
:root {
  --cbw-gradient-color-1: rgba(24, 143, 207, 0.8);
  --cbw-gradient-color-2: rgba(0, 82, 129, 0.8);
  --cbw-gradient-color-3: rgba(37, 99, 235, 0.8);
  --cbw-text-color: #ffffff;
  --cbw-subtext-color: rgba(255, 255, 255, 0.95);
  --cbw-button-color: #f97316;
}

.cbw-banner {
  width: 100%;
  max-width: 1200px;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  margin: 20px auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

/* Animated Gradient Background */
.cbw-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    -45deg,
    var(--cbw-gradient-color-2),
    var(--cbw-gradient-color-1),
    var(--cbw-gradient-color-3),
    var(--cbw-gradient-color-1)
  );
  background-size: 300% 300%;
  animation: cbw-gradientShift 12s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes cbw-gradientShift {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 100% 100%;
  }
}

.cbw-content {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  align-items: center;
  box-sizing: border-box;
}

/* Loading State */
.cbw-content.cbw-loading {
  justify-content: center;
  align-items: center;
}

.cbw-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cbw-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: cbw-spin 1s linear infinite;
}

@keyframes cbw-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cbw-loading-text {
  color: var(--cbw-text-color) !important;
  font-family: 'Lato', sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  margin: 0 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.cbw-text-section {
  flex: 1.5;
  padding: 20px 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  transition: flex 0.3s ease;
}

.cbw-text-section.compact {
  flex: 1;
}

.cbw-text-section.expanded {
  flex: 2;
}

.cbw-text-section.very-expanded {
  flex: 2;
}

.cbw-headline {
  font-family: 'Playfair Display', serif !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--cbw-text-color) !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.2 !important;
}

.cbw-subtext {
  font-family: 'Lato', sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  color: var(--cbw-subtext-color) !important;
  margin: 0 0 12px 0 !important;
  line-height: 1.4 !important;
}

/* Higher specificity font size overrides */
.cbw-banner .cbw-headline {
  font-size: 1.6rem !important;
}

.cbw-banner .cbw-subtext {
  font-size: 1rem !important;
}

.cbw-image-section {
  flex: 1.2;
  height: 100%;
  position: relative;
  min-width: 0;
  transition: flex 0.3s ease;
}

/* Watermark - will be set dynamically by JavaScript */
.cbw-image-section.cbw-has-watermark::after {
  content: "";
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 25%;
  height: 25%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.4;
  z-index: 3;
  pointer-events: none;
  min-width: 40px;
  min-height: 40px;
  max-width: 80px;
  max-height: 80px;
}

.cbw-image-section.compact {
  flex: 1.5;
}

.cbw-image-section.expanded {
  flex: 1;
}

.cbw-image-section.very-expanded {
  flex: 1;
}

.cbw-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0 16px 16px 0;
}

.cbw-button-container {
  display: flex;
  justify-content: flex-start;
  margin-top: auto;
}

.cbw-button {
  font-family: 'Lato', sans-serif !important;
  background-color: var(--cbw-button-color) !important;
  color: white !important;
  padding: 8px 16px !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  display: inline-block !important;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3) !important;
}

.cbw-button:hover {
  background-color: white !important;
  color: #6b7280 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

.cbw-banner:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .cbw-banner {
    height: auto !important;
    min-height: 200px !important;
    max-height: none !important;
  }

  .cbw-content {
    flex-direction: column;
  }

  .cbw-text-section {
    flex: none;
    padding: 15px 12px;
    text-align: center;
  }

  .cbw-headline {
    font-size: 1.3rem !important;
    margin-bottom: 6px !important;
  }

  .cbw-subtext {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
  }

  .cbw-image-section {
    flex: none;
    height: 100px;
    width: 100%;
  }

  .cbw-button-container {
    justify-content: center;
  }

  .cbw-button {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
  }
}

@media (max-width: 480px) {
  .cbw-banner {
    min-height: 180px !important;
  }

  .cbw-headline {
    font-size: 1.2rem !important;
  }

  .cbw-subtext {
    font-size: 0.75rem !important;
  }

  .cbw-text-section {
    padding: 12px 10px;
  }

  .cbw-image-section {
    height: 80px;
  }

  .cbw-button-container {
    justify-content: center;
  }
}