/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a1a;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: #06b6d4; text-decoration: none; transition: color 0.2s; }
a:hover { color: #22d3ee; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 { font-family: 'Playfair Display', serif; line-height: 1.3; }
.section-title {
  font-size: 1.75rem;
  margin-bottom: 2rem;
  color: #f1f5f9;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  margin-top: 0.5rem;
  border-radius: 2px;
}

/* === HEADER === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f1f5f9;
}
.logo-icon { color: #06b6d4; font-size: 1.5rem; }
.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: #f1f5f9; }
.nav-search-link { font-size: 1rem; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* === HERO === */
.hero { padding: 2rem 0; }
.hero-card {
  display: block;
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(16,185,129,0.1));
  border: 1px solid rgba(255,255,255,0.08);
  padding: 2.5rem;
  transition: all 0.3s ease;
}
.hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6,182,212,0.3);
  box-shadow: 0 8px 40px rgba(6,182,212,0.1);
}
.hero-category {
  display: inline-block;
  background: var(--cat-color, #06b6d4);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: #f1f5f9;
  margin-bottom: 0.75rem;
  max-width: 800px;
}
.hero-excerpt {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.6);
  max-width: 600px;
  margin-bottom: 1rem;
}
.hero-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* === ARTICLES GRID === */
.section { padding: 2rem 0 4rem; }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.article-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}
.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6,182,212,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  background: rgba(255,255,255,0.05);
}
.article-card-link { display: block; color: inherit; }
.article-card-link:hover { color: inherit; }
.article-card-image {
  position: relative;
  height: 200px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1rem;
}
.article-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-card-category {
  position: relative;
  z-index: 1;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
.article-card-body { padding: 1.25rem; }
.article-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: #f1f5f9;
  line-height: 1.4;
}
.article-card-excerpt {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.article-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

/* === ARTICLE FULL === */
.article-full { padding: 2rem 0; }
.article-header { margin-bottom: 2rem; }
.article-category-badge {
  display: inline-block;
  color: #fff;
  padding: 0.3rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.article-title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  color: #f1f5f9;
  margin-bottom: 1rem;
  max-width: 800px;
}
.article-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.article-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tag {
  padding: 0.2rem 0.6rem;
  border-radius: 0.375rem;
  background: rgba(6,182,212,0.1);
  color: #06b6d4;
  font-size: 0.8rem;
}
.article-hero-image {
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  max-height: 500px;
}
.article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-video { margin: 1.5rem 0; }
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
  max-width: 720px;
}
.article-content h1, .article-content h2, .article-content h3, .article-content h4 {
  font-family: 'Playfair Display', serif;
  color: #f1f5f9;
  margin: 1.5rem 0 0.75rem;
}
.article-content h2 { font-size: 1.75rem; }
.article-content h3 { font-size: 1.35rem; }
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.25rem; }
.article-content blockquote {
  border-left: 3px solid #06b6d4;
  padding: 0.5rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(6,182,212,0.05);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: rgba(255,255,255,0.7);
}
.article-content a { color: #06b6d4; text-decoration: underline; }
.article-content img {
  width: 100%;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
}
.article-share {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.article-share a {
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  background: rgba(255,255,255,0.05);
  font-size: 0.85rem;
  transition: all 0.2s;
}
.article-share a:hover { background: rgba(6,182,212,0.15); }

/* === SEARCH === */
.search-form { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  border: none;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(6,182,212,0.3); color: #fff; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-danger:hover { box-shadow: 0 4px 12px rgba(239,68,68,0.3); }

/* === PAGINATION (admin) === */
.pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
  justify-content: center;
}
.page-link {
  padding: 0.5rem 0.9rem;
  border-radius: 0.375rem;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  transition: all 0.2s;
}
.page-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.page-link.active { background: #06b6d4; color: #000; font-weight: 600; }

/* === INFINITE SCROLL LOADER === */
.scroll-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 0;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}
.scroll-loader-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #06b6d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.scroll-end {
  text-align: center;
  padding: 2.5rem 0;
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
  position: relative;
}
.scroll-end::before,
.scroll-end::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: rgba(255,255,255,0.1);
}
.scroll-end::before { left: 0; }
.scroll-end::after { right: 0; }

/* === NEWSLETTER === */
.newsletter-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.newsletter-form input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}
.newsletter-form button {
  padding: 0.6rem 1rem;
  border-radius: 0.375rem;
  border: none;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.newsletter-form button:hover { box-shadow: 0 4px 12px rgba(6,182,212,0.3); }
.newsletter-msg { margin-top: 0.5rem; font-size: 0.85rem; color: #10b981; }

/* === FOOTER === */
.footer {
  margin-top: 4rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.3);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 3rem 1rem;
}
.footer-tagline { margin-top: 0.5rem; color: rgba(255,255,255,0.4); font-size: 0.9rem; }
.footer-links h4 { margin-bottom: 0.75rem; color: #f1f5f9; font-family: 'Inter', sans-serif; }
.footer-links a {
  display: block;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.footer-links a:hover { color: #06b6d4; }
.footer-newsletter h4 { margin-bottom: 0.75rem; color: #f1f5f9; font-family: 'Inter', sans-serif; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.03);
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.3);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.fade-in-up:nth-child(4) { animation-delay: 0.2s; }
.fade-in-up:nth-child(5) { animation-delay: 0.25s; }
.fade-in-up:nth-child(6) { animation-delay: 0.3s; }
.fade-in-up:nth-child(7) { animation-delay: 0.35s; }
.fade-in-up:nth-child(8) { animation-delay: 0.4s; }
.fade-in-up:nth-child(9) { animation-delay: 0.45s; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: rgba(10,10,26,0.98); flex-direction: column; padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .nav.active { display: flex; }
  .nav-toggle { display: block; }
  .articles-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 1.5rem; }
  .admin-sidebar { width: 200px; }
  .admin-main { padding: 1.5rem; }
  .admin-form .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-card { padding: 1rem; border-radius: 0.75rem; }
  .article-card-image { height: 160px; }
  .footer-inner { grid-template-columns: 1fr; }
  .admin-sidebar { width: 60px; overflow: hidden; }
  .admin-sidebar .logo-text,
  .admin-sidebar .admin-nav-link { display: none; }
  .admin-sidebar .logo-icon { font-size: 1.5rem; }
}
