/* ==========================================================================
   School News Site & Admin Panel Stylesheet
   Modern, elegant, responsive stylesheet with CSS custom properties
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Google Fonts & CSS Custom Properties
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  /* Brand & Theme Colors */
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --secondary: #0f172a;
  --accent: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #60a5fa;

  /* Updated Surfaces for more vibrancy */
  --bg: #f0f4ff;
  --surface: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #d1d5db;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-family);

  /* Geometry & Shapes */
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --border-radius-lg: 24px;

  /* Shadows */
  --shadow: 0 4px 20px rgba(67, 97, 238, 0.08);
  --shadow-lg: 0 12px 40px rgba(58, 12, 163, 0.15);
  --shadow-hover: 0 20px 50px rgba(67, 97, 238, 0.2);

  /* Motion */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Dimensions */
  --header-height: 70px;
  --sidebar-width: 260px;

  /* Glassmorphism Defaults */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
}

/* --------------------------------------------------------------------------
   1. Reset & Base Styles
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  height: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Selection Color */
::selection {
  background-color: var(--accent);
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--accent);
  color: #ffffff;
}

/* Custom Themed Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 9999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-light) var(--bg);
}

/* Media Elements */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

/* --------------------------------------------------------------------------
   2. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.6em;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.025em;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

h5 {
  font-size: 1.1rem;
  font-weight: 600;
}

h6 {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

p {
  margin-bottom: 1.2rem;
  color: inherit;
}

small {
  font-size: 0.85rem;
}

strong, b {
  font-weight: 700;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

blockquote {
  border-left: 4px solid var(--primary);
  padding: 0.8rem 1.4rem;
  margin: 1.5rem 0;
  background: rgba(67, 97, 238, 0.04);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  font-style: italic;
  color: var(--text);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background-color: rgba(0, 0, 0, 0.06);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* --------------------------------------------------------------------------
   3. Header (.header)
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}

.header__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand Section */
.header__brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

#site-logo,
.site-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 2px solid #ffffff;
  transition: var(--transition);
  flex-shrink: 0;
}

.header__brand:hover #site-logo {
  transform: rotate(5deg) scale(1.05);
}

#site-name,
.site-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Search Box in Center */
.header__search,
#search-container {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 320px;
  width: 100%;
}

.header__search-icon {
  position: absolute;
  left: 14px;
  pointer-events: none;
  color: var(--text-light);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#search-input,
.search-input {
  width: 100%;
  padding: 9px 18px 9px 38px;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  transition: var(--transition);
  outline: none;
}

#search-input::placeholder {
  color: #adb5bd;
}

#search-input:focus,
.search-input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

/* Navigation Tabs */
#nav-tabs,
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}

#nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.tab-btn:hover {
  color: var(--primary);
  background: rgba(67, 97, 238, 0.08);
}

.tab-btn--active,
.tab-btn.active {
  background: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(67, 97, 238, 0.35);
}

.tab-btn--active:hover,
.tab-btn.active:hover {
  background: var(--primary-dark);
  color: #ffffff !important;
}

/* Mobile Hamburger Menu */
.hamburger-btn,
.header__menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  align-items: center;
  justify-content: center;
}

.hamburger-btn:hover,
.header__menu-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   4. Hero Section (.hero)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  max-height: 650px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 40px 24px;
  background-color: #ffffff;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: scroll;
  overflow: visible;
  color: var(--text);
}

.hero::before {
  display: none;
}

.hero__content,
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__badge,
.hero__category,
.hero-category {
  display: inline-flex;
  align-items: center;
  background-color: var(--accent);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(247, 37, 133, 0.4);
  transition: var(--transition);
}

.hero__badge:hover {
  transform: translateY(-2px);
}

.hero__title,
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 800;
  background: linear-gradient(
    to right,
    #1e3a8a, #3b82f6, #1e3a8a
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  line-height: 1.18;
  margin-bottom: 14px;
  text-shadow: none;
  max-width: 900px;
  letter-spacing: -0.02em;
}

.hero__subtitle,
.hero__excerpt,
.hero-subtitle {
  font-family: var(--font-family);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  background: linear-gradient(
    to right,
    #1e3a8a, #3b82f6, #1e3a8a
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  line-height: 1.6;
  max-width: 720px;
  margin-bottom: 20px;
  text-shadow: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
}

.hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   5. News Section & Container
   -------------------------------------------------------------------------- */
.container,
.news-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
}

/* Active Filter Indicator */
#active-filter,
.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(67, 97, 238, 0.08);
  border: 1px solid rgba(67, 97, 238, 0.2);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  align-self: flex-start;
  transition: var(--transition);
}

#active-filter.hidden,
.active-filter.hidden {
  display: none !important;
}

.active-filter__clear,
#clear-filter {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  transition: var(--transition);
}

.active-filter__clear:hover,
#clear-filter:hover {
  color: var(--accent);
  transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   6. News Grid (#news-grid)
   -------------------------------------------------------------------------- */
#news-grid,
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   7. News Card (.news-card)
   -------------------------------------------------------------------------- */
.news-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: slideUp 0.5s ease-out backwards;
  overflow: hidden;
}

.news-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

/* Staggered load animation */
.news-card:nth-child(1) { animation-delay: 0.04s; }
.news-card:nth-child(2) { animation-delay: 0.08s; }
.news-card:nth-child(3) { animation-delay: 0.12s; }
.news-card:nth-child(4) { animation-delay: 0.16s; }
.news-card:nth-child(5) { animation-delay: 0.20s; }
.news-card:nth-child(6) { animation-delay: 0.24s; }
.news-card:nth-child(n+7) { animation-delay: 0.28s; }

.news-card__image {
  position: relative;
  width: 100%;
  background-color: #e2e8f0;
}

.news-card__image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.news-card:hover .news-card__image img {
  transform: scale(1.07);
}

.news-card__content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-card__category {
  align-self: flex-start;
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
  transition: var(--transition);
}

.news-card:hover .news-card__category {
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  transform: scale(1.05);
}

.news-card__title {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.news-card:hover .news-card__title {
  color: var(--primary);
}

.news-card__excerpt {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.news-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--primary-dark);
  font-weight: 600;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: auto;
}

.news-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* --------------------------------------------------------------------------
   8. Article Modal (.modal)
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal--active,
.modal.active {
  display: flex !important;
  animation: fadeIn 0.25s ease-out forwards;
}

.modal__content,
.modal-content {
  position: relative;
  background: transparent;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: var(--border-radius-lg);
  box-shadow: none;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal__close,
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.modal__close:hover,
.modal-close:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: rotate(90deg) scale(1.08);
}

.modal__image,
.modal-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  background-color: #e2e8f0;
}

.modal__body,
.modal-body,
.modal__article {
  padding: 36px 32px;
  color: #ffffff;
  overflow-y: auto;
  max-height: 70vh;
}

.modal__category {
  display: inline-block;
  background-color: var(--primary);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.modal__title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.modal__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.88rem;
  color: #ffffff;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.modal__text,
.modal__content-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #ffffff;
}

.modal__text p {
  margin-bottom: 1.5rem;
}

.modal__text img {
  border-radius: var(--border-radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------------------
   9. Footer (.footer)
   -------------------------------------------------------------------------- */
.footer {
  background-color: #1a1a2e;
  color: #e2e8f0;
  padding: 60px 24px 28px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__inner,
.footer__grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer__logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}

.footer__desc {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 380px;
}

.footer__col-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__links a {
  color: #94a3b8;
  font-size: 0.92rem;
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
}

.footer__links a:hover {
  color: #ffffff;
  transform: translateX(4px);
}

.footer__admin-link,
#footer-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #64748b;
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition);
  width: fit-content;
  text-decoration: none;
  margin-top: 8px;
}

.footer__admin-link:hover,
#footer-admin-link:hover {
  color: var(--primary-light);
  border-color: var(--primary-light);
  background: rgba(67, 97, 238, 0.12);
}

.footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   10. Back to Top Button (#back-to-top)
   -------------------------------------------------------------------------- */
#back-to-top,
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 990;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  outline: none;
}

#back-to-top.show,
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover,
.back-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-4px) scale(1.08);
  box-shadow: var(--shadow-hover);
}

#back-to-top:active,
.back-to-top:active {
  transform: translateY(0) scale(0.96);
}

/* --------------------------------------------------------------------------
   11. Loading Spinner (#loading-spinner)
   -------------------------------------------------------------------------- */
#loading-spinner,
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  margin: 20px auto;
  gap: 14px;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
}

.spinner-circle,
#loading-spinner::before {
  content: '';
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

#loading-spinner.hidden,
.loading-spinner.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   12. Empty State (#empty-state)
   -------------------------------------------------------------------------- */
#empty-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-light);
  background: var(--surface);
  border-radius: var(--border-radius);
  border: 1px dashed var(--border);
  margin: 20px 0;
  width: 100%;
}

.empty-state__icon {
  font-size: 3.5rem;
  color: #cbd5e1;
  margin-bottom: 16px;
  line-height: 1;
}

.empty-state__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state__description {
  font-size: 0.95rem;
  max-width: 440px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   13. Buttons (.btn)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--border-radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
  outline: none;
  white-space: nowrap;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3.5px rgba(67, 97, 238, 0.3);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

/* Button Variants */
.btn--primary {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

.btn--primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(67, 97, 238, 0.35);
}

.btn--secondary {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn--secondary:hover {
  background-color: rgba(67, 97, 238, 0.08);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn--danger {
  background-color: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.btn--danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
}

.btn--ghost {
  background-color: transparent;
  color: var(--text);
  border-color: transparent;
}

.btn--ghost:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary);
}

.btn--success {
  background-color: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.btn--success:hover {
  background-color: #059669;
  border-color: #059669;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
}

/* Button Sizes */
.btn--sm {
  padding: 6px 12px;
  font-size: 0.825rem;
  border-radius: 6px;
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--border-radius);
}

.btn--icon {
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
}

/* --------------------------------------------------------------------------
   14. Forms & Form Controls
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  gap: 7px;
  position: relative;
}

.form-group__label,
label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-light);
}

.form-group__input,
.form-group__select,
.form-group__textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 11px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background-color: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #adb5bd;
}

.form-group__input:focus,
.form-group__select:focus,
.form-group__textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(67, 97, 238, 0.15);
}

.form-group__textarea,
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

/* Color Picker Inputs */
input[type="color"],
.form-group__color {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 52px;
  height: 44px;
  padding: 3px;
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 6px;
}

input[type="color"]:hover {
  transform: scale(1.06);
  border-color: var(--primary);
}

.form-group--icon {
  position: relative;
}

.form-group--icon input {
  padding-left: 42px;
}

.form-group--icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
  pointer-events: none;
}

.form-helper {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   15. Login Overlay (.login-overlay)
   -------------------------------------------------------------------------- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
}

.login-overlay.hidden {
  display: none !important;
}

.login-card,
.login-overlay__card {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 42px 36px;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  text-align: left;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header__icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
}

.login-btn,
.login-overlay .btn--primary {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font-size: 1rem;
}

.login-error,
.login-overlay__error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 14px;
  text-align: center;
  background: rgba(239, 68, 68, 0.08);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: none;
}

.login-error.show,
.login-overlay__error.show {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

/* --------------------------------------------------------------------------
   16. Admin Layout
   -------------------------------------------------------------------------- */
.admin-layout {
  min-height: 100vh;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
}

.admin-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--surface);
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
}

.admin-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header__badge {
  background: rgba(67, 97, 238, 0.12);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.admin-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  z-index: 850;
  box-shadow: 1px 0 6px rgba(0, 0, 0, 0.04);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar__nav {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.admin-sidebar__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: var(--border-radius-sm);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  border: 1px solid transparent;
}

.admin-sidebar__item:hover {
  background-color: rgba(67, 97, 238, 0.06);
  color: var(--primary);
}

.admin-sidebar__item--active,
.admin-sidebar__item.active {
  color: var(--primary);
  background-color: rgba(67, 97, 238, 0.1);
  font-weight: 600;
}

.admin-sidebar__item--active::before,
.admin-sidebar__item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.admin-sidebar__icon {
  font-size: 1.15rem;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.admin-sidebar-overlay {
  display: none;
}

.admin-main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 36px;
  min-height: calc(100vh - var(--header-height));
  transition: var(--transition);
  flex-grow: 1;
}

.admin-page-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   17. Admin Dashboard
   -------------------------------------------------------------------------- */
.admin-stats,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(67, 97, 238, 0.3);
}

.stat-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  flex-shrink: 0;
}

.stat-card__icon--secondary {
  background: rgba(58, 12, 163, 0.1);
  color: var(--secondary);
}

.stat-card__icon--accent {
  background: rgba(247, 37, 133, 0.1);
  color: var(--accent);
}

.stat-card__icon--success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.stat-card__info {
  display: flex;
  flex-direction: column;
}

.stat-card__number {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.stat-card__label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-light);
  margin-top: 3px;
}

/* Dashboard Table */
.admin-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 26px;
  margin-bottom: 30px;
}

.admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.admin-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  text-align: left;
}

.admin-table th {
  background-color: #f8fafc;
  padding: 14px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 15px 18px;
  font-size: 0.92rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background-color 0.15s ease;
}

.admin-table tbody tr:hover {
  background-color: rgba(67, 97, 238, 0.04);
}

/* --------------------------------------------------------------------------
   18. Admin Articles
   -------------------------------------------------------------------------- */
.admin-articles-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.admin-article-item,
.article-list-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.admin-article-item:nth-child(even),
.article-list-item:nth-child(even) {
  background-color: #fcfdfe;
}

.admin-article-item:hover,
.article-list-item:hover {
  box-shadow: var(--shadow);
  border-color: rgba(67, 97, 238, 0.3);
  transform: translateY(-1px);
}

.admin-article-item__thumb,
.article-thumb {
  width: 72px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #e2e8f0;
}

.admin-article-item__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  min-width: 0;
}

.admin-article-item__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-article-item__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge--published {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.status-badge--draft {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.admin-article-item__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Article Form Container */
#article-form-container,
.article-form-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 36px;
}

/* Quill Editor Customization */
.ql-toolbar.ql-snow {
  border-top-left-radius: var(--border-radius-sm) !important;
  border-top-right-radius: var(--border-radius-sm) !important;
  border-color: var(--border) !important;
  background-color: #f8fafc !important;
  padding: 10px 14px !important;
}

.ql-container.ql-snow {
  border-bottom-left-radius: var(--border-radius-sm) !important;
  border-bottom-right-radius: var(--border-radius-sm) !important;
  border-color: var(--border) !important;
  min-height: 300px;
  font-family: var(--font-family) !important;
  font-size: 1rem !important;
  background-color: var(--surface);
}

.ql-editor {
  min-height: 280px;
  line-height: 1.7;
}

/* Image Preview */
#image-preview,
.image-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
  margin-top: 10px;
  border: 1.5px solid var(--border);
  display: block;
  box-shadow: var(--shadow);
}

#image-preview.hidden,
.image-preview.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   19. Admin Categories
   -------------------------------------------------------------------------- */
.admin-categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.admin-category-item,
.category-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.admin-category-item:hover,
.category-list-item:hover {
  border-color: rgba(67, 97, 238, 0.3);
  box-shadow: var(--shadow);
}

.drag-handle {
  cursor: grab;
  color: var(--text-light);
  font-size: 1.1rem;
  padding: 4px;
}

.drag-handle:active {
  cursor: grabbing;
}

.category-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.category-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  flex-grow: 1;
}

.category-order {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Inline Add Category Form */
#category-form,
.category-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  background: var(--surface);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 28px;
}

.category-add-form .form-group {
  margin-bottom: 0;
  flex: 1 1 200px;
}

/* --------------------------------------------------------------------------
   20. Admin Customize
   -------------------------------------------------------------------------- */
.customize-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.customize-card,
.customize-group {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.customize-card__heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 16px;
}

.color-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: var(--bg);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
}

.color-picker-item:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.color-picker-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Live Preview Panel */
.customize-preview-panel,
#customize-preview {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-box {
  padding: 20px;
  border-radius: var(--border-radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preview-box__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   21. Toast Notifications (.toast-container)
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  min-width: 300px;
  max-width: 440px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--primary);
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: var(--transition);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.toast__icon {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.toast__content {
  flex-grow: 1;
  font-size: 0.92rem;
  line-height: 1.4;
}

.toast__close {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  line-height: 1;
  transition: var(--transition);
}

.toast__close:hover {
  color: var(--text);
}

.toast--success {
  border-left-color: var(--success);
}

.toast--success .toast__icon {
  color: var(--success);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--error .toast__icon {
  color: var(--danger);
}

.toast--info {
  border-left-color: var(--info);
}

.toast--info .toast__icon {
  color: var(--info);
}

.toast--warning {
  border-left-color: var(--warning);
}

.toast--warning .toast__icon {
  color: var(--warning);
}

.toast.toast--dismissing {
  animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* --------------------------------------------------------------------------
   22. Confirm Dialog
   -------------------------------------------------------------------------- */
.modal--confirm .modal__content,
.confirm-dialog {
  max-width: 420px;
  text-align: center;
  padding: 32px 28px;
}

.confirm-dialog__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
}

.confirm-dialog__icon--danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.confirm-dialog__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-dialog__message {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 24px;
}

.confirm-dialog__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-dialog__actions .btn {
  flex: 1;
}

/* --------------------------------------------------------------------------
   23. Keyframes & Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideInRight {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(110%);
    opacity: 0;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   24. Utility Classes
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

.text-left {
  text-align: left !important;
}

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.flex {
  display: flex !important;
}

.flex-center {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.flex-between {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.gap-1 {
  gap: 0.5rem !important;
}

.gap-2 {
  gap: 1rem !important;
}

.w-100 {
  width: 100% !important;
}

.cursor-pointer {
  cursor: pointer !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   25. Responsive Breakpoints
   -------------------------------------------------------------------------- */

/* Large Tablets & Small Desktops (<= 1200px) */
@media (max-width: 1200px) {
  .container,
  .news-section,
  .header__inner,
  .header__container {
    padding-left: 20px;
    padding-right: 20px;
  }

  #news-grid,
  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
  }

  .footer__grid {
    gap: 32px;
  }
}

/* Tablets (<= 992px) */
@media (max-width: 992px) {
  .customize-layout {
    grid-template-columns: 1fr;
  }

  .customize-preview-panel,
  #customize-preview {
    position: static;
    margin-top: 24px;
  }

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

  .footer__brand {
    grid-column: 1 / -1;
  }
}

/* Mobile & Small Tablets (<= 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  /* Header & Navigation */
  .hamburger-btn,
  .header__menu-btn {
    display: flex;
  }

  .header__search,
  #search-container {
    max-width: 200px;
  }

  #search-input,
  .search-input {
    padding: 7px 14px 7px 32px;
    font-size: 0.82rem;
  }

  .header__search-icon {
    left: 10px;
    font-size: 0.8rem;
  }

  #nav-tabs,
  .nav-tabs {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border);
    gap: 10px;
    z-index: 999;
  }

  #nav-tabs.open,
  .nav-tabs.open {
    display: flex;
    animation: slideUp 0.25s ease-out;
  }

  .tab-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
  }

  /* Hero Section */
  .hero {
    height: 52vh;
    min-height: 340px;
    background-attachment: scroll; /* parallax disabled on mobile for better performance */
  }

  .hero__content,
  .hero-content {
    padding: 32px 18px;
  }

  .hero__title,
  .hero-title {
    font-size: 1.85rem;
  }

  .hero__subtitle,
  .hero-subtitle {
    font-size: 0.98rem;
    -webkit-line-clamp: 2;
  }

  /* Grid: 1 column on mobile */
  #news-grid,
  .news-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Admin Layout */
  .admin-sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 1100;
  }

  .admin-sidebar--open,
  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(2px);
    display: block;
  }

  .admin-sidebar-overlay.active,
  .admin-sidebar-overlay--open {
    opacity: 1;
    visibility: visible;
  }

  .admin-main {
    margin-left: 0;
    padding: 24px 16px;
  }

  .admin-article-item,
  .article-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-article-item__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .admin-article-item__thumb {
    width: 100%;
    height: 140px;
  }

  /* Modals */
  .modal {
    padding: 12px;
  }

  .modal__body,
  .modal-body {
    padding: 24px 18px;
  }

  /* Category inline form stacks */
  #category-form,
  .category-add-form {
    flex-direction: column;
    align-items: stretch;
  }

  .category-add-form .form-group {
    width: 100%;
  }

  .category-add-form .btn {
    width: 100%;
  }
}

/* Extra Small Devices / Phones (<= 480px) */
@media (max-width: 480px) {
  :root {
    --header-height: 60px;
  }

  .header__inner,
  .header__container {
    padding: 0 14px;
    gap: 10px;
  }

  #site-logo,
  .site-logo {
    width: 34px;
    height: 34px;
  }

  #site-name,
  .site-name {
    font-size: 1.15rem;
  }

  .header__search,
  #search-container {
    display: none; /* Collapsed search on very small mobile screens */
  }

  .container,
  .news-section {
    padding: 28px 14px;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .news-card__content {
    padding: 16px;
  }

  .modal__content {
    max-height: 96vh;
    border-radius: var(--border-radius);
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  #back-to-top,
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .toast-container {
    top: 14px;
    right: 14px;
    left: 14px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }

  .login-card,
  .login-overlay__card {
    padding: 30px 20px;
  }
}
