:root {
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #ccfbf1;
  --accent: #2563eb;
  --navy: #0f172a;
  --slate: #334155;
  --slate-muted: #64748b;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --bg-page: #f8fafc;
  --ai-badge-bg: #1e293b;
  --ai-badge-text: #38bdf8;
  --source-badge-bg: #ecfdf5;
  --source-badge-text: #065f46;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-lg: 16px;
  --radius-md: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--navy);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Header & Navigation */
header.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--navy);
}

.brand-text span {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

nav.nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  transition: color 0.2s;
}

nav.nav-links a:hover,
nav.nav-links a.active {
  color: var(--primary);
  text-decoration: none;
}

.admin-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--navy);
  color: white !important;
  border-radius: 8px;
  font-size: 13px !important;
  font-weight: 600;
  transition: background 0.2s;
}
.admin-nav-btn:hover {
  background: #1e293b;
  text-decoration: none !important;
}

/* Main Container */
main#app {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Category Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 28px;
}

.filter-btn {
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Magazine Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.post-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.post-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  overflow: hidden;
}

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

/* AI Badge */
.ai-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  left: auto;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  user-select: none;
  z-index: 2;
  cursor: default;
}

.post-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}

.category-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  font-size: 11px;
}

.post-date {
  color: var(--slate-muted);
}

.post-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 10px;
}

.post-title a {
  color: inherit;
  text-decoration: none;
}
.post-title a:hover {
  color: var(--primary);
}

.post-excerpt {
  font-size: 14px;
  color: var(--slate);
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.source-badge {
  background: var(--source-badge-bg);
  color: var(--source-badge-text);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Article Detail View */
.article-detail {
  max-width: 820px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 36px 40px;
}

.article-header {
  margin-bottom: 24px;
}

.article-header h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--navy);
  margin-top: 14px;
  margin-bottom: 14px;
}

.article-lead {
  font-size: 18px;
  color: var(--slate);
  line-height: 1.5;
  font-weight: 500;
  margin-bottom: 24px;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
}

.article-featured-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

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

.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: #1e293b;
  margin-bottom: 36px;
}

.article-content h2, .article-content h3 {
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--navy);
  font-weight: 700;
}

.article-content p {
  margin-bottom: 18px;
}

.article-content ul, .article-content ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 6px;
}

/* Journalistic & Legal Precaution Notice */
.legal-disclaimer-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.legal-disclaimer-box svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

/* Source Box */
.source-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.source-box .verified-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #059669;
  font-weight: 600;
}

/* Admin Dashboard Styles */
.admin-container {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-header {
  padding: 20px 28px;
  background: #0f172a;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.admin-tabs {
  display: flex;
  background: #1e293b;
  padding: 0 28px;
  overflow-x: auto;
}

.admin-tab {
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-tab.active {
  color: #ffffff;
  border-bottom-color: var(--primary);
}

.admin-body {
  padding: 28px;
}

.card-panel {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
  color: var(--navy);
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
}

textarea.form-control {
  min-height: 120px;
  font-family: inherit;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--slate);
}
.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: #ef4444;
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.data-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--slate);
}

.data-table tr:hover {
  background: #f8fafc;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

/* Footer */
footer.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--slate-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--slate);
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 16px;
  }
  .article-detail {
    padding: 24px 18px;
  }
  .article-header h1 {
    font-size: 24px;
  }
  .admin-body {
    padding: 16px;
  }
}

/* Spinner & Loading Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-sizing: border-box;
}

.spinner-primary {
  border: 3px solid #e0f2fe;
  border-top-color: #0284c7;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

