:root {
  --primary: #1a6fb5;
  --primary-dark: #145a8e;
  --primary-hover: #1761a0;
  --accent: #2ecc71;
  --gold: #ffffff;
  --bg-body: #f7f8fa;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --card-hover-shadow: 0 8px 30px rgba(26, 111, 181, 0.18);
  --radius: 12px;
}

body {
  background: var(--bg-body);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #2c3e50;
}

/* ── Navbar ── */
.navbar-custom {
  background: linear-gradient(135deg, #1a6fb5 0%, #0d4a7a 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
}


.nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: #fff !important;
}

/* ── Hero ── */
.hero-section {
  background: linear-gradient(135deg, #1a6fb5 0%, #0d4a7a 55%, #071e30 100%);
  color: #fff;
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}


.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
}

.text-gold { color: #ffffff; }

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  margin-top: 0.5rem;
}

.hero-badge {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  margin: 0.2rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-weight: 500;
}

/* ── Filter Panel ── */
.filter-panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
}

.sticky-sidebar {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.filter-header {
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 1rem;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  display: block;
}

.filter-section {
  margin-bottom: 1.1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-of-type { border-bottom: none; }

.subject-check-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-label { font-size: 0.88rem; }

/* ── Tutor Cards ── */
.tutor-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: #fff;
  height: 100%;
}

.tutor-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
}

.tutor-avatar {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.subject-pill {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  margin: 0.15rem 0.1rem;
}

.tutor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  font-size: 0.83rem;
  color: #6c757d;
  margin-top: 0.75rem;
}

.tutor-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 500;
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Detail Modal ── */
.modal-profile-header {
  background: linear-gradient(135deg, #1a6fb5, #0d4a7a);
  color: #fff;
  padding: 1.5rem;
  margin: -1rem -1rem 1.5rem;
  border-radius: 8px 8px 0 0;
}

.modal-profile-header .tutor-avatar {
  width: 72px;
  height: 72px;
  min-width: 72px;
  font-size: 1.6rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 576px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-item label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item p {
  margin: 0;
  font-size: 0.95rem;
  color: #2c3e50;
}

/* ── Register Form ── */
.form-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #dbeafe;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subject-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

@media (max-width: 576px) {
  .subject-grid { grid-template-columns: 1fr; }
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

@media (max-width: 576px) {
  .availability-grid { grid-template-columns: repeat(2, 1fr); }
}

.avail-check {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  transition: all 0.2s;
  cursor: pointer;
}

.avail-check:has(input:checked) {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Admin Panel ── */
.admin-login-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a6fb5 0%, #071e30 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inside the wrapper the header bar takes its own height,
   so the gradient fills only what's left (no extra scrollbar) */
.admin-login-wrap .admin-login-bg {
  flex: 1;
  min-height: 0;
  padding: 2rem 1rem;
}

.admin-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.admin-login-logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 0.25rem;
}


.stat-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  box-shadow: var(--card-shadow);
}

.stat-card.stat-pending { background: linear-gradient(135deg, #e67e22, #d35400); }
.stat-card.stat-approved { background: linear-gradient(135deg, #27ae60, #1e8449); }
.stat-card.stat-rejected { background: linear-gradient(135deg, #7f8c8d, #576574); }

.stat-number {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.app-card {
  background: #fff;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.app-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

.app-card-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-card-body {
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  color: #6c757d;
}

.app-card-footer {
  padding: 0.75rem 1.25rem;
  background: #fafafa;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill.pending { background: #fff3cd; color: #856404; }
.status-pill.approved { background: #d1e7dd; color: #0f5132; }
.status-pill.rejected { background: #f8d7da; color: #842029; }

.admin-nav-tabs .nav-link {
  color: #6c757d !important;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
}

.admin-nav-tabs .nav-link.active {
  color: var(--primary) !important;
  border-bottom-color: transparent;
}

/* ── Footer ── */
.site-footer {
  background: #1e2d3d;
  color: rgba(255,255,255,0.8);
  padding: 2rem 0;
  margin-top: 3rem;
}

.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
}

/* ── Loading skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.result-count {
  font-size: 0.9rem;
  color: #6c757d;
}

/* ── Recommended badge ── */
.recommended-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  margin-bottom: 0.35rem;
  display: inline-block;
}

.tutor-card .recommended-badge {
  background: #fef9c3 !important;
  color: #854d0e !important;
  border: 1px solid #fde68a;
}

/* ── Tutor photo ── */
.tutor-photo {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e9ecef;
}

/* ── Photo upload area ── */
.photo-upload-area {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px dashed #bfdbfe;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.photo-upload-area:hover { border-color: var(--primary); }

.photo-upload-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 111, 181, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-upload-area:hover .photo-upload-overlay { opacity: 1; }

/* ── Landing Page ── */
.landing-hero {
  background: linear-gradient(135deg, #1a6fb5 0%, #0d4a7a 55%, #071e30 100%);
  color: #fff;
  padding: 5rem 0 6rem;
  text-align: center;
}

.landing-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
}

.landing-hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  max-width: 640px;
  margin: 0.75rem auto 0;
}

.portal-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 2.25rem;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-top: 4px solid var(--primary);
}

.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-hover-shadow);
}

.portal-card .portal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
}

.portal-card h3 {
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.portal-steps {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.portal-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  color: #495057;
}

.portal-steps .step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-cards {
  margin-top: -3.5rem;
  position: relative;
  z-index: 2;
}

/* ── Blog cards ── */
.blog-card {
  display: block;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
  color: inherit;
}

.blog-card-cover {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.blog-card-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--primary);
  font-size: 2.2rem;
}

.blog-card-body {
  padding: 1.25rem;
}

.blog-card-date {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.blog-card-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.blog-card-excerpt {
  font-size: 0.88rem;
  color: #6c757d;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-readmore {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

/* ── Blog article ── */
.blog-article-cover {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.75rem;
}

.blog-article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2c3e50;
}

.blog-article-body h1,
.blog-article-body h2,
.blog-article-body h3 {
  font-weight: 700;
  color: #1e2d3d;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.blog-article-body p { margin-bottom: 1.1rem; }

.blog-article-body a { color: var(--primary); }

.blog-article-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}

.blog-article-body iframe,
.blog-article-body .ql-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 8px;
  margin: 1.25rem 0;
}

.blog-article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: #6c757d;
  font-style: italic;
  margin: 1.25rem 0;
}

.blog-article-body code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.blog-article-body pre {
  background: #1e2d3d;
  color: #f1f5f9;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

.blog-article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.blog-article-body ul,
.blog-article-body ol {
  margin-bottom: 1.1rem;
  padding-left: 1.5rem;
}

/* ── Blog editor (admin) ── */
.blog-quill-container .ql-toolbar.ql-snow {
  border-color: #dee2e6;
  border-radius: 8px 8px 0 0;
  background: #f8f9fa;
}

.blog-quill-container .ql-container.ql-snow {
  border-color: #dee2e6;
  border-radius: 0 0 8px 8px;
  min-height: 320px;
  font-size: 1rem;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.blog-quill-container .ql-editor { min-height: 320px; }

.blog-quill-container .ql-editor .ql-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Keep Quill's link tooltip on-screen inside the modal (it can otherwise
   get a negative left offset and be clipped) and above editor content */
.blog-quill-container .ql-tooltip {
  left: 8px !important;
  z-index: 100;
}

.blog-cover-preview {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 2rem;
  cursor: pointer;
  border: 2px dashed #dee2e6;
}

.blog-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.blog-status-badge {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.blog-status-badge.published { background: #d1e7dd; color: #0f5132; }
.blog-status-badge.draft { background: #e2e3e5; color: #41464b; }
