:root {
  --bg-color: #e0e5ec;
  --text-main: #4a4a4a;
  --text-highlight: #2d3436;
  --shadow-light: #ffffff;
  --shadow-dark: #a3b1c6;
  --accent-color: #007bff;
  --accent-gradient: linear-gradient(145deg, #0069d9, #0082ff);
  --glass-bg: rgba(224, 229, 236, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background-image: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 20%),
    radial-gradient(circle at 90% 80%, rgba(163, 177, 198, 0.3) 0%, rgba(163, 177, 198, 0) 20%);
}

/* Header */
header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-highlight);
  text-shadow: 1px 1px 2px var(--shadow-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.menu-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-color);
  box-shadow: 6px 6px 12px var(--shadow-dark),
    -6px -6px 12px var(--shadow-light);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.menu-btn:active {
  box-shadow: inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}

.menu-btn i {
  font-size: 1.2rem;
}

/* Main Content Area */
main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.slide-container {
  width: 98%;
  max-width: none;
  height: 92%;
  position: relative;
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
  transform-style: preserve-3d;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  border-radius: 30px;
  box-shadow: 20px 20px 60px var(--shadow-dark),
    -20px -20px 60px var(--shadow-light);
  padding: 60px;
  display: none;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.5s ease;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
}

.slide.active {
  display: flex;
  opacity: 1;
  transform: scale(1);
  z-index: 10;
}

/* Slide Content Layouts */
.slide-content {
  width: 100%;
  height: 100%;
  display: flex;
  gap: 30px;
}

.content-dashboard {
  flex-direction: column;
  overflow-y: auto;
  padding-right: 10px;
}

.content-section {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: inset 2px 2px 5px var(--shadow-dark),
    inset -2px -2px 5px var(--shadow-light);
}

.content-section h3 {
  color: var(--accent-color);
  font-size: 1.3rem;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 10px;
}

.content-section ul,
.content-section ol {
  padding-left: 20px;
}

.content-section li {
  margin-bottom: 8px;
}

.slide-content.cover {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.slide-content.split {
  flex-direction: row;
}

/* Chapter Slide Style */
.slide-content.chapter {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, rgba(240, 245, 250, 0.5) 100%);
  border-radius: 20px;
}

.chapter-number {
  font-size: 8rem;
  font-weight: 900;
  color: rgba(0, 123, 255, 0.1);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  font-family: 'Arial Black', sans-serif;
  letter-spacing: -5px;
}

.chapter-content-wrapper {
  z-index: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chapter-badge {
  background: var(--accent-gradient);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.chapter-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-highlight);
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(163, 177, 198, 0.4);
  background: linear-gradient(45deg, var(--text-highlight), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chapter-subtitle {
  font-size: 1.5rem;
  color: var(--text-main);
  font-weight: 400;
  margin-top: 5px;
  position: relative;
  display: inline-block;
}

.chapter-subtitle::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent-color);
  margin: 15px auto 0;
  border-radius: 2px;
}

.text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.image-col {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Typography */
h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-highlight);
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(163, 177, 198, 0.4);
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: var(--text-highlight);
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
  box-shadow: 2px 2px 4px var(--shadow-dark);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-main);
}

p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--text-main);
}

li {
  margin-bottom: 10px;
  line-height: 1.6;
}

/* Skeuomorphic Image Frame */
.image-frame {
  padding: 15px;
  background: var(--bg-color);
  border-radius: 20px;
  box-shadow: 8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  overflow: hidden;
  max-width: 100%;
}

.image-frame img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

/* Card Elements - Dashboard Style */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 20px;
}

.card {
  padding: 25px;
  background: var(--bg-color);
  border-radius: 15px;
  box-shadow: 8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  transition: transform 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 10px 10px 20px var(--shadow-dark),
    -10px -10px 20px var(--shadow-light);
}

.card h3,
.card h4 {
  color: var(--accent-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.card-content {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Controls */
.controls {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  z-index: 100;
  padding-bottom: 20px;
}

.nav-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--bg-color);
  box-shadow: 8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  color: var(--accent-color);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: #0056b3;
}

.nav-btn:active {
  box-shadow: inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
  transform: scale(0.95);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.progress-bar {
  width: 300px;
  height: 12px;
  background: var(--bg-color);
  border-radius: 6px;
  box-shadow: inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  border-radius: 6px;
  transition: width 0.3s ease;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(163, 177, 198, 0.5);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(163, 177, 198, 0.8);
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.menu-content {
  width: 400px;
  /* Increased from 300px for better fit */
  height: 100%;
  background: var(--bg-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  padding: 40px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.menu-overlay.active .menu-content {
  transform: translateX(0);
}

.menu-content h3 {
  margin-bottom: 30px;
  color: var(--accent-color);
  font-size: 1.5rem;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 15px;
}

#menuList {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding-right: 15px;
}

.menu-item {
  padding: 15px 20px;
  margin-bottom: 15px;
  border-radius: 12px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark),
    -5px -5px 10px var(--shadow-light);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-item:hover {
  transform: translateX(-5px);
  color: var(--accent-color);
}

.menu-item.active {
  box-shadow: inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
  color: var(--accent-color);
}

.menu-item:active {
  box-shadow: inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
  transform: translateX(0);
}

.close-menu-btn {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark),
    -5px -5px 10px var(--shadow-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff4757;
  transition: all 0.2s ease;
}

.close-menu-btn:active {
  box-shadow: inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
}

/* Hide underline for h2 on cover slide */
.slide-content.cover h2::after {
  display: none;
}

/* Cover Image Specifics */
.cover-image-frame {
  max-width: 1000px;
  width: 100%;
  margin-bottom: -50px;
  /* Pull content up */
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Arrow Pulse Animation */
@keyframes arrowPulse {

  0%,
  100% {
    opacity: 0.5;
    transform: translateX(0);
  }

  50% {
    opacity: 1;
    transform: translateX(5px);
  }
}

/* Global adjustment for split layout images */
.slide-content.split .image-frame {
  max-width: 85%;
  margin: 0 auto;
}