:root {
  --bg-primary: #08080f;
  --bg-secondary: #0f0f1a;
  --bg-card: #16162a;
  --bg-hover: #1e1e3a;
  --text-primary: #e8e8f5;
  --text-secondary: #9090b0;
  --text-muted: #50506a;
  --accent: #5b9fff;
  --accent-dim: #1a4a7a;
  --accent-hover: #7db8ff;
  --accent-glow: rgba(91,159,255,0.15);
  --border: #222238;
  --danger: #ff4a6a;
  --success: #4aff8a;
  --warning: #ffaa4a;
  --gradient: linear-gradient(135deg, #5b9fff 0%, #8b5fff 100%);
  --radius: 10px;
  --max-width: 1200px;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

/* HEADER */
header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; flex-wrap: wrap; gap: 8px;
}
.logo {
  font-size: 24px; font-weight: 800; letter-spacing: -0.5px;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo:hover { opacity: 0.85; }

/* NAV */
.nav-cats { display: flex; gap: 2px; flex-wrap: wrap; }
.nav-cats a {
  padding: 7px 14px; border-radius: 20px;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  transition: all .2s;
}
.nav-cats a:hover { background: var(--bg-hover); color: var(--accent); }
.nav-cats a.active { background: var(--accent-glow); color: var(--accent); }

/* LANG SWITCHER */
.lang-switch { display: flex; gap: 3px; }
.lang-switch a {
  padding: 5px 9px; border-radius: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  background: var(--bg-card); color: var(--text-secondary);
  transition: all .2s;
}
.lang-switch a.active { background: var(--accent); color: #fff; }

/* SEARCH */
.search-box { display: flex; align-items: center; }
.search-box input {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px; border-radius: 20px; font-size: 13px; width: 160px;
  transition: all .2s;
}
.search-box input:focus { outline: none; border-color: var(--accent); width: 200px; }

/* PAY BANNER */
.pay-banner {
  background: var(--gradient);
  color: #fff; text-align: center;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 12px rgba(91,159,255,0.3);
}
.pay-banner a { color: #fff; text-decoration: underline; }

/* MAIN */
main {
  max-width: var(--max-width); margin: 0 auto;
  padding: 24px 20px; flex: 1; width: 100%;
}

/* ARTICLE CARDS */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .3s ease;
  display: flex; flex-direction: column;
}
.article-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.article-card .card-image {
  width: 100%; height: 180px;
  object-fit: cover;
  background: var(--bg-hover);
}
.article-card .card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.card-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); background: var(--accent-glow);
  padding: 3px 10px; border-radius: 12px; margin-bottom: 10px;
  align-self: flex-start;
}
.article-card h3 { font-size: 16px; margin-bottom: 8px; line-height: 1.4; }
.article-card h3 a { color: var(--text-primary); }
.article-card h3 a:hover { color: var(--accent); }
.card-preview {
  color: var(--text-secondary); font-size: 14px; line-height: 1.5; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  margin-top: 12px; display: flex; justify-content: space-between;
  align-items: center; font-size: 12px; color: var(--text-muted);
}

/* ARTICLE PAGE */
.article-full { max-width: 800px; margin: 0 auto; }
.article-full .hero-image {
  width: 100%; max-height: 400px; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 24px;
}
.article-full h1 { font-size: 30px; line-height: 1.3; margin-bottom: 14px; font-weight: 700; }
.article-full .article-meta {
  color: var(--text-muted); font-size: 14px; margin-bottom: 28px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
  display: flex; gap: 20px; flex-wrap: wrap;
}
.article-full .article-body {
  font-size: 17px; line-height: 1.9;
}
.article-full .article-body h2 {
  font-size: 22px; margin-top: 28px; margin-bottom: 14px; color: var(--text-primary);
}
.article-full .article-body h3 {
  font-size: 19px; margin-top: 24px; margin-bottom: 12px; color: var(--text-primary);
}
.article-full .article-body p {
  margin-bottom: 18px;
}
.article-full .article-body ul, .article-full .article-body ol {
  margin-left: 24px; margin-bottom: 18px;
}
.article-full .article-body p { margin-bottom: 18px; }

/* YouTube */
.youtube-embed {
  margin: 24px 0; position: relative; padding-bottom: 56.25%;
  height: 0; overflow: hidden; border-radius: var(--radius);
}
.youtube-embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
}

/* PAGINATION */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 36px; }
.pagination a, .pagination span {
  padding: 9px 15px; border-radius: 8px;
  background: var(--bg-card); color: var(--text-secondary); font-size: 14px;
  transition: all .2s;
}
.pagination a:hover { background: var(--bg-hover); color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; }

/* FOOTER */
footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 28px 20px; margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  text-align: center; color: var(--text-muted); font-size: 14px;
}
.footer-inner a { color: var(--text-secondary); }
.footer-email { margin-top: 8px; font-size: 16px; font-weight: 600; color: var(--accent); }

/* ADMIN */
.admin-header {
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px;
}
.admin-table th { color: var(--text-muted); font-weight: 600; }
.admin-table tr:hover { background: var(--bg-hover); }
.admin-form input, .admin-form textarea, .admin-form select {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); padding: 11px 15px; border-radius: var(--radius);
  font-size: 15px; margin-bottom: 12px;
}
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus {
  outline: none; border-color: var(--accent);
}
.admin-form textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
.admin-form label {
  display: block; margin-bottom: 4px; font-size: 12px; color: var(--text-muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.admin-form .lang-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.admin-form .lang-tabs button {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
  padding: 6px 18px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700;
}
.admin-form .lang-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-form .lang-section { display: none; }
.admin-form .lang-section.active { display: block; }
.admin-form .btn-save {
  background: var(--accent); color: #fff; border: none;
  padding: 13px 36px; border-radius: var(--radius); cursor: pointer; font-size: 15px; font-weight: 700;
}
.admin-form .btn-delete {
  background: var(--danger); color: #fff; border: none;
  padding: 9px 22px; border-radius: var(--radius); cursor: pointer; font-size: 14px;
}

/* SUBMIT WIDGET */
.submit-widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin: 28px 0;
}
.submit-widget h3 { margin-bottom: 14px; }
.submit-widget input, .submit-widget textarea {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-primary); padding: 11px 15px; border-radius: var(--radius);
  margin-bottom: 10px; font-size: 14px;
}
.submit-widget button {
  background: var(--gradient); color: #fff; border: none;
  padding: 12px 28px; border-radius: var(--radius); cursor: pointer; font-size: 14px; font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 10px; }
  .nav-cats { justify-content: center; }
  .article-grid { grid-template-columns: 1fr; }
  .search-box input { width: 130px; }
  .search-box input:focus { width: 160px; }
  .article-full h1 { font-size: 24px; }
  .article-full .article-body { font-size: 16px; }
}
@media (max-width: 480px) {
  .logo { font-size: 20px; }
  .nav-cats a { padding: 5px 10px; font-size: 12px; }
  .lang-switch a { padding: 4px 7px; font-size: 10px; }
  .article-card .card-image { height: 140px; }
}
