/**
 * OGAH Radio Community Theme Styles
 * Dark, modern design system for community pages
 * Extends university theme with community-specific styles
 */

/* Define CSS variables for community pages */
:root {
  --dju-bg: #050509 !important;
  --dju-bg-alt: #0d0d14 !important;
  --dju-accent: #ff2f6d !important;
  --dju-accent-soft: rgba(255, 47, 109, 0.1) !important;
  --dju-accent-2: #3ae8ff !important;
  --dju-text-main: #f7f7ff !important;
  --dju-text-muted: #a0a0c0 !important;
  --dju-border-subtle: rgba(255, 255, 255, 0.08) !important;
  --dju-danger: #ff4f4f !important;
  --dju-warning: #ffc857 !important;
  --dju-radius-lg: 18px !important;
  --dju-radius-pill: 999px !important;
  --dju-shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.7) !important;
  --dju-shadow-glow: 0 0 20px rgba(255, 47, 109, 0.5) !important;
}

/* Community Background - same as university */
.community-bg {
  background: radial-gradient(circle at top, #151527 0, #050509 50%, #000 100%) !important;
  min-height: 100vh !important;
  color: var(--dju-text-main) !important;
}

/* Community Card Style - same as university */
.community-card {
  background: linear-gradient(145deg, rgba(13, 13, 20, 0.98), rgba(7, 7, 12, 0.98));
  border-radius: 32px;
  padding: 32px 26px;
  box-shadow: var(--dju-shadow-soft);
  border: 1px solid var(--dju-border-subtle);
  backdrop-filter: blur(16px);
}

@media (min-width: 768px) {
  .community-card {
    padding: 40px;
  }
}

/* Apply purple glow to community content containers */
.community-bg .max-w-7xl.mx-auto,
.community-bg .max-w-6xl.mx-auto,
.community-bg .max-w-4xl.mx-auto {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5), 0 0 40px rgba(139, 92, 246, 0.3);
  border-radius: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
}

/* Enhanced glow for community cards */
.community-card {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5), 0 0 40px rgba(139, 92, 246, 0.3), var(--dju-shadow-soft);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Community Section - reuse university section styles */
.community-section {
  background: linear-gradient(145deg, rgba(13, 13, 20, 0.6), rgba(7, 7, 12, 0.6));
  border-radius: var(--dju-radius-lg);
  padding: 20px;
  border: 1px solid var(--dju-border-subtle);
  backdrop-filter: blur(8px);
}

.community-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.community-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--dju-text-main);
}

.community-section-tag {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--dju-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--dju-text-muted);
  font-weight: 600;
}

/* Community Label - reuse university label */
.community-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--dju-text-muted);
  margin-bottom: 20px;
}

.community-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dju-accent);
  box-shadow: 0 0 12px rgba(255, 47, 109, 0.9);
}

/* Community Hero - reuse university hero */
.community-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

@media (min-width: 900px) {
  .community-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }
}

.community-hero-text {
  flex: 2;
}

.community-hero-title {
  font-size: clamp(2.2rem, 3.2vw + 1rem, 3.2rem);
  line-height: 1.1;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  color: var(--dju-text-main);
}

.community-hero-title .highlight {
  color: var(--dju-accent);
  text-shadow: var(--dju-shadow-glow);
}

.community-hero-title span.highlight {
  color: var(--dju-accent);
  text-shadow: var(--dju-shadow-glow);
}

.community-hero-subtitle {
  color: var(--dju-text-muted);
  font-size: 0.98rem;
  max-width: 550px;
}

.community-hero-subtitle strong {
  color: var(--dju-accent-2);
  font-weight: 600;
}

/* Community Badge Row */
.community-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.community-badge {
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: var(--dju-radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--dju-text-muted);
  font-weight: 600;
}

.community-badge.accent {
  background: var(--dju-accent-soft);
  border-color: rgba(255, 47, 109, 0.3);
  color: var(--dju-accent);
}

/* Community Content Grid */
.community-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 24px;
}

@media (min-width: 900px) {
  .community-content-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 26px;
  }
}

/* Community Text Colors - reuse university text colors */
.community-text-main {
  color: var(--dju-text-main) !important;
}

.community-text-muted {
  color: var(--dju-text-muted);
}

.community-text-accent {
  color: var(--dju-accent) !important;
}

.community-text-accent-2 {
  color: var(--dju-accent-2) !important;
}

/* Force role colors on chat usernames - override any Tailwind defaults */
.chat-username-color {
  color: var(--username-color, #c0c0c0) !important;
}

/* Community Genre Tags */
.community-genre-tag {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: var(--dju-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 5, 9, 0.92);
  color: var(--dju-text-muted);
}

.community-genre-tag.hot {
  border-color: rgba(255, 47, 109, 0.7);
  color: #ffffff;
  background: var(--dju-accent-soft);
}

/* Community Footer Note */
.community-footer-note {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--dju-text-muted);
  text-align: center;
}

.community-footer-note strong {
  color: var(--dju-accent-2);
  font-weight: 600;
}

/* =====================================================
   AVATAR FLAME EFFECT - "Hot" Caddy Cafe Interaction
   ===================================================== */

/* Container for flame elements */
.avatar-flame-container {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  overflow: visible;
}

/* Individual flame element */
.avatar-flame {
  position: absolute;
  bottom: -2px;
  width: 12px;
  height: 24px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(to top, #ff6b35 0%, #ff9a3c 30%, #ffd93d 60%, transparent 100%);
  transform-origin: bottom center;
  animation: flame-flicker 0.8s ease-in-out infinite alternate;
  filter: blur(1px);
  opacity: 0.9;
}

/* Position each flame around the avatar */
.avatar-flame.flame-1 {
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 0s;
  height: 20px;
  width: 10px;
}

.avatar-flame.flame-2 {
  left: 25%;
  transform: translateX(-50%) rotate(-15deg);
  animation-delay: 0.1s;
  height: 16px;
  width: 8px;
}

.avatar-flame.flame-3 {
  left: 75%;
  transform: translateX(-50%) rotate(15deg);
  animation-delay: 0.2s;
  height: 16px;
  width: 8px;
}

.avatar-flame.flame-4 {
  left: 10%;
  transform: translateX(-50%) rotate(-25deg);
  animation-delay: 0.15s;
  height: 12px;
  width: 6px;
}

.avatar-flame.flame-5 {
  left: 90%;
  transform: translateX(-50%) rotate(25deg);
  animation-delay: 0.25s;
  height: 12px;
  width: 6px;
}

/* Flame flicker animation */
@keyframes flame-flicker {
  0% {
    height: 16px;
    opacity: 0.8;
    filter: blur(1px);
  }
  25% {
    height: 22px;
    opacity: 1;
    filter: blur(0.5px);
  }
  50% {
    height: 18px;
    opacity: 0.9;
    filter: blur(1.5px);
  }
  75% {
    height: 24px;
    opacity: 1;
    filter: blur(0.5px);
  }
  100% {
    height: 20px;
    opacity: 0.85;
    filter: blur(1px);
  }
}

/* Avatar on fire - adds glow effect */
.avatar-on-fire {
  box-shadow:
    0 0 10px rgba(255, 107, 53, 0.6),
    0 0 20px rgba(255, 107, 53, 0.4),
    0 0 30px rgba(255, 154, 60, 0.3);
  animation: fire-glow 1.5s ease-in-out infinite alternate;
}

@keyframes fire-glow {
  0% {
    box-shadow:
      0 0 8px rgba(255, 107, 53, 0.5),
      0 0 16px rgba(255, 107, 53, 0.3),
      0 0 24px rgba(255, 154, 60, 0.2);
  }
  100% {
    box-shadow:
      0 0 12px rgba(255, 107, 53, 0.7),
      0 0 24px rgba(255, 107, 53, 0.5),
      0 0 36px rgba(255, 154, 60, 0.4);
  }
}

/* =====================================================
   CAMS OFFLINE MESSAGE - Fire Text Effect
   ===================================================== */

.cams-offline-message {
  position: relative;
  padding: 20px;
}

/* Fire text effect - animated gradient text */
.fire-text {
  background: linear-gradient(
    180deg,
    #fff5cc 0%,
    #ffd700 15%,
    #ff9500 35%,
    #ff6b35 55%,
    #ff4500 75%,
    #dc143c 100%
  );
  background-size: 100% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fire-text-flicker 2s ease-in-out infinite;
  text-shadow: none;
  filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.6))
          drop-shadow(0 0 16px rgba(255, 69, 0, 0.4))
          drop-shadow(0 0 24px rgba(220, 20, 60, 0.3));
}

@keyframes fire-text-flicker {
  0%, 100% {
    background-position: 0% 0%;
    filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.6))
            drop-shadow(0 0 16px rgba(255, 69, 0, 0.4))
            drop-shadow(0 0 24px rgba(220, 20, 60, 0.3));
  }
  25% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 12px rgba(255, 107, 53, 0.8))
            drop-shadow(0 0 20px rgba(255, 69, 0, 0.5))
            drop-shadow(0 0 30px rgba(220, 20, 60, 0.4));
  }
  50% {
    background-position: 0% 100%;
    filter: drop-shadow(0 0 6px rgba(255, 107, 53, 0.5))
            drop-shadow(0 0 14px rgba(255, 69, 0, 0.35))
            drop-shadow(0 0 20px rgba(220, 20, 60, 0.25));
  }
  75% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.7))
            drop-shadow(0 0 18px rgba(255, 69, 0, 0.45))
            drop-shadow(0 0 28px rgba(220, 20, 60, 0.35));
  }
}

/* Add subtle flame particles around the offline message */
.cams-offline-message::before,
.cams-offline-message::after {
  content: '🔥';
  position: absolute;
  font-size: 1.5rem;
  animation: flame-float 3s ease-in-out infinite;
  opacity: 0.8;
}

.cams-offline-message::before {
  top: 0;
  left: 10px;
  animation-delay: 0s;
}

.cams-offline-message::after {
  top: 0;
  right: 10px;
  animation-delay: 1.5s;
}

@keyframes flame-float {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-10px) scale(1.1);
    opacity: 1;
  }
}

/* Horizontal flame movement for DJ TUNE! stats */
@keyframes flameMove {
  0%, 100% {
    transform: translateX(-30%);
    opacity: 0.8;
  }
  50% {
    transform: translateX(30%);
    opacity: 1;
  }
}

/* Flame glow animation for top song */
@keyframes flameGlow {
  0%, 100% {
    background-position: 0% 50%;
    opacity: 0.6;
  }
  50% {
    background-position: 100% 50%;
    opacity: 0.9;
  }
}

/* Flame flicker for individual flames */
@keyframes flameFlicker {
  0% {
    transform: scaleY(1) scaleX(1);
    opacity: 0.7;
  }
  25% {
    transform: scaleY(1.2) scaleX(0.9);
    opacity: 0.9;
  }
  50% {
    transform: scaleY(0.9) scaleX(1.1);
    opacity: 0.8;
  }
  75% {
    transform: scaleY(1.15) scaleX(0.95);
    opacity: 1;
  }
  100% {
    transform: scaleY(1.05) scaleX(1.05);
    opacity: 0.75;
  }
}

/* Fire emoji bounce animation */
@keyframes fireEmoji {
  0%, 100% {
    transform: translateY(-50%) scale(1);
    opacity: 0.9;
  }
  25% {
    transform: translateY(-55%) scale(1.1);
    opacity: 1;
  }
  50% {
    transform: translateY(-45%) scale(0.95);
    opacity: 0.85;
  }
  75% {
    transform: translateY(-52%) scale(1.05);
    opacity: 1;
  }
}

/* =====================================================
   DJ TUNE! STATS - Orange Themed Scrollbar
   ===================================================== */

.tune-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.tune-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 107, 53, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.tune-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff6b35 0%, #ff4500 50%, #dc2626 100%);
  border-radius: 4px;
  border: 1px solid rgba(255, 165, 0, 0.3);
  box-shadow: 0 0 6px rgba(255, 107, 53, 0.4);
}

.tune-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff8c5a 0%, #ff6b35 50%, #ff4500 100%);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.6);
}

/* Firefox scrollbar */
.tune-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #ff6b35 rgba(255, 107, 53, 0.1);
}

/* =====================================================
   BACKSTAGE PASS AVATAR BACKDROP
   Premium feature for backstage pass holders
   ===================================================== */

/* Container for the entire backdrop + children */
.avatar-backdrop-container {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

/* Backdrop image container - maintains 820:1200 aspect ratio */
.avatar-backdrop {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Aspect ratio: 820x1200 = 0.683 (width/height) */
  aspect-ratio: 820 / 1200;
  border-radius: 12px;
  overflow: visible;
}

/* Size variants for backdrop container */
.avatar-backdrop--sm {
  width: 75px;
}

.avatar-backdrop--md {
  width: 125px;
}

.avatar-backdrop--lg {
  width: 150px;
}

/* Avatar positioned at 50% x, 45% y within backdrop */
.avatar-backdrop__avatar {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  /* Diameter is 64% of backdrop width */
  width: 64%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
}

/* Name positioned at 50% x, 81% y */
.avatar-backdrop__name {
  position: absolute;
  left: 50%;
  top: 81%;
  transform: translateX(-50%);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85%;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.7);
  z-index: 2;
  letter-spacing: 0.02em;
}

/* Purple glow effect for backstage pass holders */
.avatar-backdrop--active {
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5))
          drop-shadow(0 0 16px rgba(139, 92, 246, 0.3));
  animation: backstage-glow 3s ease-in-out infinite;
}

@keyframes backstage-glow {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.4))
            drop-shadow(0 0 12px rgba(139, 92, 246, 0.25));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.6))
            drop-shadow(0 0 24px rgba(139, 92, 246, 0.4));
  }
}

/* Hover effect for clickable backdrops */
.avatar-backdrop-container:hover .avatar-backdrop--active {
  filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.7))
          drop-shadow(0 0 30px rgba(139, 92, 246, 0.5));
}

/* Flame container positioning for backdrop mode */
.avatar-backdrop .avatar-flame-container {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: 64%;
  aspect-ratio: 1;
  border-radius: 50%;
  z-index: 1;
}

