@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-highlight: #112240;
  --bg-danger: #3f1b24;
  --bg-success: #0b3020;
  
  --text-white: #ffffff;
  --text-gray: #94a3b8;
  --text-light-gray: #e2e8f0;
  
  --color-gold: #f59e0b;
  --color-blue: #60a5fa;
  --color-ice-blue: #38bdf8;
  --color-red: #f87171;
  --color-green: #34d399;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-white);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Slide Deck Container */
.deck-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100vh - 60px);
}

/* Individual Slides */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(80px);
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 3rem 4rem;
  display: flex;
  flex-direction: column;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Slide Header */
.slide-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  gap: 0.8rem;
}

.slide-header-bar {
  width: 8px;
  height: 36px;
  background-color: var(--color-gold);
  border-radius: 4px;
}

.slide-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 1px;
}

/* Layouts */
.layout-split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2.5rem;
  flex: 1;
  min-height: 0;
}

.layout-single {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
}

.layout-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
}

.layout-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

/* Left Image Column */
.visual-container {
  background-color: var(--bg-highlight);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  height: 100%;
}

.visual-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.5s ease;
}

.visual-container:hover .visual-image {
  transform: scale(1.02);
}

/* Cards & Content */
.card {
  background-color: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.card.highlight {
  background-color: var(--bg-highlight);
}

.card.danger {
  background-color: var(--bg-danger);
  border-color: rgba(248, 113, 113, 0.2);
}

.card.success {
  background-color: var(--bg-success);
  border-color: rgba(52, 211, 153, 0.2);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-light-gray);
  margin-bottom: 1rem;
}

.card ul {
  list-style: none;
}

.card li {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-light-gray);
  margin-bottom: 0.8rem;
  position: relative;
  padding-left: 1.25rem;
}

.card li::before {
  content: "•";
  color: var(--color-gold);
  font-size: 1.5rem;
  position: absolute;
  left: 0;
  top: -2px;
}

.card.danger li::before {
  color: var(--color-red);
}

.card.success li::before {
  color: var(--color-green);
}

/* Colors & Highlights */
.text-gold { color: var(--color-gold); }
.text-blue { color: var(--color-blue); }
.text-ice-blue { color: var(--color-ice-blue); }
.text-red { color: var(--color-red); }
.text-green { color: var(--color-green); }

/* Slide 1 Cover Layout */
.cover-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: center;
  height: 100%;
}

.cover-title {
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-gray) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cover-subtitle {
  font-size: 1.5rem;
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 3.5rem;
}

.cover-info {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
}

.cover-info p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-light-gray);
}

/* Interactive Collapsible / Accordion for Slide 4 */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accordion-item {
  background-color: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.accordion-header {
  padding: 1.2rem 1.5rem;
  background-color: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  transition: background-color 0.3s;
}

.accordion-header:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.accordion-header::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--color-gold);
  transition: transform 0.3s;
}

.accordion-item.active .accordion-header::after {
  content: "-";
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: rgba(0, 0, 0, 0.1);
}

.accordion-content-inner {
  padding: 1.2rem 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-light-gray);
}

/* Interactive Quiz Section */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-question-box {
  background-color: var(--bg-card);
  border-radius: 16px;
  padding: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.quiz-question {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.quiz-badge {
  background-color: var(--color-blue);
  color: var(--bg-dark);
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
  text-transform: uppercase;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.quiz-option {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-light-gray);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}

.quiz-option:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--text-gray);
}

.quiz-option.correct {
  background-color: var(--bg-success);
  border-color: var(--color-green);
  color: var(--color-green);
}

.quiz-option.incorrect {
  background-color: var(--bg-danger);
  border-color: var(--color-red);
  color: var(--color-red);
}

.quiz-explanation {
  margin-top: 1.2rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--color-gold);
  display: none;
  font-size: 1rem;
  line-height: 1.6;
}

.quiz-explanation h4 {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

/* Navigation & Controls Footer */
.slide-controls {
  height: 60px;
  background-color: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: relative;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.progress-bar-container {
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-blue), var(--color-gold));
  transition: width 0.3s ease;
}

.control-left, .control-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn-ctrl {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light-gray);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.btn-ctrl:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.btn-ctrl:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-gray);
}

.nav-select {
  background-color: var(--bg-card);
  color: var(--text-light-gray);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color 0.3s;
}

.nav-select:hover {
  border-color: var(--color-gold);
}

.nav-select option {
  background-color: var(--bg-dark);
  color: var(--text-white);
}

/* Special Case Tabs for Slide 7 */
.tabs-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tabs-headers {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.tab-header {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-gray);
  padding: 0.6rem 1.2rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.tab-header:hover {
  color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.05);
}

.tab-header.active {
  background-color: var(--bg-card);
  color: var(--color-gold);
  border-bottom-color: var(--bg-card);
  border-top: 2px solid var(--color-gold);
}

.tab-body {
  flex: 1;
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0 12px 12px 12px;
  padding: 1.5rem;
  display: none;
  overflow-y: auto;
}

.tab-body.active {
  display: block;
}

/* Animations & Responsive */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse-hint {
  animation: pulse 2s infinite ease-in-out;
}

@media (max-width: 1024px) {
  .layout-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 1.5rem;
  }
  .visual-container {
    height: 220px;
  }
  .slide {
    padding: 2rem 2rem;
  }
  .cover-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cover-title {
    font-size: 2.8rem;
  }
  .cover-info {
    margin-top: 2rem;
  }
  .layout-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .layout-grid-3 {
    grid-template-columns: 1fr;
  }
}
