/**
 * Widgets Styles - Discord, Recent Payments, Top Donator, etc.
 */

/* =========================
   DISCORD WIDGET
   ========================= */

.discord-widget .discord-iframe-container {
  margin: var(--spacing-lg) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-lighter);
}

.discord-widget .discord-join-btn {
  width: 100%;
  justify-content: center;
}

/* =========================
   RECENT PAYMENTS WIDGET
   ========================= */

.payments-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.payment-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.payment-item:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateX(4px);
}

.payment-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(0, 212, 255, 0.3);
}

.payment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-xl);
}

.payment-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.payment-username {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--font-size-base);
}

.payment-package {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.payment-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-darker);
}

.payment-amount {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* =========================
   TOP DONATOR WIDGET
   ========================= */

.top-donator-widget {
  background:
    linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, transparent 100%),
    var(--color-bg-card);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: var(--shadow-glow);
}

.top-donator-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
  text-align: center;
  padding: var(--spacing-lg) 0;
}

.donator-avatar {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: visible;
  animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
  }
}

.donator-avatar img,
.donator-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--color-primary);
}

.avatar-placeholder.large {
  font-size: var(--font-size-4xl);
}

.donator-crown {
  position: absolute;
  top: -12px;
  right: -8px;
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
  animation: rotate 10s linear infinite;
}

.donator-crown svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.donator-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.donator-username {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
}

.donator-amount {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.donator-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* =========================
   GOAL WIDGET
   ========================= */

.goal-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goal-label {
  font-weight: 600;
  color: var(--color-text);
}

.goal-percentage {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: var(--color-primary);
}

.goal-progress {
  position: relative;
  width: 100%;
  height: 12px;
  background: var(--color-bg-lighter);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.goal-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 1s ease-out;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.goal-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.goal-amounts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-sm);
}

.goal-current {
  font-weight: 700;
  color: var(--color-primary);
}

.goal-target {
  color: var(--color-text-secondary);
}

.goal-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* =========================
   FEATURED PACKAGE WIDGET
   ========================= */

.featured-package {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-base);
}

.featured-package:hover {
  transform: scale(1.02);
}

.featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-lighter);
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.featured-package:hover .featured-image img {
  transform: scale(1.1);
}

.featured-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.featured-name {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.featured-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.featured-price {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* =========================
   SIDEBAR LAYOUT
   ========================= */

.page-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-2xl);
}

@media (width >= 960px) {
  .page-with-sidebar {
    grid-template-columns: 1fr 320px;
  }
}

.sidebar-widgets {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

/* Widget animations on load */
.widget {
  animation: fadeInWidget 0.6s ease-out;
}

.widget:nth-child(1) { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.widget:nth-child(2) { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.widget:nth-child(3) { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; }
.widget:nth-child(4) { animation-delay: 0.4s; opacity: 0; animation-fill-mode: forwards; }

@keyframes fadeInWidget {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
