/* --- Global Styles & Variables --- */
:root {
  --primary-color: #673ab7; /* Deep purple (kept for variables, but mostly overridden by glass styles) */
  --primary-light: #d1c4e9;
  --accent-color: #ff9800; /* Vibrant orange for buttons */
  --accent-hover: #f57c00;
  --text-color: #333;
  --white-color: #ffffff;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  /* --- Background Image Settings --- */
  background-image: url('assets/background.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  color: var(--text-color);
  margin: 0;
  padding: 40px 20px;
  line-height: 1.6;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  background: transparent; /* See-through container */
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

/* --- Header Toolbar (Glass Theme) --- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 30px;
  
  /* Glassmorphism Effect */
  background-color: rgba(20, 30, 60, 0.85);
  border: 1px solid rgba(100, 200, 255, 0.3);
  backdrop-filter: blur(10px); /* Adds a nice blur to background behind it */
  
  color: var(--white-color);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  margin-bottom: 40px;
}

/* Title Style (Glowing) */
.toolbar h2 {
  margin: 0;
  font-size: 1.8em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a0e1ff; /* Bright Cyan */
  text-shadow: 0 0 15px rgba(0, 200, 255, 0.5); /* Glow effect */
}

/* Icon spacing */
.toolbar h2 i,
.lesson .title i,
.btn i {
  margin-right: 6px;
}

/* Sort & Search Containers */
.sorter,
.search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

/* Inputs */
.sorter select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(100, 200, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
}

.search input {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(100, 200, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.9);
  min-width: 220px;
  color: #333;
}

.search-status {
  font-size: 0.9em;
  font-style: italic;
  opacity: 0.9;
  color: #a0e1ff;
}

/* --- Main Content Grid --- */
main {
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

/* --- Buttons --- */
.btn {
  background-color: var(--accent-color);
  color: var(--white-color);
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn:hover:not(:disabled) {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4); /* Orange glow on hover */
}

.btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

/* --- Lesson Card Styles (Glass Theme) --- */
.lesson {
  /* Glassmorphism Dark Blue */
  background-color: rgba(20, 30, 60, 0.85);
  border: 1px solid rgba(100, 200, 255, 0.3);
  color: #ffffff;
  
  padding: 20px;
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.lesson:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(100, 200, 255, 0.4);
  border-color: rgba(100, 200, 255, 0.8);
}

/* Title Style (Bright Cyan + Glow) */
.lesson .title {
  font-weight: 700;
  font-size: 1.3em;
  color: #a0e1ff; 
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon Color */
.lesson .title i {
  color: #ffd700; /* Gold icon */
}

/* Meta Text (Bright White) */
.lesson .meta {
  color: #ffffff;
  font-size: 1.1em;
  font-weight: 500;
  margin-bottom: 20px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* --- Cart & Checkout View --- */
main.cart-view {
  display: block;
  background: var(--white-color);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  /* Keep cart view white/clean for readability during checkout */
}

.cart-view h3 {
  margin-top: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
}

.cart-list {
  padding: 0;
  margin: 0;
}

.cart-list li {
  list-style: none;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #333;
}

.cart-total {
  font-weight: 700;
  font-size: 1.1em;
  text-align: right;
  margin-top: 10px;
  color: #333;
}

/* Checkout Form */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 30px 0;
}

.field {
  display: block;
  margin-bottom: 16px;
  color: #333;
}

.field input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-top: 6px;
}

.field-error {
  color: #d32f2f;
  font-size: 0.9em;
  margin-top: 4px;
}

.field-hint {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
}

#confirmation-message {
  margin-top: 16px;
  font-weight: 600;
  color: #2e7d32;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .sorter,
  .search {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search input {
    width: 100%;
  }

  main {
    gap: 20px;
    grid-template-columns: 1fr;
  }

  main.cart-view {
    padding: 20px;
  }
}
