/* Premium Blog Design System */
:root {
  /* Colors - Cyber/Vaporwave inspired but Dark Premium */
  --bg-dark: #050507;
  --bg-panel: #0a0c10;
  --card-bg: rgba(20, 25, 35, 0.7);

  --primary: #6d28d9; /* Deep Violet */
  --primary-glow: rgba(109, 40, 217, 0.5);
  --accent: #a78bfa; /* Soft Purple */
  --secondary: #3b82f6; /* Blue */

  --text-main: #ffffff;
  --text-muted: #94a3b8;

  --border: rgba(255, 255, 255, 0.08);
  --glass: blur(20px);

  --font-display: "Outfit", sans-serif;
  --font-body: "Inter", sans-serif;

  --max-width: 1000px;
}

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

html,
body {
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
  /* Subtle background grid/glow */
  background-image:
    radial-gradient(
      circle at 15% 50%,
      rgba(109, 40, 217, 0.08) 0%,
      transparent 25%
    ),
    radial-gradient(
      circle at 85% 30%,
      rgba(59, 130, 246, 0.08) 0%,
      transparent 25%
    );
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

/* === Public Layout (Top Nav) === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: var(--glass);
  background: rgba(5, 5, 7, 0.8);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s;
}

.nav-brand:hover {
  transform: scale(1.02);
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 0 15px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
}

.logo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase !important;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-item {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-item:hover {
  color: var(--text-main);
}

/* Main Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  flex: 1;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1001;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* === Admin Layout (Sidebar) === */
.admin-body {
  display: flex;
  flex-direction: row;
}

.sidebar {
  width: 260px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.4);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
}

.admin-main {
  flex: 1;
  padding: 3rem;
  background: radial-gradient(
    circle at top right,
    rgba(109, 40, 217, 0.05),
    transparent 40%
  );
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 2rem;
}

.sidebar-link {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.sidebar-link span {
  margin-right: 0.5rem;
}

/* === Cards & Feed === */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  border-color: rgba(167, 139, 250, 0.3);
}

.card-meta {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.tags-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.tag-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

/* === Hero Section (Home) === */
.hero-section {
  padding: 5rem 2rem;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 4rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.hero-glow-1 {
  position: absolute;
  top: -30%;
  left: -10%;
  width: 50%;
  height: 160%;
  background: radial-gradient(
    circle,
    rgba(109, 40, 217, 0.12),
    transparent 55%
  );
  pointer-events: none;
  animation: heroOrbFloat 8s ease-in-out infinite;
}

.hero-glow-2 {
  position: absolute;
  bottom: -40%;
  right: -10%;
  width: 50%;
  height: 160%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1), transparent 55%);
  pointer-events: none;
  animation: heroOrbFloat 8s ease-in-out infinite reverse;
}

.hero-avatar-wrapper {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 2rem;
  position: relative;
}

.hero-avatar-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--accent),
    var(--secondary)
  );
  animation: avatarGlow 4s ease-in-out infinite;
  opacity: 0.7;
}

.hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  border: 3px solid var(--bg-dark);
}

.greeting-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(109, 40, 217, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  padding: 0.4rem 1.25rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  line-height: 1.15;
}

.hero-title-prefix {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.hero-title-main {
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    var(--accent) 50%,
    var(--secondary) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.15rem;
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, #4c1d95 100%);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.3);
  font-size: 0.95rem;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.hero-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--text-muted);
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.95rem;
  border: 1px solid var(--border);
}

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

@keyframes avatarGlow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

.hero-btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 25px rgba(109, 40, 217, 0.45) !important;
}

.hero-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-main) !important;
  border-color: rgba(167, 139, 250, 0.3) !important;
  transform: translateY(-2px);
}

/* === Advantage Cards (Home) === */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.advantage-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.advantage-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px -10px rgba(109, 40, 217, 0.35);
  border-color: rgba(167, 139, 250, 0.3);
}

.advantage-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(109, 40, 217, 0.2),
    rgba(59, 130, 246, 0.15)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(109, 40, 217, 0.25);
  box-shadow: 0 0 20px rgba(109, 40, 217, 0.15);
}

.advantage-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  font-family: var(--font-display);
}

.advantage-text {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* === Post Cards (Home/Feed) === */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  border-color: rgba(167, 139, 250, 0.3);
}

.post-card-content {
  padding: 2rem;
  flex-grow: 1;
}

.post-card-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.post-card-group {
  background: rgba(109, 40, 217, 0.15);
  color: var(--accent);
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.post-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: var(--text-main);
  font-family: var(--font-display);
}

.post-card-title a:hover {
  color: var(--accent) !important;
}

.post-card-excerpt {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.post-card-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.post-card-meta {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.see-all-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.25s;
}

.see-all-link:hover {
  border-color: var(--border) !important;
  background: rgba(255, 255, 255, 0.05);
}

.newsletter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.45) !important;
}

.newsletter-section input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

/* === Support Section === */
.support-section {
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
}

.support-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2rem;
  backdrop-filter: blur(20px);
  max-width: 550px;
  margin: 0 auto;
}

.support-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.2),
    rgba(234, 88, 12, 0.15)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.5rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.btn-coffee {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white !important;
  padding: 1rem 2.25rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-coffee:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35) !important;
}

/* === Support Page Cards === */
.support-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  border-color: rgba(167, 139, 250, 0.3);
}

.btn-support-coffee:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.35) !important;
}

#copy-number-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.35) !important;
}

h1 {
  font-family: var(--font-display);
}

.page-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* === Article View === */
.article-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.article-title {
  font-size: 2.75rem;
  line-height: 1.15;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.article-container {
  max-width: 800px;
  margin: 0 auto;
  margin-top: 2rem;
}

.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.meta-item i {
  color: var(--accent);
  font-size: 0.8rem;
}

.meta-divider {
  color: var(--border);
  font-size: 0.7rem;
}

/* Article Body - Rich Content Formatting */
.article-body {
  font-size: 1.1rem;
  line-height: 1.85;
  color: #cbd5e1;
}

/* Headings */
.article-body h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  line-height: 1.25;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.article-body h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

/* Paragraphs */
.article-body p {
  margin-bottom: 1.5rem;
}

/* Links */
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(167, 139, 250, 0.3);
  transition: all 0.2s;
}

.article-body a:hover {
  color: #c4b5fd;
  text-decoration-color: var(--accent);
}

/* Bold & Italic */
.article-body strong,
.article-body b {
  color: var(--text-main);
  font-weight: 700;
}

.article-body em,
.article-body i {
  color: #e2e8f0;
}

/* Underline & Strikethrough */
.article-body u {
  text-underline-offset: 3px;
  text-decoration-color: rgba(167, 139, 250, 0.4);
}

.article-body s {
  color: var(--text-muted);
  text-decoration-color: var(--text-muted);
}

/* Blockquote */
.article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  background: rgba(109, 40, 217, 0.06);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #94a3b8;
}

.article-body blockquote p {
  margin-bottom: 0;
}

/* Lists */
.article-body ul,
.article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-body ul {
  list-style: none;
}

.article-body ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.6rem;
}

.article-body ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.article-body ol li {
  margin-bottom: 0.6rem;
  padding-left: 0.25rem;
}

.article-body ol li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* Nested lists */
.article-body ul ul,
.article-body ol ol,
.article-body ul ol,
.article-body ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Code - Inline */
.article-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  background: rgba(109, 40, 217, 0.12);
  color: #c4b5fd;
  padding: 0.2em 0.5em;
  border-radius: 6px;
  border: 1px solid rgba(109, 40, 217, 0.15);
}

/* Code Block - Pre */
.article-body pre {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  background: var(--bg-panel);
  color: #e2e8f0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  line-height: 1.65;
  white-space: pre-wrap;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Images */
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 2rem 0;
  display: block;
}

/* Horizontal Rule */
.article-body hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 3rem 0;
}

/* First paragraph emphasis */
.article-body > p:first-child {
  font-size: 1.2rem;
  color: #94a3b8;
  line-height: 1.9;
}

/* === Forms & Buttons === */
:root {
  color-scheme: dark; /* Global dark theme force */
}

input,
textarea,
select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  margin-top: 0.5rem;
  transition: all 0.2s;
  color-scheme: dark;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.1rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

select option {
  background-color: #111827 !important;
  color: #ffffff !important;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #4c1d95 100%);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* === Utilities === */
.text-center {
  text-align: center;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mt-4 {
  margin-top: 1rem;
}

/* Admin Tables */
.admin-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-published {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.status-draft {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.bold {
  font-weight: bold;
}

/* Tooltips */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 0.5rem 0.75rem;
  background: var(--bg-panel);
  color: var(--text-main);
  font-size: 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Action Buttons */
.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.action-btn.edit:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.action-btn.delete:hover {
  color: #ef4444;
  border-color: #ef4444;
}
/* === Modals (Global) === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  align-items: center; /* Initial state, will adjust when content is large */
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto; /* The overlay itself now handles the scroll */
  -webkit-overflow-scrolling: touch;
}

.modal.show,
.modal.active {
  display: flex !important;
}

body.modal-open {
  overflow: hidden !important;
  padding-right: var(--scrollbar-width, 0px);
}

.modal-content {
  background: var(--bg-panel);
  padding: 2.5rem;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  margin: auto; /* Keeps it centered via flex or auto-margin */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  position: relative;
  animation: modalAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalAppear {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.modal-header h2,
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  transform: rotate(90deg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Modal Responsive */
@media (max-width: 768px) {
  .modal {
    padding: 1rem;
  }
  .modal-content {
    padding: 1.5rem;
    max-height: 85vh;
  }
  .modal-footer {
    flex-direction: column;
  }
  .modal-footer button {
    width: 100%;
  }
  .modal-header h2,
  .modal-header h3 {
    font-size: 1.4rem;
  }
}

/* === Responsive Media Queries === */

@media (max-width: 1024px) {
  :root {
    --max-width: 900px;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
  }

  .brand {
    font-size: 1.2rem;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-panel);
    flex-direction: column;
    padding: 5rem 2rem;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 9000;
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .nav-links.active {
    right: 0;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-item {
    font-size: 1.1rem;
    width: 100%;
  }

  .dropdown-content {
    position: static;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-top: 0.5rem;
    margin-left: 1rem;
    display: block;
    animation: none;
    border: none;
  }

  .dropdown-content::before {
    display: none;
  }

  .dropdown:hover .dropdown-content {
    display: block;
  }

  .container {
    padding: 2rem 1rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .article-title {
    font-size: 2rem;
  }

  .article-body {
    font-size: 1rem;
  }

  .hero-section h1 {
    font-size: 2.5rem !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 280px;
    height: 100vh;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9000;
  }

  .sidebar.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .sidebar-toggle {
    display: flex;
  }

  .admin-body {
    flex-direction: column;
  }

  .admin-main {
    padding: 1.5rem;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
  }

  .modal-content {
    padding: 1.5rem;
    margin: 2rem 1rem; /* Use vertical margin to allow scrolling of the whole content block within the overlay */
    max-width: calc(100% - 2rem);
    border-radius: 16px;
  }

  .modal-footer {
    flex-direction: column;
    gap: 0.75rem;
  }

  .modal-footer button {
    width: 100%;
    margin-left: 0 !important;
  }

  .modal-header h2,
  .modal-header h3 {
    font-size: 1.35rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 3rem 1rem !important;
  }

  .hero-section h1 {
    font-size: 2rem !important;
  }

  .hero-btn-primary,
  .hero-btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .feed-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1rem;
  }
}
