@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  --bg-deep: #0d1117;
  --bg-dark: #111827;
  --bg-card: #1a2235;
  --bg-hover: #1f2d42;
  --border: #2a3a52;
  --border-light: #3a4d66;
  --cyan: #22d3ee;
  --cyan-dim: #0e7490;
  --cyan-glow: rgba(34, 211, 238, 0.15);
  --cyan-glow-strong: rgba(34, 211, 238, 0.3);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --sidebar-width: 260px;
  --header-height: 80px;
  --radius: 10px;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HEADER ── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 24px;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

#menu-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  font-size: 18px;
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}
#menu-toggle:hover { color: var(--cyan); background: var(--cyan-glow); }

.site-logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}

.site-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.05em;
  line-height: 1;
}

.site-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  font-size: 16px;
  transition: color var(--transition), background var(--transition);
}
.header-btn:hover { color: var(--cyan); background: var(--cyan-glow); }

.avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--cyan-dim), #0284c7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  border: 2px solid var(--cyan-dim);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.avatar:hover { border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan-glow-strong); }

/* ── LAYOUT ── */
#layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ── SIDEBAR ── */
#sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease, width 0.3s ease;
  z-index: 90;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-width)));
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section {
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 14px 24px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  transition: background var(--transition);
  user-select: none;
}
.sidebar-section-header:hover { background: var(--cyan-glow); }

.sidebar-chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.sidebar-section.open .sidebar-chevron { transform: rotate(180deg); }

.sidebar-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.sidebar-section.open .sidebar-items { max-height: 600px; }

.sidebar-item {
  display: block;
  padding: 9px 20px 9px 28px;
  font-size: 13.5px;
  font-family: 'Crimson Pro', serif;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  line-height: 1.3;
}
.sidebar-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-left-color: var(--border-light);
}
.sidebar-item.active {
  color: var(--cyan);
  border-left-color: var(--cyan);
  background: var(--cyan-glow);
  font-weight: 600;
}

/* ── MAIN ── */
#main {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
  min-height: calc(100vh - var(--header-height));
}

#main.expanded { margin-left: 0; }

/* ── HOME PAGE ── */
#page-home {
  padding: 60px 64px 80px;
  max-width: 1100px;
}

.hero-icons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px var(--cyan));
  animation: float 3s ease-in-out infinite;
}
.hero-icon:nth-child(2) { animation-delay: 0.5s; }
.hero-icon:nth-child(3) { animation-delay: 1s; }

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

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 56px;
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.nav-card:hover {
  border-color: var(--cyan-dim);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 1px var(--cyan-glow);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.card-icon {
  width: 40px; height: 40px;
  background: var(--cyan-glow);
  border: 1px solid var(--cyan-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.card-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.card-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--cyan-glow);
  border: 1px solid var(--cyan-dim);
  border-radius: 6px;
  color: var(--cyan);
  font-size: 13px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}
.card-btn:hover {
  background: rgba(34, 211, 238, 0.25);
  box-shadow: 0 0 12px var(--cyan-glow);
}

/* About section */
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
}

.about-title {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}

.about-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ── ARTICLE PAGE ── */
#page-article {
  display: none;
  padding: 60px 64px 80px;
  max-width: 800px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
  font-family: 'Cinzel', serif;
}
.breadcrumb a { color: var(--cyan); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-muted); }

.article-title {
  font-family: 'Cinzel', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.article-section-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.article-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--cyan-dim), transparent);
  margin-bottom: 36px;
}

.article-body {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
  white-space: pre-line;
}

.article-body p { margin-bottom: 1.2em; }

.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.article-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  max-width: 45%;
  flex: 1;
}
.article-nav-btn:hover { border-color: var(--cyan-dim); background: var(--bg-hover); }

.article-nav-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-nav-title {
  font-size: 14px;
  color: var(--text-primary);
  font-family: 'Crimson Pro', serif;
}

.article-nav-btn.next { text-align: right; }

/* ── ADMIN ── */
#admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
#admin-overlay.open { display: flex; align-items: center; justify-content: center; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.admin-panel {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 92vw;
  max-width: 960px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
  overflow: hidden;
}

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

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.admin-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.admin-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.admin-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.admin-nav {
  width: 200px;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.admin-nav-section {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}

.admin-nav-item {
  display: block;
  padding: 9px 20px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Crimson Pro', serif;
}
.admin-nav-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.admin-nav-item.active { color: var(--cyan); border-left-color: var(--cyan); background: var(--cyan-glow); }

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-section-title {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 24px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-primary);
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--cyan-dim);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}
.form-textarea { min-height: 120px; line-height: 1.6; }

/* Article editor in admin */
.article-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.article-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.article-list-item:hover { border-color: var(--border-light); }
.article-list-item.editing { border-color: var(--cyan-dim); background: var(--bg-hover); }

.article-list-name {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: 'Crimson Pro', serif;
}
.article-list-section {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.08em;
}

.article-edit-form {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--cyan-dim);
  border-radius: 10px;
  padding: 24px;
  margin-top: 16px;
}
.article-edit-form.open { display: block; }

/* Menu editor */
.menu-section-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.menu-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.menu-section-header:hover { background: var(--bg-hover); }

.menu-section-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--cyan);
  font-weight: 600;
}

.menu-section-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 7px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-dim), #0284c7);
  color: white;
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(34, 211, 238, 0.3); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--border-light); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--cyan-dim);
  border-radius: 10px;
  padding: 14px 20px;
  color: var(--cyan);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
#toast.show { transform: translateY(0); opacity: 1; }

/* Login */
#login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
#login-overlay.open { display: flex; }

.login-box {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 48px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}

.login-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--cyan);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-error {
  font-size: 13px;
  color: #f87171;
  margin-top: 10px;
  display: none;
}
.login-error.show { display: block; }

/* ── ATDR POPUP ── */
#atdr-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 150;
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
#atdr-popup-overlay.open { display: flex; }

.atdr-popup {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  animation: slideUp 0.25s ease;
  position: relative;
}

.atdr-popup-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.atdr-popup-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.atdr-avatar-large {
  width: 96px; height: 96px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(34,211,238,0.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.atdr-avatar-large:hover { box-shadow: 0 8px 40px rgba(34,211,238,0.5); }

.atdr-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute; inset: 0;
}

.atdr-avatar-upload-hint {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  font-size: 11px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
  color: white;
  flex-direction: column;
  gap: 4px;
}
.atdr-avatar-large:hover .atdr-avatar-upload-hint { opacity: 1; }

.atdr-popup-name {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.atdr-popup-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.atdr-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.atdr-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.atdr-link-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}
.atdr-link-btn.discord-btn {
  background: #5865f2;
  border-color: #5865f2;
  color: white;
  grid-column: 1 / -1;
}
.atdr-link-btn.discord-btn:hover { background: #4752c4; border-color: #4752c4; }

.atdr-link-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ATDR avatar in header (small) */
.atdr-avatar-header {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  border: 2px solid var(--cyan-dim);
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.atdr-avatar-header:hover { border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan-glow-strong); }
.atdr-avatar-header img { width:100%; height:100%; object-fit:cover; border-radius:50%; position:absolute; inset:0; }

/* ── ATDR POPUP ── */
#atdr-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 150;
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
#atdr-popup-overlay.open { display: flex; }

.atdr-popup {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  animation: slideUp 0.25s ease;
  position: relative;
}

.atdr-popup-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.atdr-popup-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.atdr-avatar-large {
  width: 96px; height: 96px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(34,211,238,0.3);
  position: relative;
  overflow: hidden;
}

.atdr-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute; inset: 0;
}

.atdr-popup-name {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.atdr-popup-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.atdr-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.atdr-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.atdr-link-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}
.atdr-link-btn.discord-btn {
  background: #5865f2;
  border-color: #5865f2;
  color: white;
  grid-column: 1 / -1;
}
.atdr-link-btn.discord-btn:hover { background: #4752c4; border-color: #4752c4; }

.atdr-link-icon { width: 18px; height: 18px; flex-shrink: 0; }

.atdr-avatar-header {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  border: 2px solid var(--cyan-dim);
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.atdr-avatar-header:hover { border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan-glow-strong); }
.atdr-avatar-header img { width:100%; height:100%; object-fit:cover; border-radius:50%; position:absolute; inset:0; }

/* Publish status */
.publish-status {
  font-size: 13px;
  font-family: 'Cinzel', serif;
  padding: 12px 16px;
  border-radius: 8px;
  display: none;
}
.publish-status:not(:empty) { display: block; }
.publish-status.success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
}
.publish-status.error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}

/* Responsive */
@media (max-width: 900px) {
  #page-home, #page-article { padding: 40px 28px 60px; }
  .hero-title { font-size: 32px; }
  .cards-grid { grid-template-columns: 1fr; }
  .admin-panel { width: 98vw; max-height: 96vh; }
  .admin-nav { width: 160px; }
}

@media (max-width: 640px) {
  #sidebar { width: 240px; }
  .admin-body { flex-direction: column; }
  .admin-nav { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 160px; overflow-x: auto; display: flex; padding: 8px; }
  .admin-nav-section { display: none; }
  .admin-nav-item { white-space: nowrap; padding: 8px 14px; border-left: none; border-bottom: 2px solid transparent; }
  .admin-nav-item.active { border-left-color: transparent; border-bottom-color: var(--cyan); }
}
