@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;500;600;700&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
  --bg: #020204;
  --bg2: #060608;
  --bg3: #0c0b0f;
  --card: #0f0d13;
  --card-hover: #16131d;
  --border: rgba(255,255,255,0.04);
  --border-accent: rgba(180,0,0,0.4);
  --accent: #cc0000;
  --accent2: #ff2222;
  --accent-glow: rgba(180,0,0,0.12);
  --accent-pink: #880000;
  --text: #e8ddd0;
  --text2: #7a6e65;
  --text3: #3a3230;
  --danger: #ff2222;
  --success: #5a8a5a;
  --radius: 4px;
  --radius-sm: 3px;
  --shadow: 0 8px 40px rgba(0,0,0,0.9);
  --shadow-accent: 0 0 30px rgba(160,0,0,0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: 0.3px;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, #ff0000 50%, var(--accent) 70%, transparent 100%);
  z-index: 9999;
  box-shadow: 0 0 20px rgba(200,0,0,0.8), 0 0 60px rgba(200,0,0,0.3);
}

body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: rgba(160,0,0,0.5); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(2,2,4,0.95);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(140,0,0,0.3);
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 30px rgba(120,0,0,0.2);
}

.navbar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }

.navbar-logo .logo-icon {
  width: 34px; height: 34px;
  border-radius: 3px; overflow: hidden; flex-shrink: 0;
  border: 1px solid rgba(160,0,0,0.5);
  box-shadow: 0 0 10px rgba(160,0,0,0.3);
}
.navbar-logo .logo-icon img { width: 100%; height: 100%; object-fit: cover; }

.navbar-logo .logo-text {
  font-family: 'Cinzel', serif;
  font-size: 16px; font-weight: 700; letter-spacing: 2px; color: var(--text);
  text-transform: uppercase;
}
.navbar-logo .logo-text span { color: var(--accent); }

.navbar-links { display: flex; align-items: center; gap: 6px; }

.nav-link {
  color: var(--text2); text-decoration: none;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; transition: all 0.2s;
  letter-spacing: 1px; text-transform: uppercase; font-family: 'Rajdhani', sans-serif;
}
.nav-link:hover { color: var(--text); background: rgba(140,0,0,0.1); }
.nav-link.active { color: var(--accent); }

.btn-admin {
  background: linear-gradient(135deg, #8a0000, #cc0000);
  color: #f0d0d0; border: none; padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: all 0.2s; font-family: 'Rajdhani', sans-serif;
  letter-spacing: 2px; text-transform: uppercase;
}
.btn-admin:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: var(--shadow-accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; text-decoration: none; border: none;
  letter-spacing: 1px; text-transform: uppercase;
}
.btn-primary { background: linear-gradient(135deg, #8a0000, #cc0000); color: #f0d0d0; font-weight: 700; }
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: var(--shadow-accent); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--card-hover); border-color: var(--border-accent); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid rgba(140,0,0,0.3); }
.btn-ghost:hover { color: var(--text); background: rgba(140,0,0,0.08); border-color: var(--border-accent); }
.btn-danger { background: rgba(180,0,0,0.12); color: var(--danger); border: 1px solid rgba(180,0,0,0.25); }
.btn-danger:hover { background: rgba(180,0,0,0.22); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 2px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-family: 'Rajdhani', sans-serif; }
.badge-accent { background: rgba(140,0,0,0.15); color: var(--accent); border: 1px solid rgba(140,0,0,0.35); }
.badge-muted { background: var(--bg3); color: var(--text2); }

input, textarea, select {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg3); border: 1px solid rgba(80,0,0,0.4);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 14px; transition: all 0.2s; outline: none; width: 100%;
  letter-spacing: 0.5px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(140,0,0,0.15), 0 0 15px rgba(140,0,0,0.1);
}
input::placeholder, textarea::placeholder { color: var(--text3); }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6e65' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
select option { background: var(--bg3); color: var(--text); }

label { display: block; font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 6px; letter-spacing: 1px; text-transform: uppercase; font-family: 'Rajdhani', sans-serif; }
.form-group { margin-bottom: 18px; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card); border: 1px solid rgba(80,0,0,0.4); color: var(--text);
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  animation: slideInToast 0.3s ease; box-shadow: var(--shadow); min-width: 240px;
  font-family: 'Rajdhani', sans-serif; font-weight: 500; letter-spacing: 0.5px;
}
.toast.success { border-color: rgba(60,100,60,0.5); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-color: rgba(180,0,0,0.5); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info { border-color: var(--border-accent); }
.toast.info .toast-icon { color: var(--accent); }
@keyframes slideInToast { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  backdrop-filter: blur(10px); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px; padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(80px, env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid rgba(100,0,0,0.4);
  border-radius: var(--radius); padding: 20px; width: 100%; max-width: 520px;
  transform: translateY(20px); transition: transform 0.25s;
  margin: 0 auto; flex-shrink: 0;
  box-shadow: 0 0 40px rgba(100,0,0,0.2);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.modal-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 20px; padding: 4px; line-height: 1; transition: color 0.2s; }
.modal-close:hover { color: var(--accent); }

.divider { height: 1px; background: rgba(80,0,0,0.3); margin: 24px 0; }

.spinner { width: 20px; height: 20px; border: 2px solid rgba(80,0,0,0.3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 80px 20px; color: var(--text3); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 18px; color: var(--text2); margin-bottom: 8px; font-weight: 600; font-family: 'Cinzel', serif; }
.empty-state p { font-size: 14px; }

.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(2,2,4,0.98); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(100,0,0,0.3);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  height: calc(60px + max(0px, env(safe-area-inset-bottom)));
}
.bottom-nav-inner { display: flex; align-items: center; justify-content: space-around; max-width: 480px; margin: 0 auto; }
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--text3); padding: 4px 20px;
  border-radius: var(--radius-sm); transition: color 0.2s; position: relative;
  background: none; border: none; cursor: pointer; font-family: 'Rajdhani', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item.active { color: var(--accent); }
.bnav-item.active .bnav-dot { opacity: 1; }
.bnav-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.bnav-label { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.bnav-dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity 0.2s; box-shadow: 0 0 6px var(--accent); }
.has-bottom-nav { padding-bottom: calc(60px + max(0px, env(safe-area-inset-bottom))); }

@media (max-width: 768px) {
  .navbar { padding: 0 16px; height: 52px; }
  .navbar-links { display: none; }
  .bottom-nav { display: flex; flex-direction: column; justify-content: flex-start; }
}

* { text-rendering: optimizeLegibility; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
