/* ============================================
   Physicstantra - Light Blue & White Theme
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg-light: #f0f7ff;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --accent-blue: #2196f3;
  --accent-blue-dark: #1565c0;
  --accent-blue-light: #64b5f6;
  --accent-sky: #e3f2fd;
  --text-dark: #1a2332;
  --text-body: #37474f;
  --text-muted: #78909c;
  --border-subtle: rgba(33, 150, 243, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(33, 150, 243, 0.12);
  --shadow-lg: 0 8px 40px rgba(33, 150, 243, 0.15);
  --font-heading: 'Quicksand', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --max-width: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-light);
  color: var(--text-body);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-blue-dark);
}

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

/* --- Site Navigation --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--accent-blue-dark);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  color: var(--text-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-body);
  border-radius: 2px;
  transition: all var(--transition);
}

/* --- Hero Section --- */
.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 40%, #e8f5e9 100%);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-blue-dark) 0%, var(--accent-blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.hero-description {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

/* --- CTA Buttons --- */
.cta-button {
  display: inline-block;
  background: var(--accent-blue);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
}

.cta-button:hover {
  color: #ffffff;
  background: var(--accent-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(33, 150, 243, 0.4);
}

/* --- Section Styles --- */
.featured-section {
  padding: 4rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-blue-dark);
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-description {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.section-cta {
  display: inline-block;
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-blue);
  padding-bottom: 2px;
  transition: all var(--transition);
}

.section-cta:hover {
  color: var(--accent-blue-dark);
  border-bottom-color: var(--accent-blue-dark);
}

/* --- Book Grid --- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.book-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.book-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-blue-light);
  box-shadow: var(--shadow-lg);
}

.book-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.book-card-content {
  padding: 1.25rem;
}

.book-number {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent-blue);
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.book-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.book-topic {
  font-size: 0.9rem;
  color: var(--accent-blue);
  margin-bottom: 0.25rem;
}

.book-hero {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.book-age {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.8;
}

/* --- Book Detail Page --- */
.book-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.book-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}

.book-cover img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.book-info h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.meta-item {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.book-description {
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.book-description strong {
  color: var(--text-dark);
}

.affiliate-button {
  display: inline-block;
  background: var(--accent-blue);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 1rem 3rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 25px rgba(33, 150, 243, 0.3);
}

.affiliate-button:hover {
  color: #ffffff;
  background: var(--accent-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(33, 150, 243, 0.4);
}

.affiliate-disclosure {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  line-height: 1.6;
}

/* --- Experiment Grid --- */
.experiment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.experiment-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.experiment-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-blue-light);
  box-shadow: var(--shadow-lg);
}

.experiment-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.experiment-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.experiment-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: var(--accent-sky);
  padding: 0.2rem 0.75rem;
  border-radius: 50px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.experiment-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Experiment Detail Page --- */
.experiment-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.experiment-detail h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.experiment-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.sim-container {
  width: 100%;
  min-height: 500px;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sim-container canvas {
  display: block;
}

.sim-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.phet-embed {
  aspect-ratio: 4 / 3;
}

.experiment-content {
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.8;
}

.experiment-content h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--accent-blue-dark);
  margin: 2rem 0 1rem;
}

.experiment-content h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-dark);
  margin: 1.5rem 0 0.75rem;
}

.experiment-content p {
  margin-bottom: 1rem;
}

.experiment-content ul,
.experiment-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.experiment-content li {
  margin-bottom: 0.4rem;
}

.experiment-content code {
  background: var(--accent-sky);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.experiment-content blockquote {
  border-left: 3px solid var(--accent-blue);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Video Grid --- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue-light);
  box-shadow: var(--shadow-lg);
}

.video-embed {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-thumb img {
  width: 100%;
  height: auto;
}

.video-card-content {
  padding: 1rem 1.25rem;
}

.video-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.video-category-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: var(--accent-sky);
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.video-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: var(--accent-sky);
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Video Player Page --- */
.video-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.video-detail h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.video-player {
  aspect-ratio: 16 / 9;
  max-width: 900px;
  margin: 0 auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.video-player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-content {
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.8;
}

/* --- Category Filter --- */
.category-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-body);
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 1.25rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.filter-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

/* --- Ad Container --- */
.ad-container {
  margin: 2rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* --- Card Link --- */
.card-link {
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition);
}

.card-link:hover {
  text-decoration: underline;
  color: var(--accent-blue-dark);
}

/* --- Page Header --- */
.page-header {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--accent-blue-dark) 0%, var(--accent-blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Related Book --- */
.related-book {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-blue);
  padding-bottom: 1px;
  transition: all var(--transition);
}

.related-book:hover {
  color: var(--accent-blue-dark);
  border-bottom-color: var(--accent-blue-dark);
}

/* --- Site Footer --- */
.site-footer {
  background: var(--bg-white);
  padding: 3rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-container p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent-blue);
}

/* ===========================
   Responsive Breakpoints
   =========================== */

/* Tablet */
@media (max-width: 1024px) {
  .book-grid,
  .experiment-grid,
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: 3rem;
  }

  .page-header h1 {
    font-size: 2.4rem;
  }

  .book-detail-grid {
    gap: 2rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .book-grid,
  .experiment-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 60vh;
    padding: 3rem 1rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.15rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .book-detail-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .book-info h1 {
    font-size: 1.7rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .featured-section {
    padding: 2.5rem 1rem;
  }

  .experiment-detail h1 {
    font-size: 1.7rem;
  }

  .sim-container {
    min-height: 350px;
  }

  .category-filter {
    gap: 0.5rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.35rem 1rem;
  }
}

/* --- Coming Soon --- */
.book-card.coming-soon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.card-coming-soon-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.card-coming-soon-text {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent-blue-dark), var(--accent-blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.coming-soon-banner {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-light));
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  margin-top: 1.5rem;
}

.coming-soon-fullpage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: 3rem 1.5rem;
}

.coming-soon-fullpage h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text-dark);
  margin: 0.5rem 0;
}

.coming-soon-fullpage .book-topic {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.coming-soon-big {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--accent-blue-dark), var(--accent-blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 640px) {
  .coming-soon-big {
    font-size: 3rem;
  }
}

/* --- Hero with Sidebar Layout --- */
.hero.hero-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
  padding: 3rem 2rem;
  min-height: auto;
  height: auto;
}

.hero.hero-with-sidebar .hero-content {
  align-self: center;
}

.hero-sidebar {
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-blue-light) transparent;
}

.hero-sidebar::-webkit-scrollbar {
  width: 4px;
}

.hero-sidebar::-webkit-scrollbar-thumb {
  background: var(--accent-blue-light);
  border-radius: 4px;
}

/* --- Tweets Panel --- */
.tweets-panel {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.tweets-panel-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-blue-dark);
  margin: 0 0 0.25rem 0;
}

.tweets-panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

.tweets-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tweets-list .twitter-tweet {
  margin: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 1024px) {
  .hero.hero-with-sidebar {
    grid-template-columns: 1fr;
  }

  .hero-sidebar {
    max-height: none;
    overflow-y: visible;
  }
}
