/* --- IMPORT MODERN TYPOGRAPHY --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;900&family=Inter:wght@400;500;600&display=swap');

/* --- CSS VARIABLES: DESIGN SYSTEM --- */
:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Sleek Dark Mode Color Palette */
  --bg-base: hsl(230, 25%, 7%);
  --bg-surface: hsl(230, 20%, 12%);
  --bg-surface-elevated: hsl(230, 18%, 18%);
  
  --primary: hsl(250, 85%, 65%);
  --primary-hover: hsl(250, 85%, 75%);
  --primary-glow: hsla(250, 85%, 65%, 0.4);
  
  --secondary: hsl(280, 80%, 60%);
  --secondary-glow: hsla(280, 80%, 60%, 0.4);
  
  --accent: hsl(45, 95%, 55%);
  
  /* Text Colors */
  --text-main: hsl(230, 20%, 95%);
  --text-muted: hsl(230, 15%, 65%);

  /* Effects */
  --glass-bg: hsla(230, 20%, 15%, 0.5);
  --glass-border: hsla(230, 20%, 30%, 0.3);
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
}

/* --- RESET & BASIC SETUP --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Custom Webkit Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-elevated);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- ANIMATIONS & BACKGROUND FX --- */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 50vw;
  height: 50vw;
  background: var(--primary-glow);
  top: -10%;
  left: -10%;
}

.orb-2 {
  width: 40vw;
  height: 40vw;
  background: var(--secondary-glow);
  bottom: -10%;
  right: -10%;
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.1); }
  100% { transform: translate(-5%, -5%) scale(0.9); }
}

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

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

.glass-box {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px var(--primary-glow);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
}

.btn-glass:hover {
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
}

/* --- TABLES --- */
.glass-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.glass-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.glass-table th {
  background: hsla(230, 20%, 10%, 0.5);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 700;
}

.glass-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsla(230, 20%, 30%, 0.1);
  vertical-align: middle;
}

.glass-table tr {
  transition: background 0.2s ease;
}

.glass-table tbody tr:hover {
  background: hsla(230, 20%, 25%, 0.2);
}

.glass-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- LAYOUT SPECIFICS --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  position: relative;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-main);
  text-decoration: none;
}

.nav-brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  animation: fadeInUp 1s ease-out;
  padding: 2rem 0;
}

.hero-tag {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  max-width: 900px;
}

.hero p {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 700px;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
  margin-top: 5rem;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.stat-icon-servers { background: hsla(210, 100%, 50%, 0.1); color: hsl(210, 100%, 60%); }
.stat-icon-users { background: hsla(150, 100%, 40%, 0.1); color: hsl(150, 100%, 50%); }
.stat-icon-economy { background: hsla(45, 100%, 50%, 0.1); color: hsl(45, 100%, 50%); }

.stat-card h3 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.stat-card p {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-surface);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 50;
}

.sidebar-brand {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
  font-family: var(--font-heading);
  font-size: 1.5rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: var(--glass-bg);
  color: var(--text-main);
  transform: translateX(5px);
}

.sidebar-link.active {
  background: hsla(250, 85%, 65%, 0.15);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.logout-link {
  color: hsl(0, 80%, 65%);
  text-decoration: none;
  font-size: 0.8rem;
  margin-top: 2px;
  transition: color 0.2s;
}
.logout-link:hover { color: hsl(0, 80%, 75%); }

/* Main Dashboard Area */
.dashboard-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-base);
  padding: 2.5rem;
}

.dashboard-header {
  margin-bottom: 3rem;
}

.dashboard-header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Guild Cards Grid */
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.guild-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.guild-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 15px 35px var(--primary-glow);
}

.guild-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin-bottom: 1.5rem;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.guild-card:hover .guild-icon {
  transform: scale(1.05);
}

.guild-icon-fallback {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--glass-bg);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-family: var(--font-heading);
  font-weight: 900;
  margin-bottom: 1.5rem;
}

.guild-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-btn {
  width: 100%;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 80px; }
  .sidebar-brand h2, .sidebar-link span, .user-details { display: none; }
  .sidebar-link { justify-content: center; padding: 1rem; }
  .sidebar-link i { font-size: 1.5rem; margin: 0; }
  .user-info { justify-content: center; }
  .dashboard-main { padding: 1.5rem; }
}

/* Profile Specific Styles */
.profile-hero {
    position: relative;
    padding: 3rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid var(--bg-surface-elevated);
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.level-badge {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface-elevated);
    border: 2px solid var(--primary);
    padding: 4px 16px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.profile-info {
    flex: 1;
    z-index: 2;
}

.profile-info h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.profile-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-badge {
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.xp-container {
    width: 100%;
    height: 24px;
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 1s ease-in-out;
}

.xp-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 900;
    text-shadow: 0px 1px 3px rgba(0,0,0,0.8);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.detail-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.detail-info h4 { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.detail-info h3 { font-size: 2rem; }

/* Theme specific classes based on VIP */
.theme-normal { --card-glow: var(--primary-glow); }
.theme-vip { --card-glow: hsla(280, 80%, 60%, 0.4); --primary: hsl(280, 80%, 60%); }
.theme-epic { --card-glow: hsla(45, 95%, 55%, 0.4); --primary: hsl(45, 95%, 55%); }