/* ============================================
   Base Reset & Body
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f4f6f9;
  color: #1a1a2e;
  line-height: 1.6;
}

/* ============================================
   App Navigation
   ============================================ */

.app-nav {
  background: #1a1a2e;
  border-bottom: 3px solid #1976d2;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.25rem;
}

.app-nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-nav-brand:hover {
  color: #90caf9;
}

.app-nav-links {
  display: flex;
  gap: 1.5rem;
}

.app-nav-links a {
  color: #90caf9;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.app-nav-links a:hover {
  color: #fff;
}

/* ============================================
   Main Content Wrapper
   ============================================ */

.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ============================================
   Flash Messages
   ============================================ */

.flash-notice,
.flash-alert {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}

/* ============================================
   Breadcrumb
   ============================================ */

.breadcrumb {
  font-size: 0.82rem;
  color: #6c757d;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #1976d2;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #bdbdbd;
}

/* ============================================
   Page Header
   ============================================ */

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e0e0e0;
}

.page-header h1 {
  margin: 0.3rem 0 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.25;
}

/* ============================================
   Section Type Badges
   ============================================ */

.section-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.section-type-basic-sentence        { background: #e3f2fd; color: #1565c0; }
.section-type-variation-drill       { background: #f3e5f5; color: #7b1fa2; }
.section-type-translation-drill     { background: #e8f5e9; color: #2e7d32; }
.section-type-response-drill        { background: #fff3e0; color: #e65100; }
.section-type-substitution-drill    { background: #e0f7fa; color: #006064; }
.section-type-conversation-practice { background: #fce4ec; color: #880e4f; }
.section-type-situations            { background: #fff8e1; color: #f57f17; }
.section-type-finder-list           { background: #ede7f6; color: #4527a0; }
.section-type-note                  { background: #f5f5f5; color: #546e7a; }

/* ============================================
   Units Index — Card Grid
   ============================================ */

.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.unit-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
  position: relative;
}

.unit-card:hover {
  border-color: #1976d2;
  box-shadow: 0 4px 20px rgba(25, 118, 210, 0.12);
  transform: translateY(-2px);
}

.unit-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1976d2;
  margin-bottom: 0.5rem;
}

.unit-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: auto;
  line-height: 1.35;
  padding-bottom: 1rem;
}

.unit-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}

.unit-card-meta {
  font-size: 0.8rem;
  color: #9e9e9e;
}

.unit-card-arrow {
  font-size: 1rem;
  color: #bdbdbd;
  transition: color 0.15s, transform 0.15s;
}

.unit-card:hover .unit-card-arrow {
  color: #1976d2;
  transform: translateX(3px);
}

/* ============================================
   Unit Show — Sections List
   ============================================ */

.sections-list-header {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9e9e9e;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.sections-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, background 0.18s;
}

.section-row:hover {
  border-color: #1976d2;
  background: #f5f8ff;
}

.section-row-number {
  font-size: 0.82rem;
  font-weight: 600;
  color: #bdbdbd;
  min-width: 1.75rem;
  flex-shrink: 0;
}

.section-row-title {
  flex: 1;
  font-weight: 500;
  font-size: 0.97rem;
  color: #1a1a2e;
}

.section-row-arrow {
  color: #bdbdbd;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.section-row:hover .section-row-arrow {
  color: #1976d2;
  transform: translateX(2px);
}

/* ============================================
   Section Show — Layout
   ============================================ */

.section-show-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e0e0e0;
}

.section-show-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.section-show-title-row h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a2e;
}

.section-content {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
  min-height: 200px;
}

/* ============================================
   Section Navigation (Prev / Next)
   ============================================ */

.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  padding-top: 0.5rem;
}

.section-nav-prev,
.section-nav-next {
  flex: 1;
}

.section-nav-next {
  display: flex;
  justify-content: flex-end;
}

.section-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #1a1a2e;
  text-decoration: none;
  padding: 0.7rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 300px;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.section-nav-link:hover {
  border-color: #1976d2;
  background: #f5f8ff;
  color: #1976d2;
}

.section-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9e9e9e;
  display: block;
}

.section-nav-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   Situations & Conversation Practice
   ============================================ */

.situation-title,
.conversation-practice-bout {
  text-align: center;
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: #9e9e9e;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

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

@media (max-width: 600px) {
  .app-main {
    padding: 1.5rem 1rem;
  }

  .units-grid {
    grid-template-columns: 1fr;
  }

  .section-content {
    padding: 1.25rem 1rem;
  }

  .section-nav-link {
    max-width: 100%;
  }

  .section-row {
    flex-wrap: wrap;
  }
}

.finder-list-entry:hover,
.finder-list-child:hover {
  background: #e3f2fd;
}

.section-reveal-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.reveal-all-btn {
  background: none;
  border: 1px solid #bdbdbd;
  border-radius: 6px;
  padding: 0.3rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  color: #555;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.reveal-all-btn:hover {
  border-color: #1976d2;
  color: #1976d2;
}

/* Reveal all: disable blur everywhere on the page */
.section-content.revealed .sub-answers,
.section-content.revealed .translation-drill tr .text-de,
.section-content.revealed .response-drill-answer {
  filter: none !important;
  user-select: auto !important;
}

.section-content.revealed .variation-drill-sentences tr .text-de {
  color: inherit !important;
  user-select: auto !important;
  background-image: none !important;
  filter: none !important;
}
