
/* ==========================================================================
   Study Section (학습하기)
   ========================================================================== */
.study-section {
  margin-top: 20px;
  width: 100%;
}

.study-guide {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 15px;
  text-align: center;
}

.study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
}

.study-card {
  background: rgba(22, 34, 56, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100px;
  backdrop-filter: blur(5px);
}

.study-card:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--primary-cyan);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 229, 255, 0.2);
}

.study-card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.study-card-title {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.study-card-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
}


/* Study Modal */
.study-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 17, 31, 0.85);
  backdrop-filter: blur(10px);
  z-index: 2000; /* High z-index */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
  visibility: visible;
}

.study-modal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.study-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--primary-cyan);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 229, 255, 0.3);
  animation: modal-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.study-header {
  padding: 20px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.study-title {
  color: var(--primary-cyan);
  font-size: 1.5rem;
  font-weight: 700;
}

.close-study-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.close-study-btn:hover {
  color: var(--error);
}

.study-body {
  padding: 25px;
  overflow-y: auto;
  font-size: 1.0rem;
  line-height: 1.6;
  color: var(--text-main);
  white-space: normal; /* HTML formatting support */
}

/* Study Content Typography */
.study-body h3 {
    color: var(--primary-cyan);
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-cyan);
    padding-left: 10px;
}

.study-body h3:first-child {
    margin-top: 0;
}

.study-body p {
    margin-bottom: 15px;
    color: var(--text-dim);
}

.study-body strong {
    color: var(--text-main);
    font-weight: 700;
}

.study-list {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.study-list li {
    margin-bottom: 10px;
    padding-left: 15px;
    position: relative;
    color: var(--text-dim);
}

.study-list li::before {
    content: "•";
    color: var(--primary-cyan);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.tool-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-card h4 {
    color: var(--secondary-purple);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.tool-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* 알찬 학습 콘텐츠 블록 */
.study-hero {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.15);
  color: var(--primary-cyan);
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.study-lead {
  font-size: 1.05rem !important;
  color: #e2e8f0 !important;
  margin-bottom: 18px !important;
}

.study-quote {
  color: #67e8f9;
}

.study-tip,
.study-example,
.study-mistake,
.study-takeaway {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.study-tip {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.35);
}

.study-example {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.35);
}

.study-mistake {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
}

.study-takeaway {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
}

.study-tip p,
.study-example p,
.study-mistake p,
.study-takeaway p {
  margin: 8px 0 0 !important;
  color: var(--text-main) !important;
}

.study-code {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #a5f3fc;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

.study-steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text-dim);
}

.study-steps li {
  margin-bottom: 10px;
}

.study-progress-banner {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  font-weight: 700;
  color: var(--primary-cyan);
  margin-bottom: 4px;
}

.study-progress-hint {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.9rem;
}

.study-card.studied {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.15);
}

.study-card-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
}

.study-card.studied .study-card-badge {
  color: #6ee7b7;
}

.mini-quiz {
  margin-top: 28px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(255, 215, 0, 0.06);
}

.mini-quiz h3 {
  border-left-color: #fbbf24 !important;
  color: #fde68a !important;
  margin-top: 0 !important;
}

.mini-quiz-q {
  color: #fff !important;
  font-weight: 700;
  margin-bottom: 12px !important;
}

.mini-quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-quiz-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  transition: 0.2s;
}

.mini-quiz-btn:hover:not(:disabled) {
  border-color: var(--primary-cyan);
  transform: translateX(4px);
}

.mini-quiz-btn.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.15);
}

.mini-quiz-btn.wrong {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.15);
}

.mini-quiz-feedback {
  margin-top: 12px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.mini-quiz-complete {
  margin-top: 14px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary-cyan), #7c3aed);
  color: #0a1628;
}

.mini-quiz-complete.hidden,
.mini-quiz-feedback.hidden {
  display: none;
}
