:root {
  --primary-color: #6071c4;
  --secondary-color: #00a9dc;
  --gradient-primary: linear-gradient(135deg, #6071c4 0%, #1f8eb0 100%);
  --gradient-card: linear-gradient(145deg, #1a234d, #141b3d);
  --dark-bg: #0a0e27;
  --darker-bg: #060920;
  --card-bg: #141b3d;
  --text-primary: #ffffff;
  --text-secondary: #b8c5d6;
  --border-color: rgba(223, 134, 40, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.4);
  
  /* Dynamic Theme Color - Defaults to Primary Orange */
  --active-theme-color: #6071c4;
  
  /* Brand Colors for Title */
  --brand-primary: #6071c4;
  --brand-secondary: #00a9dc;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

/* Background Effects */
.hero-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 0%, rgba(223, 134, 40, 0.1) 0%, transparent 60%),
              radial-gradient(circle at 85% 90%, rgba(252, 238, 96, 0.05) 0%, transparent 40%);
  z-index: -2;
  transition: opacity 0.5s ease;
}

/* Dynamic Colored Overlay */
.hero-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 30%, var(--active-theme-color) 0%, transparent 70%);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s ease, background 0.5s ease;
  pointer-events: none;
  mix-blend-mode: screen;
}

body.card-hover-active .hero-overlay {
  opacity: 0.15;
}

body.card-hover-active .hero-background {
  opacity: 0.3;
}

.container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 20px;
  z-index: 1;
}

/* Header */
.main-header {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInDown 1s ease-out;
}

.main-title {
  font-size: 3rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 10px 30px rgb(40 206 223 / 30%);
}

/* Glitch Effect */
.glitch-text {
  position: relative;
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(45deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 var(--brand-primary);
  animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: 2px 0 var(--brand-secondary);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0%,
  100% {
    clip-path: inset(50% 0 30% 0);
  }
  20% {
    clip-path: inset(33% 0 66% 0);
  }
  40% {
    clip-path: inset(10% 0 90% 0);
  }
  60% {
    clip-path: inset(80% 0 20% 0);
  }
  80% {
    clip-path: inset(15% 0 85% 0);
  }
}

@keyframes glitch-anim-2 {
  0%,
  100% {
    clip-path: inset(80% 0 20% 0);
  }
  20% {
    clip-path: inset(15% 0 85% 0);
  }
  40% {
    clip-path: inset(50% 0 30% 0);
  }
  60% {
    clip-path: inset(33% 0 66% 0);
  }
  80% {
    clip-path: inset(10% 0 90% 0);
  }
}

.subtitle {
  font-size: 1.3rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Grid Layout */
.plugins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  justify-content: center;
  padding: 10px;
}

/* Card Styles */
.plugin-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px var(--shadow-color);
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

.plugin-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.4s ease;
  pointer-events: none;
}

.plugin-card:hover {
  transform: translateY(-8px);
  /* Use the variable directly here. Since the variable is set on :root/html by JS on hover, 
     we can just use it. Note: hover state needs to trigger JS first. 
     Using CSS variable that updates on body makes this work. */
  border-color: var(--active-theme-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0,0,0,0.1);
}

.plugin-card:hover::after {
  box-shadow: 0 0 0 2px var(--active-theme-color);
  opacity: 0.5;
}

/* Card Image Section */
.card-image {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: #000;
  text-align: center;
}

.card-image img {
  width: 72%;
  height: auto;
  object-fit: cover;
  transition: transform 0.6s ease;
  opacity: 0.9;
  margin: 0 auto;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(20, 27, 61, 0.9) 100%);
  opacity: 0.8;
  transition: opacity 0.4s ease;
}

.plugin-card:hover .card-image img {
  transform: scale(1.08);
  opacity: 1;
}

.plugin-card:hover .card-overlay {
  opacity: 0.6;
}

/* Card Content Section */
.card-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background: linear-gradient(180deg, rgba(20, 27, 61, 0) 0%, rgba(20, 27, 61, 1) 100%);
}

.plugin-card h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 700;
  transition: color 0.3s ease;
}

.plugin-card:hover h2 {
  color: var(--active-theme-color);
}

.plugin-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.5;
  flex-grow: 1;
}

/* Footer & Button */
.card-footer {
  margin-top: auto;
}

.btn-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.plugin-card:hover .btn-explore {
  background: var(--active-theme-color);
  color: #000; /* Contrast text for bright colors */
  border-color: transparent;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Special case for dark colors if needed, but the provided colors are bright */

.btn-explore i {
  transition: transform 0.3s ease;
}

.plugin-card:hover .btn-explore i {
  transform: translateX(5px);
}

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

/* Responsive */
@media (max-width: 768px) {
  .main-title {
    font-size: 2.8rem;
  }
  
  .container {
    padding: 30px 20px;
  }
  
  .card-image {
    height: 180px;
  }
}
