/* ========================================================
   Marusin Delem — Modern Cyberpunk Glassmorphism UI
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg-base: #0f1015;
  --bg-primary: #15171e;
  --bg-secondary: rgba(26, 28, 38, 0.75);
  --bg-tertiary: rgba(35, 38, 52, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  --bg-input: #111218;

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);

  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f43f5e 100%);
  --card-gradient: linear-gradient(145deg, rgba(30, 33, 46, 0.8) 0%, rgba(20, 22, 31, 0.8) 100%);
  --hover-gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.3);

  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px var(--accent-glow);

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85em;
  color: #38bdf8;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: #fff;
}

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

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 12px 3px rgba(16, 185, 129, 0.6);
  }
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

/* Header & Navbar */
header.navbar {
  background: rgba(21, 23, 30, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand .logo-badge {
  background: var(--brand-gradient);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: floatLogo 4s ease-in-out infinite;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.status-pill {
  font-size: 0.85rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulseGlow 2s infinite ease-in-out;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-tertiary);
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

/* App Layout */
.app-container {
  display: flex;
  flex: 1;
}

aside.sidebar {
  width: 275px;
  background: var(--bg-secondary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  padding: 1.75rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.sidebar-header:hover {
  border-color: var(--border-focus);
}
.guild-icon-sm {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Navigation Links (Sidebar) */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.nav-link:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  transform: translateX(4px);
  text-decoration: none;
}
.nav-link.active {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  transform: translateX(4px);
  text-decoration: none;
}
.nav-link.active span {
  transform: scale(1.15);
  transition: transform 0.2s ease;
}

/* Main Content Area */
main.content {
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  animation: fadeInSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Alerts */
.alerts-container {
  margin-bottom: 2rem;
}
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  animation: fadeInSlide 0.3s ease;
  font-weight: 500;
}
.alert-ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.alert-err {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Cards & Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--card-gradient);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
}
.card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
}
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.stat-box {
  background: var(--card-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: var(--transition);
}
.stat-box:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
}
.stat-val {
  font-size: 2rem;
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.stat-lbl {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Buttons with Animations */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.45rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.96) !important;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 15px var(--danger-glow);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--danger-glow);
  color: #fff;
  text-decoration: none;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.5rem;
}
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
}
.form-hint {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: #151720;
}
textarea.form-control {
  min-height: 105px;
  resize: vertical;
}

/* Animated Switches */
.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.65rem 0;
}
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
input:checked + .slider {
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: 0 0 12px var(--accent-glow);
}
input:checked + .slider:before {
  transform: translateX(24px);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
}
table.data-table th, table.data-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data-table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.2);
}
table.data-table tr {
  transition: background 0.15s ease;
}
table.data-table tr:hover {
  background: var(--bg-glass-hover);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  margin-top: auto;
}
