/* Podcast Popup Pro - Frontend Styles */

/* Prevent FOUC - Show popup immediately when active */
#podcast-popup-modal {
  display: none !important;
}

#podcast-popup-modal.ppp-active {
  display: flex !important;
}

/* Optimize animations for faster loading */
.podcast-popup-modal.ppp-active .podcast-popup-content {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Fast podcast item animations */
.podcast-item {
  opacity: 1 !important; /* Show immediately */
  transform: translateY(0) !important; /* No initial offset */
  animation: none !important; /* Remove entrance animation */
}

/* Corporate Color Variables */
:root {
  --ppp-primary-gradient: linear-gradient(20deg, #d6c7a9, #bf9f78 50%, #e0cc99 100%);
  --ppp-primary-color: #bf9f78;
  --ppp-primary-light: #d6c7a9;
  --ppp-primary-darker: #9d825f;
  --ppp-text-dark: #1c1c1c;
  --ppp-text-light: #6B7280;
  --ppp-white: #ffffff;
  --ppp-shadow-light: rgba(28, 28, 28, 0.1);
  --ppp-shadow-medium: rgba(28, 28, 28, 0.15);
  --ppp-shadow-dark: rgba(28, 28, 28, 0.3);
}

/* Trigger Button Styles - NUR für Shortcode-Buttons */
.podcast-popup-trigger.ppp-trigger-button {
  background: var(--ppp-primary-gradient) !important;
  color: var(--ppp-text-dark) !important;
  border: none !important;
  padding: 14px 28px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: 0 4px 12px var(--ppp-shadow-light) !important;
  text-decoration: none !important;
  line-height: 1.5 !important;
  position: relative !important;
  overflow: hidden !important;
}

.podcast-popup-trigger.ppp-trigger-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px var(--ppp-shadow-medium) !important;
  background: linear-gradient(20deg, #bf9f78, #d6c7a9 50%, #bf9f78 100%) !important;
  color: var(--ppp-text-dark) !important;
  text-decoration: none !important;
}

.podcast-popup-trigger.ppp-trigger-button:focus {
  outline: 2px solid var(--ppp-primary-color) !important;
  outline-offset: 3px !important;
}

.podcast-popup-trigger.ppp-trigger-button:active {
  transform: translateY(0) !important;
}

/* Icon NUR für Shortcode-Buttons */
.podcast-popup-trigger.ppp-trigger-button::before {
  content: "🎙️" !important;
  font-size: 1.1em !important;
  margin-right: 4px !important;
}

/* Minimales Styling für manuelle Trigger - KEIN Design override */
.podcast-popup-trigger:not(.ppp-trigger-button) {
  cursor: pointer !important;
  /* Keine weiteren Styles - behält ursprüngliches Design */
}

/* Modal Base */
.podcast-popup-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  background: rgba(0, 0, 0, 0.4) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.podcast-popup-modal.ppp-active {
  opacity: 1 !important;
  visibility: visible !important;
}

.podcast-popup-modal.ppp-active .podcast-popup-content {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
}

/* Modal Content - Faster transitions */
.podcast-popup-content {
  position: relative !important;
  background: var(--ppp-white) !important;
  border-radius: 24px !important;
  max-width: 1000px !important;
  width: 100% !important;
  max-height: 90vh !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 40px 80px var(--ppp-shadow-dark) !important;
  transform: translateY(20px) scale(0.98) !important;
  opacity: 0 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden !important;
}

/* Header */
.podcast-popup-header {
  background: var(--ppp-primary-gradient) !important;
  padding: 32px 40px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-radius: 24px 24px 0 0 !important;
  position: relative !important;
}

.podcast-popup-header::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="%23ffffff" opacity="0.03"/><circle cx="80" cy="40" r="0.5" fill="%23ffffff" opacity="0.05"/><circle cx="40" cy="80" r="0.8" fill="%23ffffff" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat !important;
  pointer-events: none !important;
}

.podcast-popup-title {
  font-size: 2.25rem !important;
  font-weight: 700 !important;
  color: var(--ppp-text-dark) !important;
  margin: 0 !important;
  position: relative !important;
  z-index: 1 !important;
}

.podcast-popup-close {
  background: rgba(28, 28, 28, 0.08) !important;
  border: none !important;
  border-radius: 12px !important;
  width: 48px !important;
  height: 48px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  z-index: 1 !important;
}

.podcast-popup-close:hover {
  background: rgba(28, 28, 28, 0.15) !important;
  transform: scale(1.05) !important;
}

.podcast-popup-close::before,
.podcast-popup-close::after {
  content: '' !important;
  position: absolute !important;
  width: 18px !important;
  height: 2px !important;
  background: var(--ppp-text-dark) !important;
  border-radius: 1px !important;
}

.podcast-popup-close::before {
  transform: rotate(45deg) !important;
}

.podcast-popup-close::after {
  transform: rotate(-45deg) !important;
}

/* Body */
.podcast-popup-body {
  padding: 40px !important;
  flex: 1 !important;
  overflow-y: auto !important;
}

/* Podcast Grid */
.podcast-grid {
  display: grid !important;
  gap: 24px !important;
  grid-template-columns: 1fr !important;
}

/* Podcast Item - No animations for instant display */
.podcast-item {
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
  padding: 24px !important;
  border: 2px solid transparent !important;
  border-radius: 20px !important;
  background: linear-gradient(var(--ppp-white), var(--ppp-white)) padding-box,
              linear-gradient(135deg, var(--ppp-primary-light), var(--ppp-primary-color)) border-box !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  opacity: 1 !important; /* Always visible */
  transform: translateY(0) !important; /* No offset */
}

/* Remove all animation delays for instant display */
.podcast-item:nth-child(1),
.podcast-item:nth-child(2),
.podcast-item:nth-child(3),
.podcast-item:nth-child(4),
.podcast-item:nth-child(5) { 
  animation-delay: 0s !important; 
  animation: none !important;
}

.podcast-item::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(191, 159, 120, 0.1), transparent) !important;
  transition: left 0.6s ease !important;
}

.podcast-item:hover::before {
  left: 100% !important;
}

.podcast-item:hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 20px 40px var(--ppp-shadow-medium) !important;
  border-color: var(--ppp-primary-color) !important;
}

/* Podcast Logo */
.podcast-logo {
  flex-shrink: 0 !important;
  position: relative !important;
}

.podcast-logo img {
  width: 80px !important;
  height: 80px !important;
  border-radius: 16px !important;
  object-fit: cover !important;
  transition: all 0.4s ease !important;
  box-shadow: 0 8px 20px var(--ppp-shadow-light) !important;
}

.podcast-item:hover .podcast-logo img {
  transform: scale(1.1) rotate(2deg) !important;
  box-shadow: 0 12px 30px var(--ppp-shadow-medium) !important;
}

.podcast-logo-placeholder {
  width: 80px !important;
  height: 80px !important;
  border-radius: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--ppp-primary-gradient) !important;
}

/* Platform Badge */
.podcast-platform-badge {
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: var(--ppp-primary-gradient) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  color: var(--ppp-text-dark) !important;
  font-weight: bold !important;
  box-shadow: 0 4px 8px var(--ppp-shadow-light) !important;
}

/* Podcast Info */
.podcast-info {
  flex: 1 !important;
  min-width: 0 !important;
}

.podcast-title {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: var(--ppp-text-dark) !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.3 !important;
}

.podcast-description {
  font-size: 1rem !important;
  color: var(--ppp-text-light) !important;
  margin: 0 0 20px 0 !important;
  line-height: 1.6 !important;
}

/* Listen Button */
.podcast-listen-btn {
  background: var(--ppp-primary-gradient) !important;
  color: var(--ppp-text-dark) !important;
  border: none !important;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  position: relative !important;
  overflow: hidden !important;
}

.podcast-listen-btn::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
  transition: left 0.5s ease !important;
}

.podcast-listen-btn:hover::before {
  left: 100% !important;
}

.podcast-listen-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(191, 159, 120, 0.3) !important;
  background: linear-gradient(20deg, #bf9f78, #e0cc99 50%, #d6c7a9 100%) !important;
  color: var(--ppp-text-dark) !important;
  text-decoration: none !important;
}

.podcast-listen-btn:active {
  transform: translateY(0) !important;
}

/* Play Icon */
.podcast-play-icon {
  width: 0 !important;
  height: 0 !important;
  border-left: 10px solid currentColor !important;
  border-top: 6px solid transparent !important;
  border-bottom: 6px solid transparent !important;
  margin-left: 2px !important;
}

/* Animations */
@keyframes pppFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pppSlideInUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pppZoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pppSpin {
  to {
    transform: rotate(360deg);
  }
}

.podcast-popup-modal.animation-fade .podcast-popup-content {
  animation: pppFadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.podcast-popup-modal.animation-slide .podcast-popup-content {
  animation: pppSlideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.podcast-popup-modal.animation-zoom .podcast-popup-content {
  animation: pppZoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

/* Staggered Animation for Podcast Items */
.podcast-item:nth-child(1) { animation-delay: 0.1s !important; }
.podcast-item:nth-child(2) { animation-delay: 0.2s !important; }
.podcast-item:nth-child(3) { animation-delay: 0.3s !important; }
.podcast-item:nth-child(4) { animation-delay: 0.4s !important; }
.podcast-item:nth-child(5) { animation-delay: 0.5s !important; }

/* Empty State */
.podcast-empty-state {
  text-align: center !important;
  padding: 60px 40px !important;
  color: var(--ppp-text-light) !important;
}

.podcast-empty-icon {
  margin-bottom: 24px !important;
  opacity: 0.7 !important;
}

.podcast-empty-state h3 {
  font-size: 1.5rem !important;
  color: var(--ppp-text-dark) !important;
  margin-bottom: 16px !important;
  font-weight: 600 !important;
}

.podcast-empty-state p {
  font-size: 1.1rem !important;
  margin-bottom: 32px !important;
  line-height: 1.6 !important;
}

/* Loading State */
.podcast-item.loading {
  opacity: 0.6 !important;
  pointer-events: none !important;
}

.podcast-item.loading::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(255, 255, 255, 0.8) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 20px !important;
}

.podcast-item.loading::before {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 24px !important;
  height: 24px !important;
  margin: -12px 0 0 -12px !important;
  border: 2px solid var(--ppp-primary-color) !important;
  border-radius: 50% !important;
  border-top-color: transparent !important;
  animation: pppSpin 1s linear infinite !important;
  z-index: 1 !important;
}

/* Responsive Design */
@media (min-width: 768px) {
  .podcast-grid {
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)) !important;
  }
  
  .podcast-popup-content {
    margin: 5vh auto !important;
  }
}

@media (max-width: 767px) {
  .podcast-popup-modal {
    padding: 10px !important;
  }
  
  .podcast-popup-content {
    border-radius: 20px !important;
    max-height: 95vh !important;
  }
  
  .podcast-popup-header {
    padding: 24px 24px !important;
  }
  
  .podcast-popup-title {
    font-size: 1.75rem !important;
  }
  
  .podcast-popup-body {
    padding: 24px !important;
  }
  
  .podcast-item {
    flex-direction: column !important;
    text-align: center !important;
    gap: 20px !important;
  }
  
  .podcast-logo img, .podcast-logo-placeholder {
    width: 100px !important;
    height: 100px !important;
  }
  
  .podcast-title {
    font-size: 1.25rem !important;
  }
  
  .podcast-description {
    font-size: 0.95rem !important;
  }
}

@media (max-width: 480px) {
  .podcast-popup-modal.mobile-fullscreen {
    padding: 0 !important;
  }
  
  .podcast-popup-modal.mobile-fullscreen .podcast-popup-content {
    border-radius: 0 !important;
    height: 100vh !important;
    max-height: none !important;
  }
  
  .podcast-popup-header {
    padding: 20px !important;
  }
  
  .podcast-popup-title {
    font-size: 1.5rem !important;
  }
  
  .podcast-popup-body {
    padding: 20px !important;
  }
}

/* Custom Scrollbar */
.podcast-popup-body::-webkit-scrollbar {
  width: 8px !important;
}

.podcast-popup-body::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-radius: 4px !important;
}

.podcast-popup-body::-webkit-scrollbar-thumb {
  background: var(--ppp-primary-color) !important;
  border-radius: 4px !important;
}

.podcast-popup-body::-webkit-scrollbar-thumb:hover {
  background: var(--ppp-primary-darker) !important;
}

/* Body scroll lock */
body.ppp-modal-open {
  overflow: hidden !important;
  height: 100% !important;
}

/* Focus Management */
.podcast-popup-modal [tabindex="-1"]:focus {
  outline: none !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .podcast-item {
    border: 2px solid var(--ppp-text-dark) !important;
  }
  
  .podcast-listen-btn {
    border: 2px solid var(--ppp-text-dark) !important;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .podcast-popup-modal {
    display: none !important;
  }
}