/* SkyMed - Medical Education Platform
 * Custom Theme Styles
 * Primary Color: #598dd1
 */

:root {
  --skymed: #598dd1;
  --skymed-50: #eef4fb;
  --skymed-100: #d4e3f5;
  --skymed-200: #a9c7eb;
  --skymed-700: #3a6bb5;
  --skymed-800: #2d5494;
  --skymed-900: #1e3a6b;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-main);
  color: var(--slate-700);
  line-height: 1.6;
  background: #fff;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============= HEADER ============= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  height: 72px;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo img {
  height: 50px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.main-nav a,
.main-nav .nav-dropdown > span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-600);
  transition: color 0.3s;
  padding: 0.5rem 0;
  position: relative;
}

.main-nav a:hover,
.main-nav .nav-dropdown:hover > span {
  color: var(--slate-900);
}

.main-nav a.active {
  color: var(--skymed);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, var(--skymed), var(--skymed-800));
  border-radius: 2px;
}

/* Dropdown menu */
.nav-dropdown {
  position: relative;
  cursor: pointer;
}

.nav-dropdown > span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown .chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.3s;
}

.nav-dropdown:hover .chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 0.5rem;
  display: none;
  z-index: 50;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu-inner {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  border: 1px solid var(--slate-200);
  padding: 0.5rem 0;
  min-width: 200px;
}

.dropdown-menu-inner a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--slate-600);
}

.dropdown-menu-inner a:hover {
  color: var(--skymed);
  background: var(--skymed-50);
}

/* Auth buttons */
.header-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: var(--skymed);
  color: #fff;
}

.btn-primary:hover {
  background: var(--skymed-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(89, 141, 209, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}

.btn-outline:hover {
  border-color: var(--skymed);
  color: var(--skymed);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  width: 100%;
  max-width: 550px;
}

/* ============= HERO SECTION ============= */
.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--skymed-50) 0%, #fff 50%, var(--slate-50) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, var(--skymed-100) 0%, transparent 70%);
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--slate-600);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ============= SECTIONS ============= */
.section {
  padding: 4rem 0;
}

.section--gray {
  background: var(--slate-50);
}

.section-label {
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--skymed);
  margin-bottom: 0.75rem;
  display: block;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 1.5rem;
}

/* Info block (like "Основна мета БПР") */
.info-block {
  background: var(--skymed-50);
  border-left: 4px solid var(--skymed);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem;
}

.info-block p {
  color: var(--slate-700);
  line-height: 1.7;
}

.info-block p strong {
  color: var(--slate-900);
}

/* ============= COURSES GRID ============= */
.courses-filters {
  padding: 1rem 0;
  border-bottom: 1px solid var(--slate-200);
  background: #fff;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.filter-select {
  height: 40px;
  padding: 0 2.5rem 0 0.75rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--slate-700);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 0.75rem center no-repeat;
  appearance: none;
  cursor: pointer;
  min-width: 160px;
}

.filter-select:focus {
  border-color: var(--skymed);
  outline: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 2.5rem 0 2.5rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.3s;
}

.search-input:focus {
  border-color: var(--skymed);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.course-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.course-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.course-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card-badges {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
}

.badge {
  background: rgba(255,255,255,0.9);
  color: var(--slate-700);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.course-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.5rem;
}

.course-card-title:hover {
  color: var(--skymed);
}

.course-card-desc {
  font-size: 0.875rem;
  color: var(--slate-600);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card-instructor {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--slate-600);
  margin-bottom: 0.5rem;
}

.course-card-instructor .avatar {
  width: 24px;
  height: 24px;
  background: var(--skymed-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-card-specs {
  margin-left: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.spec-tag {
  font-size: 0.75rem;
  color: var(--slate-500);
  background: var(--slate-100);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.course-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--slate-600);
  margin-bottom: 1rem;
}

.course-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.course-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-200);
}

.course-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.75rem;
}

.course-card-actions {
  display: flex;
  gap: 0.5rem;
}

.course-card-actions .btn {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

/* ============= FOOTER ============= */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding-left: 4rem;
  margin-bottom: 3rem;
}

.footer-title {
  color: #fff;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  height: 20px;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--slate-400);
}

.footer-links a:hover {
  color: #fff;
}

.footer-contact li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 20px;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.footer-bottom {
  border-top: 1px solid var(--slate-800);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-credit {
  font-size: 0.875rem;
  color: var(--slate-500);
}

.footer-credit a {
  color: var(--skymed);
  font-weight: 500;
}

.footer-credit a:hover {
  color: #fff;
}

/* ============= FAQ ============= */
.faq-section {
  max-width: 768px;
  margin: 0 auto;
}

.faq-category {
  margin-bottom: 2rem;
}

.faq-category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.faq-category-num {
  width: 2rem;
  height: 2rem;
  background: var(--skymed);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.faq-category-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-900);
}

.faq-item {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  transition: all 0.3s;
  border: 1px solid var(--slate-200);
}

.faq-item.open {
  background: var(--skymed-50);
  border-left: 4px solid var(--skymed);
  border-color: var(--skymed-200);
  box-shadow: 0 2px 8px rgba(89,141,209,0.1);
}

.faq-item-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.faq-item-question .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--slate-300);
  margin-right: 0.75rem;
  flex-shrink: 0;
  transition: background 0.3s;
}

.faq-item.open .faq-item-question .dot {
  background: var(--skymed);
}

.faq-item-question span {
  flex: 1;
  font-weight: 500;
  color: var(--slate-900);
  font-size: 0.875rem;
}

.faq-item.open .faq-item-question span {
  color: var(--skymed-800);
}

.faq-item-question .chevron {
  width: 20px;
  height: 20px;
  color: var(--slate-400);
  transition: transform 0.3s, color 0.3s;
}

.faq-item.open .faq-item-question .chevron {
  transform: rotate(180deg);
  color: var(--skymed);
}

.faq-item-answer {
  padding: 0 1.25rem 1rem 2.75rem;
  font-size: 0.875rem;
  color: var(--slate-600);
  line-height: 1.7;
  display: none;
}

.faq-item.open .faq-item-answer {
  display: block;
}

/* ============= TABLE ============= */
.bpr-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
}

.bpr-table thead {
  background: var(--skymed);
}

.bpr-table th {
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
}

.bpr-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  font-size: 0.875rem;
}

.bpr-table tbody tr:hover {
  background: var(--skymed-50);
}

/* ============= SCROLL TO TOP ============= */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--skymed);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(89,141,209,0.3);
  transition: transform 0.3s;
  z-index: 90;
}

.scroll-top-btn.visible {
  display: flex;
}

.scroll-top-btn:hover {
  transform: translateY(-2px);
}

/* ============= INFINITE SCROLL ============= */
.load-more-trigger {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--skymed);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr; padding-left: 0; }
  .courses-grid { grid-template-columns: 1fr; }
  .filters-row { flex-direction: column; }
  .filter-select { width: 100%; }
  .hero h1 { font-size: 2rem; }
  .footer-bottom-row { flex-direction: column; gap: 1rem; text-align: center; }
}

/* === Admin shortcut in top-menu === */
.btn-admin {
  background: #1e3a8a !important;
  color: #fff !important;
  border: 1px solid #1e3a8a !important;
}
.btn-admin:hover {
  background: #2d5494 !important;
  border-color: #2d5494 !important;
  transform: translateY(-1px);
}
