/* === Enhanced Mythralon Medieval Theme === */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

:root{
  /* Dark Medieval Color Palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111520; 
  --bg-tertiary: #1a1f2e;
  
  /* Parchment Colors */
  --parchment-dark: #2d2318;
  --parchment-medium: #3d2f1f;
  --parchment-light: #4a3626;
  --parchment-text: #e8d5b7;
  
  /* Accent Colors */
  --gold-primary: #d4af37;
  --gold-secondary: #b8941f;
  --silver: #c0c0c0;
  --copper: #b87333;
  
  /* Magical Colors */
  --arcane-blue: #4a90e2;
  --poison-green: #7cb342;
  --fire-orange: #ff6b35;
  --frost-blue: #64b5f6;
  
  /* Text Colors */
  --text-primary: #f0f4f8;
  --text-secondary: #b8c5d1;
  --text-muted: #8a95a5;
  
  /* Border Colors */
  --border-primary: #3d4752;
  --border-accent: #5a4a3a;
  --border-gold: rgba(212, 175, 55, 0.3);
}

/* Global Styles */
* { box-sizing: border-box; }

html, body { 
  height: 100%; 
  margin: 0;
  scroll-behavior: smooth;
}

body {
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: 
    radial-gradient(ellipse at top, rgba(74, 144, 226, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
  background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { 
  font-family: 'Cinzel', serif; 
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

h1 { font-size: 2.5rem; color: var(--gold-primary); }
h2 { font-size: 2rem; color: var(--gold-secondary); }
h3 { font-size: 1.5rem; color: var(--text-primary); }

.title-decorative {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}

.title-decorative::before,
.title-decorative::after {
  content: '⚜';
  color: var(--gold-primary);
  font-size: 1.2em;
  margin: 0 1rem;
}

/* Links */
a { 
  color: var(--arcane-blue); 
  text-decoration: none; 
  transition: color 0.3s ease;
}
a:hover { color: var(--frost-blue); }

/* Layout */
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 1rem; 
}

/* Enhanced Panel System */
.panel {
  background: linear-gradient(135deg, 
    rgba(26, 31, 46, 0.95) 0%, 
    rgba(17, 21, 32, 0.98) 100%);
  border: 2px solid var(--border-primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(212, 175, 55, 0.5), 
    transparent);
}

.panel.parchment {
  background: linear-gradient(135deg, 
    var(--parchment-dark) 0%, 
    var(--parchment-medium) 50%, 
    var(--parchment-light) 100%);
  color: var(--parchment-text);
  border: 2px solid var(--border-accent);
  box-shadow: 
    0 8px 32px rgba(45, 35, 24, 0.6),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.panel.parchment::before {
  background: linear-gradient(90deg, 
    transparent, 
    rgba(212, 175, 55, 0.3), 
    transparent);
}

/* Enhanced Form Elements */
.input, .select, .textarea {
  background: rgba(10, 14, 26, 0.8);
  border: 2px solid var(--border-primary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  background: rgba(10, 14, 26, 0.9);
}

.input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* Enhanced Buttons */
.btn {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  border: 2px solid transparent;
  color: var(--bg-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn.ghost {
  background: transparent;
  border: 2px solid var(--gold-primary);
  color: var(--gold-primary);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-secondary);
}

.btn.danger {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn.success {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Grid System */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { 
    grid-template-columns: 1fr; 
  }
}

/* Badges and Tags */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.gold {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  color: var(--bg-primary);
}

.badge.silver {
  background: linear-gradient(135deg, var(--silver), #a0a0a0);
  color: var(--bg-primary);
}

.badge.copper {
  background: linear-gradient(135deg, var(--copper), #966b29);
  color: var(--text-primary);
}

.badge.health {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: white;
}

.badge.mana {
  background: linear-gradient(135deg, var(--arcane-blue), #1976d2);
  color: white;
}

.badge.energy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

/* Progress Bars */
.progress-bar {
  background: rgba(0,0,0,0.5);
  border-radius: 999px;
  overflow: hidden;
  height: 1.5rem;
  border: 1px solid var(--border-primary);
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
  position: relative;
}

.progress-fill.health {
  background: linear-gradient(90deg, #dc2626, #991b1b);
}

.progress-fill.mana {
  background: linear-gradient(90deg, var(--arcane-blue), #1976d2);
}

.progress-fill.experience {
  background: linear-gradient(90deg, #059669, #047857);
}

/* Sidebar Enhancement */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  overflow-y: auto;
  padding: 1rem;
  z-index: 100;
  background: linear-gradient(180deg, 
    rgba(10, 14, 26, 0.95) 0%, 
    rgba(17, 21, 32, 0.98) 100%);
  backdrop-filter: blur(12px);
  border-right: 2px solid var(--border-primary);
}

.sidebar .character-portrait {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--gold-primary), var(--gold-secondary));
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--bg-primary);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  border: 3px solid var(--border-gold);
}

.hud {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(8px);
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hud .chip {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-family: 'Cinzel', serif;
}

/* Navigation Links */
.navlinks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.navlinks a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(26, 31, 46, 0.5);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
}

.navlinks a:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  transform: translateX(4px);
}

.navlinks a.active {
  background: var(--gold-primary);
  color: var(--bg-primary);
  border-color: var(--gold-secondary);
}

.sidebar-badge {
  display: inline-block;
  background: #dc2626;
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: 0.5rem;
  min-width: 1.25rem;
  text-align: center;
}

/* Chat and Online System */
.chat-container {
  background: rgba(10, 14, 26, 0.8);
  border: 2px solid var(--border-primary);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.chat-messages {
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-primary) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--gold-primary);
  border-radius: 3px;
}

.message {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: rgba(45, 35, 24, 0.3);
  border-radius: 8px;
  border-left: 3px solid var(--gold-primary);
}

.online-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: rgba(26, 31, 46, 0.5);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.online-indicator {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Combat Results */
.combat-result {
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 2px solid;
}

.combat-result.victory {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), rgba(4, 120, 87, 0.2));
  border-color: #059669;
}

.combat-result.defeat {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(153, 27, 27, 0.2));
  border-color: #dc2626;
}

/* Responsive Design */
body.has-sidebar {
  margin-left: 280px;
}

/* Rightbar Styles */
body.has-rightbar {
  margin-right: 350px;
}

body.has-rightbar.rightbar-hidden {
  margin-right: 0;
}

.rightbar {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 2px solid var(--border-primary);
  overflow-y: auto;
  padding: 1.5rem;
  z-index: 40;
  transition: transform 0.3s ease;
}

.rightbar.hidden {
  transform: translateX(100%);
}

/* Rightbar Toggle Button */
.rightbar-toggle {
  position: fixed;
  top: 50%;
  right: 350px;
  transform: translateY(-50%);
  background: var(--gold-primary);
  color: var(--bg-primary);
  border: 2px solid var(--gold-secondary);
  border-radius: 8px 0 0 8px;
  padding: 1rem 0.5rem;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 45;
  transition: all 0.3s ease;
  font-weight: bold;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.3);
}

body.rightbar-hidden .rightbar-toggle {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.rightbar-toggle:hover {
  background: var(--gold-secondary);
  transform: translateY(-50%) translateX(-4px);
}

body.rightbar-hidden .rightbar-toggle:hover {
  transform: translateY(-50%) translateX(-4px);
}

@media (max-width: 1400px) {
  body.has-rightbar {
    margin-right: 0;
  }

  .rightbar {
    width: 320px;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.5);
  }

  .rightbar-toggle {
    right: 320px;
  }
}

@media (max-width: 1024px) {
  body.has-sidebar {
    margin-left: 0;
  }

  .sidebar {
    position: static;
    width: auto;
    border-right: none;
    border-bottom: 2px solid var(--border-primary);
  }

  body.has-rightbar {
    margin-right: 0;
  }

  .rightbar {
    width: 300px;
  }

  .rightbar-toggle {
    right: 300px;
  }
}

@media (max-width: 768px) {
  .rightbar {
    width: 280px;
  }

  .rightbar-toggle {
    right: 280px;
    font-size: 1rem;
    padding: 0.75rem 0.4rem;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold-primary); }
.text-silver { color: var(--silver); }
.text-success { color: #22c55e; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes particles {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

.fade-in { animation: fadeIn 0.5s ease-out; }
.slide-in { animation: slideIn 0.3s ease-out; }
.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
/* Enhanced Progress Bar System */
.progress-bar {
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  overflow: hidden;
  height: 8px;
  border: 1px solid var(--border-primary);
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
  position: relative;
}

.progress-fill.health {
  background: linear-gradient(90deg, #dc2626, #991b1b);
}

.progress-fill.mana {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
}

.progress-fill.exp {
  background: linear-gradient(90deg, #059669, #047857);
}

/* Character Portrait Enhancement */
.character-portrait {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--bg-primary);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  border: 3px solid var(--border-gold);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* Button size variants */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* === Enhanced Landing Page Styles === */

/* Hero Section Enhancements */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(74, 144, 226, 0.1) 0%, transparent 50%);
  animation: pulse 8s ease-in-out infinite;
}

.hero-title {
  text-shadow:
    0 0 20px rgba(212, 175, 55, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.8);
  animation: float 4s ease-in-out infinite;
}

/* Discord Buttons */
.btn-discord {
  background: linear-gradient(135deg, #5865F2, #4752C4);
  color: white;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
  animation: glow 2s ease-in-out infinite;
}

.btn-discord:hover {
  background: linear-gradient(135deg, #6875f5, #5865F2);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(88, 101, 242, 0.6);
}

.btn-discord-large {
  background: linear-gradient(135deg, #5865F2, #4752C4);
  color: white;
  padding: 1.5rem 3rem;
  font-size: 1.2rem;
  box-shadow: 0 8px 30px rgba(88, 101, 242, 0.5);
  border-radius: 12px;
}

.btn-discord-large:hover {
  background: linear-gradient(135deg, #6875f5, #5865F2);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(88, 101, 242, 0.7);
}

/* Discord Panel Special Styling */
.discord-panel {
  background: linear-gradient(135deg,
    rgba(88, 101, 242, 0.1) 0%,
    rgba(26, 31, 46, 0.95) 50%,
    rgba(88, 101, 242, 0.1) 100%);
  border: 2px solid rgba(88, 101, 242, 0.3);
  position: relative;
  overflow: hidden;
}

.discord-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(88, 101, 242, 0.2),
    transparent);
  animation: shimmer 3s infinite;
}

/* Feature Cards Enhancement */
.feature-card {
  transition: all 0.3s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(212, 175, 55, 0.1) 0%,
    transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--gold-primary);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.5),
    0 0 30px rgba(212, 175, 55, 0.3);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.feature-card:hover .feature-icon {
  animation: float 1s ease-in-out infinite;
}

/* Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Text Color Utilities */
.text-secondary {
  color: var(--text-secondary);
}

.bg-bg-primary\/50 {
  background-color: rgba(10, 14, 26, 0.5);
}

.bg-gold-primary\/10 {
  background-color: rgba(212, 175, 55, 0.1);
}

.border-primary {
  border-color: var(--border-primary);
}

.border-gold-primary {
  border-color: var(--gold-primary);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    py: 12;
  }

  .hero-title {
    font-size: 3rem;
  }

  .btn-discord-large {
    padding: 1.25rem 2rem;
    font-size: 1rem;
  }

  .feature-card:hover {
    transform: none;
  }
}