/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Modern Design System */
:root {
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --secondary-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-light: 0 8px 32px rgba(99, 102, 241, 0.15);
  --shadow-medium: 0 16px 64px rgba(99, 102, 241, 0.2);
  --shadow-heavy: 0 24px 96px rgba(99, 102, 241, 0.25);
}

/* Ensure proper scrolling */
html, body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Glass Morphism Effects */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-light);
}

/* Modern Gradient Backgrounds */
.gradient-primary {
  background: var(--primary-gradient);
}

.gradient-secondary {
  background: var(--secondary-gradient);
}

.gradient-accent {
  background: var(--accent-gradient);
}

/* Enhanced Typography */
.title-hero {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.subtitle-hero {
  color: #cbd5e1;
  font-weight: 400;
  line-height: 1.6;
}

/* Modern Cards */
.modern-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}

.modern-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 64px rgba(99, 102, 241, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Messages Card - Same styling as modern-card but without hover animations */
.messages-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

/* Animated Gradient Background */
.hero-background {
  background: 
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  background-attachment: fixed;
  position: relative;
  min-height: 100vh;
}

.hero-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(45deg, transparent 30%, rgba(99, 102, 241, 0.05) 50%, transparent 70%),
    linear-gradient(-45deg, transparent 30%, rgba(139, 92, 246, 0.05) 50%, transparent 70%);
  animation: shimmer 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Photo loading shimmer animation */
@keyframes shimmer-loading {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    rgba(51, 65, 85, 0.4) 0%,
    rgba(71, 85, 105, 0.6) 50%,
    rgba(51, 65, 85, 0.4) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer-loading 2s infinite;
}

/* Header with Glass Effect */
.header-glass {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Modern Buttons */
.btn-modern {
  background: var(--primary-gradient);
  border: none;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden !important;
  isolation: isolate;
  z-index: 0;
}

.btn-modern > * {
  position: relative;
  z-index: 2;
}

.btn-modern::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: none;
  z-index: 1;
  border-radius: inherit;
  transform: translateX(-100%);
  pointer-events: none;
  opacity: 0;
}

.btn-modern:hover::before {
  transition: transform 0.5s, opacity 0.1s linear;
  transform: translateX(100%);
  opacity: 1;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

/* Enhanced Flash Messages */
.flash-modern {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(59, 130, 246, 0.9) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.flash-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

/* How It Works Section */
.feature-icon {
  background: var(--primary-gradient);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-icon:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 48px rgba(99, 102, 241, 0.4);
}

/* Game Categories */
.category-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.1) 0%, rgba(30, 41, 59, 0.8) 100%);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(99, 102, 241, 0.2);
}

/* Footer Enhancements */
.footer-glass {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(99, 102, 241, 0.2);
}

/* Dropdown Enhancements */
.dropdown-glass {
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.4);
}

/* Scroll Animations */
.js .fade-in,
.js .slide-up {
  opacity: 0;
}

.js .fade-in.is-revealed {
  animation: fadeIn 0.8s ease-out forwards;
}

.js .slide-up.is-revealed {
  animation: slideUp 0.8s ease-out forwards;
}

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

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

/* Photo Grid Entrance Animation */
@keyframes photoEnter {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.photo-enter {
  animation: photoEnter 0.3s ease-out forwards;
}

/* Upload Progress Bar - Fixed to top of viewport */
.upload-progress-bar {
  /* Hidden by default - slides down off-screen (bottom position) */
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.upload-progress-bar.upload-progress-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .hero-background::before {
    animation-duration: 6s;
  }
  
  .modern-card:hover {
    transform: translateY(-4px);
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  .modern-card,
  .btn-modern,
  .btn-secondary,
  .feature-icon,
  .category-card {
    transition: none;
  }
  
  .hero-background::before {
    animation: none;
  }
  
  .fade-in,
  .slide-up,
  .photo-enter {
    animation: none;
  }
  
  .upload-progress-bar {
    transition: none;
  }
  
  .upload-progress-bar:not(.upload-progress-visible) {
    transform: translateY(100%);
    opacity: 0;
  }
  
  .upload-progress-bar.upload-progress-visible {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Focus Styles */
.btn-modern:focus,
.btn-secondary:focus {
  outline: 2px solid rgba(99, 102, 241, 0.6);
  outline-offset: 2px;
}

/* Avatar Styles */
.user-avatar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-avatar img {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: cover;
}

.user-avatar img:hover {
  border-color: rgba(99, 102, 241, 0.6) !important;
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

/* Gravatar fallback transition */
.user-avatar .fallback-avatar {
  transition: all 0.3s ease;
}

/* Profile Avatar Enhancement */
.profile-avatar-large {
  filter: drop-shadow(0 8px 24px rgba(99, 102, 241, 0.3));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar-large:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 12px 32px rgba(99, 102, 241, 0.4));
}

/* Original star rating styles */
[data-controller="star-rating"] button {
  transition: transform 0.1s ease;
}

[data-controller="star-rating"] button:hover {
  transform: scale(1.15);
}

[data-controller="star-rating"] button:active {
  transform: scale(0.95);
}

[data-star-rating-target="levelText"] {
  transition: color 0.2s ease, transform 0.2s ease;
}

[data-star-rating-target="levelText"].animate {
  animation: pulse 0.4s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Markdown Content Styles */
.prose-invert {
  color: #e2e8f0;
}

.prose-invert h1,
.prose-invert h2,
.prose-invert h3,
.prose-invert h4,
.prose-invert h5,
.prose-invert h6 {
  color: #f1f5f9;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.prose-invert h1 { font-size: 1.5em; }
.prose-invert h2 { font-size: 1.3em; }
.prose-invert h3 { font-size: 1.1em; }

.prose-invert p {
  margin-bottom: 1em;
  line-height: 1.6;
}

.prose-invert strong {
  color: #f8fafc;
  font-weight: 600;
}

.prose-invert em {
  color: #cbd5e1;
  font-style: italic;
}

.prose-invert ul,
.prose-invert ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.prose-invert li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

.prose-invert ul li {
  list-style-type: disc;
}

.prose-invert ol li {
  list-style-type: decimal;
}

.prose-invert a {
  color: #818cf8;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.prose-invert a:hover {
  color: #a5b4fc;
}

.prose-invert blockquote {
  border-left: 4px solid #6366f1;
  padding-left: 1em;
  margin: 1.5em 0;
  color: #94a3b8;
  font-style: italic;
  background: rgba(99, 102, 241, 0.05);
  padding: 1em;
  border-radius: 0.5em;
}

.prose-invert code {
  background: rgba(99, 102, 241, 0.1);
  color: #e2e8f0;
  padding: 0.2em 0.4em;
  border-radius: 0.25em;
  font-size: 0.9em;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.prose-invert pre {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.5em;
  padding: 1em;
  overflow-x: auto;
  margin: 1.5em 0;
}

.prose-invert pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
}

.prose-invert hr {
  border: none;
  border-top: 1px solid rgba(99, 102, 241, 0.3);
  margin: 2em 0;
}

.prose-invert table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.prose-invert th,
.prose-invert td {
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.75em;
  text-align: left;
}

.prose-invert th {
  background: rgba(99, 102, 241, 0.1);
  font-weight: 600;
  color: #f1f5f9;
}

.prose-invert td {
  background: rgba(99, 102, 241, 0.05);
}

/* Messages - Compact Discord-style */
@keyframes messageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageFlash {
  0% {
    background-color: rgba(99, 102, 241, 0.15);
  }
  100% {
    background-color: transparent;
  }
}

.message-entering {
  animation: messageSlideIn 0.3s ease-out forwards;
}

.message-flash {
  animation: messageFlash 1.5s ease-out;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

/* Message Container - minimal spacing */
.message-container {
  transition: background-color 0.15s ease;
}

.message-container + .message-container {
  margin-top: 2px;
}

/* Admin Message - subtle green left border accent */
.admin-message {
  position: relative;
  border-left: 2px solid rgba(34, 197, 94, 0.5);
  padding-left: 8px;
  margin-left: 4px;
}

.admin-message:hover {
  background-color: rgba(34, 197, 94, 0.05);
}

/* Own Message - subtle indigo left border accent */
.own-message {
  position: relative;
  border-left: 2px solid rgba(99, 102, 241, 0.5);
  padding-left: 8px;
  margin-left: 4px;
}

.own-message:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

/* Other User Message - no special styling, just hover */
.other-message {
  position: relative;
}

.other-message:hover {
  background-color: rgba(255, 255, 255, 0.03);
}
