/* Study Carousel Component */
:root{
  --sc-bg: #ffffff;
  --sc-accent: #1a5fb4;
  --sc-muted: #6b7280;
  --sc-radius: 12px;
}

.carousel-container{
  width: 100%;
  max-width: 1100px;
  margin: 2.5rem auto;
  padding: 1rem;
}

.carousel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:1rem;
}

.carousel-title{font-size:1.5rem;font-weight:700;color:var(--sc-accent)}

.carousel-track{
  position:relative;
  perspective:1200px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:1rem;
  overflow:visible;
}

.study-card{
  --card-width: 320px;
  width: var(--card-width);
  min-width: calc(var(--card-width) - 40px);
  background: var(--sc-bg);
  border-radius: var(--sc-radius);
  box-shadow: 0 8px 24px rgba(16,24,40,0.06);
  transition: transform 0.45s ease, opacity 0.45s ease, box-shadow 0.3s ease;
  transform-origin: center center;
  padding:1.25rem;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  cursor: pointer;
}

.study-card .term{font-size:1.25rem;font-weight:700;color:var(--sc-accent);margin-bottom:0.5rem}
.study-card .meta{font-size:0.9rem;color:var(--sc-muted);margin-bottom:0.75rem}
.study-card .definition{font-size:0.98rem;color:#0f1720;line-height:1.45;display:none}

.study-card.active{
  transform: scale(1) translateY(0);
  opacity:1;
  z-index:5;
  box-shadow: 0 18px 48px rgba(16,24,40,0.12);
}

.study-card.prev,
.study-card.next{
  transform: scale(0.92) translateY(6px);
  opacity:0.85; /* 15% faded */
  z-index:3;
}

.study-card.off{
  transform: scale(0.84) translateY(12px);
  opacity:0.5;
  z-index:1;
}

.study-card.flipped .term{opacity:0.4}
.study-card.flipped .definition{display:block}

.carousel-controls{
  display:flex;
  gap:0.5rem;
  align-items:center;
}

.sc-btn{
  background:var(--sc-accent);
  color:#fff;
  border:none;
  width:44px;height:44px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 6px 18px rgba(26,95,180,0.18)
}

/* Responsive: small screens show 1 card centered */
@media (max-width: 768px){
  .carousel-track{padding: 0 1rem}
  .study-card{--card-width: 88vw; min-width: 88vw}
  .study-card.prev, .study-card.next {opacity:0; transform: translateY(18px) scale(0.9)}
  .study-card.off{opacity:0}
}

/* Accessibility focus */
.study-card:focus{outline:3px solid rgba(26,95,180,0.12);outline-offset:4px}
