:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #102a43;
  --muted: #52606d;
  --primary: #2563eb;
  --primary-soft: #e3ecff;
  --border: #d9e2ec;
  --shadow: 0 22px 40px rgba(16, 42, 67, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  line-height: 1.6;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

a:hover,
a:focus-visible {
  color: #1d4ed8;
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0.75rem;
  background: rgba(15, 23, 42, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-logo img {
  height: 3rem;
  object-fit: contain;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.nav-links a {
  color: #f8fafc;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.2rem;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border: none;
  border-radius: 999px;
  color: white;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.18);
}

.auth-button img {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  object-fit: cover;
}

main {
  padding-top: 1rem;
}

.section,
.store-header,
.advertisement,
.course-item,
.blog-card,
.logo-card,
.intro-image,
.video-card {
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.section {
  margin: 2rem 0;
  padding: 2rem;
}

.section h2,
.section h3,
.store-header h1,
.intro-text h1,
.video-text h2,
.video-text h3 {
  margin: 0 0 1rem;
  color: #0f172a;
}

.section-divider {
  width: 100%;
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  border: none;
  margin: 1.5rem 0;
}

.advertisement {
  padding: 2rem;
  margin: 2rem 0;
  background: linear-gradient(135deg, #ffffff, #eaf2ff);
  text-align: center;
}

.advertisement h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  margin-bottom: 1rem;
  line-height: 1.05;
  color: #0f172a;
}

.positive {
  color: #1d4ed8;
}

.ad-description {
  color: #475569;
  margin: 0.6rem 0;
}

.thumbnail {
  border-radius: 20px;
  max-height: 380px;
  object-fit: cover;
  margin: 0.75rem auto;
}

.intro-container,
.video-container,
.logo-grid,
.course-grid,
.faq-grid {
  display: grid;
  gap: 1.25rem;
}

.intro-container,
.video-container {
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 420px);
  align-items: center;
}

.intro-text p,
.course-item p,
.video-text p,
.store-header p,
.footer p,
.blog-card p {
  margin: 0.9rem 0 0;
  color: #475569;
}

.intro-image img,
.video-card img,
.course-item img {
  width: 100%;
  height: auto;
}

.course-item {
  padding: 1.5rem;
}

.course-item h3 {
  margin-bottom: 0.75rem;
}

.price {
  font-weight: 700;
  margin: 1rem 0;
  color: #1d4ed8;
}

.purchase-btn,
.btn,
.auth-button {
  border: none;
  border-radius: 999px;
}

.purchase-btn {
  display: inline-flex;
  padding: 0.9rem 1.4rem;
  background: #2563eb;
  color: white;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.purchase-btn:hover,
.purchase-btn:focus-visible {
  transform: translateY(-1px);
  background: #1d4ed8;
}

.login-prompt {
  margin-top: 1rem;
  font-weight: 600;
}

.login-prompt.error {
  color: #dc2626;
}

.footer {
  padding: 2rem 0;
  color: #64748b;
  font-size: 0.95rem;
  text-align: center;
}

.footer a {
  color: var(--primary);
}

.footer p {
  margin: 0.75rem 0;
}

.contact-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.tutor-photo {
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 1rem auto;
  display: block;
  object-fit: contain;
}

/* About Tutor Section */
#about-tutor .tutor-photo {
  width: 100%;
  max-width: 100%; /* Ensure full width */
  height: auto;
  margin: 1rem 0;
  display: block;
  object-fit: contain; /* Ensure the image is fully visible */
}

/* User Review Section */
#user-reviews .star-photo {
  width: 20px; /* Small size for stars */
  height: auto;
  display: inline-block;
  margin-right: 0.5rem;
}

#user-reviews .comment-image {
  width: 48%; /* Two images per row */
  height: auto;
  margin: 1%;
  display: inline-block;
  object-fit: cover;
}

/* Logo Section */
#logo-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Three logos per row */
  gap: 1rem; /* Add spacing between logos */
  justify-items: center; /* Center align logos */
  align-items: center;
}

#logo-section img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.image-standard {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.625rem;
}

.tutor-photo, .tutor-photo-rounded, .tutor-photo-bordered, .tutor-photo-shadow {
  width: 1000px;
  height: 750px;
  max-width: 100%; /* Scales to device width */
  height: auto; /* Preserves 4:3 ratio */
  object-fit: contain;
  margin: 0.625rem;
}

.tutor-photo-rounded {
  border-radius: 50%;
}

.tutor-photo-bordered {
  border: 3px solid #007bff;
}

.tutor-photo-shadow {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tutor-photo-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  margin: 0;
  overflow-x: auto;
}

.tutor-photo-row img {
  width: 400px;
  height: 300px;
  max-width: 100%; /* Scales to device width */
  height: auto; /* Preserves 4:3 ratio */
  object-fit: contain;
  border-radius: 0.5rem;
  margin: 0;
}

.review-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
  margin-top: 1.25rem;
  max-width: 90vw;
}

.review-gallery img {
  max-width: 390px;
  height: auto;
  max-width: 100%; /* Scales to device width */
  object-fit: contain;
  border-radius: 0.5rem;
}

.reviews-paragraph {
  max-width: 50rem;
  margin: 0 auto;
  padding: 1.25rem;
}

.reviews-subtitle {
  text-align: center;
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1.25rem;
}

.reviews-rating {
  text-align: center;
  margin-bottom: 1.875rem;
}

.rating-score {
  display: inline-block;
  background-color: #007bff;
  color: white;
  padding: 0.3125rem 0.625rem;
  border-radius: 0.3125rem;
  font-size: 0.9rem;
}

.stars-icon {
  width: 9.375rem;
  height: auto;
  vertical-align: middle;
  margin: 0 0.625rem;
}

.review-item {
  text-align: left;
  margin-bottom: 1.25rem;
}

.review-item h4 {
  font-size: 1rem;
  margin: 0.625rem 0;
}

.review-item p {
  color: #666;
  line-height: 1.6;
}

.review-feedback {
  font-size: 0.8rem;
  color: #666;
}

.thumbsup-icon {
  height: 1rem;
  vertical-align: middle;
  margin: 0 0.3125rem;
}

.review-divider {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 1.25rem 0;
}

.logo-section {
  background-color: #333;
  color: white;
  padding: 2.5rem 0;
}

.logo-section .container {
  max-width: 90vw;
  max-width: min(1200px, 90vw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo-group {
  margin-bottom: 2.5rem;
}

.logo-group h2 {
  font-size: 1rem;
  color: white;
  text-align: center;
  margin-bottom: 1.25rem;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  justify-items: center;
}

.logo-item {
  width: 100px;
  height: 100px;
  background-color: white;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.2s;
}

.logo-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

.logo-item:hover {
  transform: scale(1.05);
}

@media (max-width: 900px) {
  .intro-container,
  .video-container,
  .logo-grid,
  .course-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 1.5rem);
  }

  .nav {
    padding: 0.85rem 0.75rem;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 0.45rem 0.65rem;
  }

  .advertisement,
  .section {
    padding: 1.5rem;
  }
}
