/* css/apuntes.css */

.apuntes-layout {
  display: flex;
  min-height: calc(100vh - 80px); /* accounting for navbar */
  background-color: var(--clr-bg);
}

.apuntes-sidebar {
  width: 320px;
  background-color: var(--clr-card);
  border-right: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.apuntes-sidebar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--clr-text);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Selectors */
.apuntes-select-group {
  margin-bottom: 20px;
}
.apuntes-select-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--clr-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.apuntes-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--clr-border);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%236c63ff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: right 8px top 50%;
}
.apuntes-select:focus {
  outline: 2px solid var(--clr-purple);
  border-color: var(--clr-purple);
}

/* Topics List */
.apuntes-topics-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.apuntes-topic-item {
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--clr-text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}
.apuntes-topic-item:hover {
  background-color: var(--clr-purple-lt);
}
.apuntes-topic-item.active {
  background-color: var(--clr-purple-lt);
  border-color: var(--clr-purple);
  color: var(--clr-purple);
  font-weight: 700;
}

/* Main Content Area */
.apuntes-content {
  flex: 1;
  padding: 40px 60px;
  overflow-y: auto;
}

.apuntes-article {
  max-width: 800px;
  margin: 0 auto;
  background: var(--clr-card);
  padding: 48px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.apuntes-article h1, .apuntes-article h2, .apuntes-article h3 {
  color: var(--clr-text);
  margin-top: 0;
  margin-bottom: 20px;
}

.apuntes-article h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.apuntes-article h3 {
  font-size: 22px;
  margin-top: 32px;
  border-bottom: 1px solid var(--clr-border);
  padding-bottom: 8px;
}

.apuntes-article p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--clr-muted);
  margin-bottom: 20px;
}

.apuntes-article ul {
  font-size: 17px;
  line-height: 1.7;
  color: var(--clr-muted);
  margin-bottom: 24px;
  padding-left: 24px;
}

.apuntes-article li {
  margin-bottom: 12px;
}

.apuntes-article strong {
  color: var(--clr-text);
}

.apuntes-tip {
  background-color: rgba(108, 99, 255, 0.1);
  border-left: 4px solid var(--clr-purple);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 32px 0;
  font-size: 15.5px;
  color: var(--clr-text);
  line-height: 1.6;
}

.apuntes-tip i {
  color: var(--clr-purple);
  margin-right: 8px;
}

/* Empty State */
.apuntes-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--clr-muted);
}
.apuntes-empty i {
  font-size: 48px;
  color: var(--clr-border);
  margin-bottom: 16px;
}
.apuntes-empty h3 {
  font-size: 20px;
  color: var(--clr-text);
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .apuntes-layout {
    flex-direction: column;
  }
  .apuntes-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--clr-border);
  }
  .apuntes-content {
    padding: 24px 20px;
  }
  .apuntes-article {
    padding: 24px;
  }
}

/* ════════════ TOOLBAR & FLASHCARDS STYLES ════════════ */
.apuntes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--clr-border, #e2e8f0);
}
.apuntes-toolbar__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--clr-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.apuntes-toolbar__actions {
  display: flex;
  gap: 10px;
}
.apuntes-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.apuntes-btn--flashcards {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}
.apuntes-btn--flashcards:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}
.apuntes-btn--print {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
}
.apuntes-btn--print:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* ════════════ MULTI-TAB NAVIGATION ════════════ */
.apuntes-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.apuntes-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
}
.apuntes-tab-btn:hover {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.04);
}
.apuntes-tab-btn.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
}
.apuntes-tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}
.apuntes-tab-content.active {
  display: block;
}

/* Callout boxes for experiments and exam questions */
.apuntes-callout {
  padding: 20px 24px;
  border-radius: 12px;
  margin: 20px 0;
  border-left: 5px solid #4f46e5;
  background: #f8fafc;
}
.apuntes-callout--experiment {
  border-left-color: #0284c7;
  background: #f0f9ff;
}
.apuntes-callout--exam {
  border-left-color: #d97706;
  background: #fffbeb;
}
.apuntes-callout__title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Solution Toggle Button & Box */
.apuntes-btn-toggle-solution {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.apuntes-btn-toggle-solution:hover {
  background: #fde68a;
  color: #78350f;
}
.exam-solution-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #fcd34d;
  animation: fadeIn 0.3s ease;
}

/* Concept Map Banner */
.apuntes-concept-map {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #ffffff;
  padding: 20px 24px;
  border-radius: 14px;
  margin-bottom: 24px;
  box-shadow: 0 10px 20px -5px rgba(49, 46, 129, 0.3);
}
.apuntes-concept-map__header {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a5b4fc;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.apuntes-concept-map__flow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.apuntes-concept-map__node {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.apuntes-concept-map__arrow {
  color: #818cf8;
  font-weight: 800;
}

/* Interactive Calculator Box */
.apuntes-calculator {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 24px;
  margin: 24px 0;
}
.apuntes-calculator__title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.apuntes-calculator__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.apuntes-calculator__field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}
.apuntes-calculator__field input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 15px;
  font-weight: 600;
}
.apuntes-calculator__btn {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.apuntes-calculator__btn:hover {
  background: #4338ca;
}
.apuntes-calculator__result {
  margin-top: 16px;
  padding: 14px 18px;
  background: #e0e7ff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #1e1b4b;
  display: none;
}

/* ════════════ FLASHCARDS MODAL ════════════ */
.flashcards-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.flashcards-modal__container {
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.flashcards-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.flashcards-modal__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.flashcards-modal__header {
  text-align: center;
  margin-bottom: 16px;
  width: 100%;
}
.flashcards-modal__header h3 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
}
.flashcards-modal__counter {
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
}
.flashcards-modal__progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}
.flashcards-modal__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width 0.3s ease;
}

/* 3D Flip Scene */
.flashcard-scene {
  width: 100%;
  height: 260px;
  perspective: 1000px;
  margin: 16px 0;
  cursor: pointer;
}
.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px;
}
.flashcard.is-flipped {
  transform: rotateY(180deg);
}
.flashcard__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}
.flashcard__face--front {
  background: linear-gradient(135deg, #f8fafc, #e0e7ff);
  color: #1e1b4b;
}
.flashcard__face--front .flashcard__badge {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #4f46e5;
  background: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.flashcard__face--front h4 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: #0f172a;
}
.flashcard__face--front .flashcard__hint {
  font-size: 13px;
  color: #6366f1;
  font-weight: 600;
}
.flashcard__face--back {
  background: #ffffff;
  color: #334155;
  transform: rotateY(180deg);
  border-color: #cbd5e1;
}
.flashcard__face--back p {
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  color: #334155;
}

/* Modal Controls */
.flashcards-modal__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
}
.flashcards-btn-ctrl {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flashcards-btn-ctrl:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}
.flashcards-btn-ctrl:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ════════════ PRINT STYLES ════════════ */
@media print {
  body * {
    visibility: hidden;
  }
  .apuntes-article, .apuntes-article * {
    visibility: visible;
  }
  .apuntes-article {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: #ffffff !important;
  }
  .apuntes-toolbar, .navbar, .apuntes-sidebar, .footer {
    display: none !important;
  }
}

