/* RAIDBASE Enhancements Styles */

/* ============ Star Rating ============ */
.star-rating {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.02);
  border-radius: 999px;
}

.star-rating .star {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0.25rem;
}

.star-rating .star:hover {
  color: #F59E0B;
  transform: scale(1.15);
}

.star-rating .star:active {
  transform: scale(0.95);
}

/* Filled stars */
.star-rating .star:has-text("★") {
  color: #F59E0B;
}

/* ============ Population Chart ============ */
.population-chart-container {
  background: linear-gradient(135deg, #0F131C 0%, #161D2B 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 2rem 0;
}

.population-chart-container h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.population-chart {
  width: 100%;
  height: 150px;
  display: block;
}

/* ============ Social Links ============ */
.clan-social-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(480px, 100%);
  margin: 0;
}

.social-link {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  gap: 13px;
  padding: 9px 14px 9px 9px;
  border: 1px solid #33383d;
  border-radius: 2px;
  background: linear-gradient(105deg, #17191b, #0d0f10);
  color: #f7f5f2;
  text-decoration: none;
  box-shadow: inset 3px 0 var(--social-accent, #ff5a18);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.social-link:hover,
.social-link:focus-visible {
  background: linear-gradient(105deg, #202326, #111315);
  border-color: var(--social-accent, #ff5a18);
  transform: translateX(4px);
  outline: none;
}

.social-link img {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 2px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.26));
  transition: transform 160ms ease;
}

.social-link > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.social-link small {
  color: #7f858b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
}

.social-link b {
  color: #f7f5f2;
  font: 700 23px/1 Oswald, sans-serif;
  text-transform: uppercase;
}

.social-link strong {
  margin-left: auto;
  color: var(--social-accent, #ff5a18);
  font-size: 22px;
  line-height: 1;
}

.social-link[data-network="youtube"] { --social-accent: #ff3b30; }
.social-link[data-network="twitch"] { --social-accent: #9146ff; }
.social-link[data-network="discord"] { --social-accent: #5865f2; }

.social-link:hover img,
.social-link:focus-visible img {
  transform: scale(1.06);
}

/* Social dialog */
.social-dialog {
  background: #0F131C;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 0;
  max-width: 32rem;
  width: 90vw;
}

.social-dialog::backdrop {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.social-dialog form {
  padding: 2rem;
}

.social-dialog h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
}

.social-dialog label {
  display: block;
  margin-bottom: 1.25rem;
}

.social-dialog label span {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
}

.social-dialog input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.social-dialog input:focus {
  outline: none;
  border-color: #38BDF8;
  background: rgba(255,255,255,0.05);
}

.dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* ============ Server Comments ============ */
.server-comments {
  background: rgba(255,255,255,0.02);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-top: 2rem;
}

.server-comments h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.comment-item {
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
}

.comment-item:last-child {
  margin-bottom: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.comment-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

.comment-author {
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  font-size: 0.9375rem;
}

.comment-time {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
  margin-left: auto;
}

.comment-body {
  color: rgba(255,255,255,0.7);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.comment-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.comment-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.comment-form input:focus {
  outline: none;
  border-color: #38BDF8;
  background: rgba(255,255,255,0.05);
}

.comment-form button {
  padding: 0.75rem 1.5rem;
  background: #38BDF8;
  border: none;
  border-radius: 0.5rem;
  color: #0A0D12;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-form button:hover {
  background: #0EA5E9;
  transform: translateY(-1px);
}

.comment-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============ Server Rating Display ============ */
.server-rating-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.rating-stars-display {
  font-size: 1.5rem;
  color: #F59E0B;
  letter-spacing: 0.125rem;
}

.rating-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rating-average {
  font-size: 1.125rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.rating-count {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
}

/* ============ Typewriter Effect ============ */
@keyframes blink {
  0%, 49% { border-right-color: rgba(255,255,255,0.7); }
  50%, 100% { border-right-color: transparent; }
}

.typewriter {
  border-right: 2px solid rgba(255,255,255,0.7);
  animation: blink 1s step-end infinite;
  display: inline-block;
}

/* ============ Loading States ============ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.03) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ Improved Transitions ============ */
.page-transition-enter {
  opacity: 0;
  transform: translateY(10px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease-out;
}

/* ============ Responsive Improvements ============ */
@media (max-width: 768px) {
  .clan-social-links {
    gap: 7px;
    width: 100%;
  }

  .social-link {
    min-height: 58px;
    padding: 7px 11px 7px 7px;
  }

  .star-rating .star {
    font-size: 1.5rem;
  }
  
  .social-dialog form {
    padding: 1.5rem;
  }
  
  .population-chart {
    height: 120px;
  }
  
  .comment-form {
    flex-direction: column;
  }
  
  .comment-form button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-link,
  .social-link img {
    transition: none;
  }
}
