/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-soft: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 10px 25px rgba(0,0,0,.35);
  --header-h: 72px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
.container { width: min(1140px, 92%); margin: 0 auto; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; gap: 1rem;
}
.logo { display: flex; align-items: center; height: 48px; }
.logo img { height: 48px; width: auto; border-radius: 6px; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a {
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
  transition: color .2s;
}
.nav a:hover, .nav a.active { color: var(--text); }
.burger {
  display: none; background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; flex-direction: column; justify-content: center; gap: 6px;
}
.burger span {
  display: block; height: 2px; background: var(--text); border-radius: 2px;
  transition: .3s;
}

/* ===== Hero ===== */
.hero {
  padding: 4.5rem 0 3.5rem;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700; margin-bottom: .75rem; line-height: 1.2;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--text-muted); font-size: 1.15rem;
  max-width: 560px; margin: 0 auto 1.75rem;
}
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.5rem; border-radius: 8px; font-weight: 600;
  font-size: .95rem; border: none; cursor: pointer; transition: .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--bg-soft);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }

/* ===== Sections ===== */
section { padding: 3.5rem 0; }
.section-title {
  font-size: 1.75rem; font-weight: 700; margin-bottom: .5rem; text-align: center;
}
.section-sub {
  color: var(--text-muted); text-align: center; margin-bottom: 2.5rem;
  max-width: 520px; margin-left: auto; margin-right: auto;
}

/* ===== Courses grid ===== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.course-card {
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid rgba(255,255,255,.05);
}
.course-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,.4); }
.course-card img { width: 100%; height: 180px; object-fit: cover; }
.course-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.course-body h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.course-meta {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem;
  font-size: .8rem; color: var(--text-muted);
}
.course-meta span {
  background: var(--bg-soft); padding: .2rem .55rem; border-radius: 6px;
}
.course-body p { color: var(--text-muted); font-size: .9rem; flex: 1; margin-bottom: 1rem; }
.skills { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.skill-tag {
  font-size: .75rem; background: rgba(59,130,246,.15); color: #93c5fd;
  padding: .15rem .5rem; border-radius: 4px;
}
.course-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: auto;
}
.price { font-weight: 700; font-size: 1.1rem; color: var(--accent); }

/* ===== News ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.news-card {
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; border: 1px solid rgba(255,255,255,.05);
  transition: transform .2s;
}
.news-card:hover { transform: translateY(-3px); }
.news-card img { width: 100%; height: 160px; object-fit: cover; }
.news-body { padding: 1.15rem; }
.news-date { font-size: .8rem; color: var(--text-muted); margin-bottom: .35rem; }
.news-body h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.news-body p { color: var(--text-muted); font-size: .9rem; }

/* ===== About / Vizitka ===== */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start;
}
.about-text p { color: var(--text-muted); margin-bottom: 1rem; }
.vizitka {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--radius); padding: 1.75rem;
  box-shadow: var(--shadow);
}
.vizitka h3 { margin-bottom: 1rem; color: var(--accent); }
.vizitka-item {
  display: flex; gap: .75rem; margin-bottom: .85rem; align-items: flex-start;
  color: var(--text-muted); font-size: .95rem;
}
.vizitka-item strong { color: var(--text); min-width: 70px; }
.socials { display: flex; gap: .75rem; margin-top: 1.25rem; }
.socials a {
  background: var(--bg-soft); width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: .9rem; transition: .2s;
}
.socials a:hover { background: var(--accent); }

/* ===== Certificate modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border-radius: var(--radius);
  width: min(480px, 100%); max-height: 90vh; overflow-y: auto;
  padding: 1.75rem; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.08);
}
.modal h2 { margin-bottom: 1rem; font-size: 1.35rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .35rem; font-size: .9rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .65rem .9rem; border-radius: 8px;
  border: 1px solid var(--bg-soft); background: var(--bg);
  color: var(--text); font-size: .95rem; font-family: inherit;
}
.form-group textarea { min-height: 90px; resize: vertical; }
.modal-actions { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* Certificate print */
.certificate {
  display: none;
  width: 800px; min-height: 560px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a; padding: 2.5rem; margin: 0 auto;
  border: 12px solid #1e3a5f; position: relative;
  font-family: 'Times New Roman', serif;
}
.certificate.show { display: block; }
.cert-header { text-align: center; border-bottom: 2px solid #1e3a5f; padding-bottom: 1rem; margin-bottom: 1.5rem; }
.cert-header h1 { font-size: 1.8rem; color: #1e3a5f; letter-spacing: 2px; }
.cert-header p { font-size: .95rem; color: #475569; margin-top: .3rem; }
.cert-body { text-align: center; }
.cert-body .who { font-size: 1.1rem; margin: 1rem 0 .5rem; }
.cert-body .name { font-size: 1.8rem; font-weight: 700; color: #0f172a; margin: .5rem 0 1rem; border-bottom: 1px solid #94a3b8; display: inline-block; padding: 0 1rem .3rem; }
.cert-body .prof { font-size: 1.25rem; margin: 1rem 0; }
.cert-body .prof strong { color: #1e3a5f; }
.cert-footer {
  display: flex; justify-content: space-between; margin-top: 2.5rem;
  font-size: .9rem; color: #475569;
}
.cert-stamp {
  position: absolute; bottom: 40px; right: 50px;
  width: 90px; height: 90px; border: 3px solid #b91c1c;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #b91c1c; font-size: .7rem; font-weight: 700; text-align: center;
  transform: rotate(-15deg); opacity: .85;
}

/* ===== Admin ===== */
.admin-panel {
  display: none; background: var(--bg-card); border-radius: var(--radius);
  padding: 1.5rem; margin-top: 1.5rem; border: 1px solid rgba(255,255,255,.08);
}
.admin-panel.open { display: block; }
.admin-tabs { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.admin-tab {
  padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--bg-soft);
  background: transparent; color: var(--text-muted); cursor: pointer; font-size: .9rem;
}
.admin-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-list { display: flex; flex-direction: column; gap: .75rem; }
.admin-item {
  background: var(--bg); padding: 1rem; border-radius: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}
.admin-item h4 { font-size: 1rem; }
.admin-item .actions { display: flex; gap: .5rem; }

/* ===== Footer ===== */
.footer {
  background: #020617; padding: 2rem 0; text-align: center;
  color: var(--text-muted); font-size: .9rem; border-top: 1px solid rgba(255,255,255,.05);
  margin-top: 2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); flex-direction: column; padding: 1.5rem;
    gap: 1rem; transform: translateY(-120%); transition: .3s;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav.open { transform: translateY(0); }
  .burger { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2.5rem; }
  .courses-grid, .news-grid { grid-template-columns: 1fr; }
}

@media print {
  body * { visibility: hidden; }
  .certificate, .certificate * { visibility: visible; }
  .certificate {
    position: absolute; left: 0; top: 0; width: 100%;
    border: 8px solid #1e3a5f; display: block !important;
  }
  .modal-overlay { display: none !important; }
}