/**************************************************************
 * Filename: styles.css
 * Description: Revamped CSS for Remembr with a modern, pastel-based,
 *              flat, minimalist design and refined transitions.
 **************************************************************/

/* Reset & Basic Setup */
*, *:before, *:after {
  box-sizing: border-box;
}

/* 1) Reset & Basic Setup */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  font-family: 'Inter', sans-serif;
  color:var(--text-color);
}

body {
  display: flex;
  flex-direction: column;
  background: var(--container-bg-gradient);
  transition: background-color 0.3s, color 0.3s;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Theme Variables */
:root {
  --bg-color: #F5F7FA;
  --text-color: #333;
  --accent-color: #5A6B7D;
  --nav-icon-color: #333;
  --button-text-color: #fff;
  --button-bg-color: #4A90E2;
  --progress-bg: #E0E0E0;
  --progress-fill-bg: #FFFFFF; /* White for the inside fill */
  --progress-fill-start: #34C759; /* Lighter green (start) */
  --progress-fill-end: #28A745; /* Darker green (end) */
  --shadow-color: rgba(0, 0, 0, 0.1);
  --container-bg-gradient: linear-gradient(145deg, #e5f0f8, #b8d4f0);
  --danger-button: #FF6B6B;
  --required-color: red; /* For .required */
  --border-color: #E0E0E0; /* For borders (navbar, screen header, slideshow header) */
  --hint-color: #666; /* For .hint */
  --image-border-color: #ddd; /* For .memory-card img and #photo-preview-container */
  --photo-preview-bg: #f9f9f9; /* For #photo-preview-container background */
  --input-border-color: #ccc; /* For input/textarea borders */
  --dropdown-border-color: rgba(0, 0, 0, 0.1); /* For dropdown option borders */
  --dropdown-hover-bg: rgba(0, 0, 0, 0.05); /* For dropdown option hover */
  --dropdown-active-bg: rgba(0, 0, 0, 0.1); /* For dropdown option active */
  --svg-fill-color: #4A90E2; /* For .svg-placeholder path */
  --feedback-correct-bg: #d4edda; /* For .learn-feedback.correct background */
  --feedback-correct-text: #155724; /* For .learn-feedback.correct text */
  --feedback-incorrect-bg: #f8d7da; /* For .learn-feedback.incorrect background */
  --feedback-incorrect-text: #721c24; /* For .learn-feedback.incorrect text */
  --incorrect-tag-bg: #FF9999; /* For .incorrect-tag background */
  --incorrect-tag-text: #fff; /* For .incorrect-tag text */
  --inner-shadow-color: rgba(0, 0, 0, 0.05); /* For .progress-wrapper inner shadow */
  --disabled-button-bg: #ccc; /* For .disabled-button background */
  --disabled-button-text: #888; /* For .disabled-button text */
}

.dark-theme {
  --bg-color: #2A2A2A;
  --text-color: #f4f4f4;
  --accent-color: #444;
  --nav-icon-color: #fff;
  --button-text-color: #fff;
  --button-bg-color: #4A90E2;
  --progress-bg: #444;
  --progress-fill-bg: #333;
  --progress-fill-start: #4A90E2;
  --progress-fill-end: #8dc2f7;
  --shadow-color: rgba(255, 255, 255, 0.15);
  --container-bg-gradient: linear-gradient(145deg, #2A2A2A, #1C1C1C);
  --danger-button: #E57373;
  --required-color: #FF6B6B;
  --border-color: #4A5568;
  --hint-color: #A3BFFA;
  --image-border-color: #4A5568;
  --photo-preview-bg: #2D3748;
  --input-border-color: #4A5568;
  --dropdown-border-color: rgba(255, 255, 255, 0.15);
  --dropdown-hover-bg: rgba(255, 255, 255, 0.15);
  --dropdown-active-bg: rgba(255, 255, 255, 0.2);
  --svg-fill-color: #63B3ED;
  --feedback-correct-bg: #2C7A7B;
  --feedback-correct-text: #B2F5EA;
  --feedback-incorrect-bg: #9B2C2C;
  --feedback-incorrect-text: #FECACA;
  --incorrect-tag-bg: #9B2C2C;
  --incorrect-tag-text: #FECACA;
  --inner-shadow-color: rgba(0, 0, 0, 0.4);
  --disabled-button-bg: #4A5568;
  --disabled-button-text: #A3BFFA;
}

/* Dark Theme Overrides for Memory Cards */
.dark-theme .memory-card{
  background: #23446b; /* Lighter than the screen background for contrast */
  box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3); /* More pronounced shadow */
}

.dark-theme .collection-card{
  background: #23446b; /* Lighter than the screen background for contrast */
  box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3); /* More pronounced shadow */
}

.dark-theme .memory-card:hover {
  box-shadow: 0 6px 14px rgba(74, 144, 226, 0.4); /* Stronger shadow on hover */
}

.dark-theme .memory-card img {
  border: 3px solid var(--image-border-color); /* Consistent with dark theme variable */
}

.custom-theme {
  --bg-color: #F5F7FA;
  --text-color: #333;
  --accent-color: #5A6B7D;
  --nav-icon-color: #333;
  --button-text-color: #fff;
  --button-bg-color: #BBDFFF;
  --progress-bg: #E0E0E0;
  --progress-fill-bg: #FFFFFF; /* White for custom theme */
  --progress-fill-start: #4A90E2;
  --progress-fill-end: #A3CFFA;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --container-bg-gradient: linear-gradient(145deg, #ffffff, #E8ECEF);
  --danger-button: #FF6B6B; /* Same as light theme */
  --required-color: red;
  --border-color: #E0E0E0;
  --hint-color: #666;
  --image-border-color: #ddd;
  --photo-preview-bg: #f9f9f9;
  --input-border-color: #ccc;
  --dropdown-border-color: rgba(0, 0, 0, 0.1);
  --dropdown-hover-bg: rgba(0, 0, 0, 0.05);
  --dropdown-active-bg: rgba(0, 0, 0, 0.1);
  --svg-fill-color: #BBDFFF; /* Match button-bg-color */
  --feedback-correct-bg: #d4edda;
  --feedback-correct-text: #155724;
  --feedback-incorrect-bg: #f8d7da;
  --feedback-incorrect-text: #721c24;
  --incorrect-tag-bg: #FF9999;
  --incorrect-tag-text: #fff;
  --inner-shadow-color: rgba(0, 0, 0, 0.05);
  --disabled-button-bg: #ccc;
  --disabled-button-text: #888;
}

/* Utility classes */
.hidden {
  display: none;
  visibility: hidden;
}

.required {
  color: var(--required-color);
}

#app-title {
  font-size: clamp(1.5rem, 4vw, 2rem); /* Responsive font size */
  color: #fff; /* Kept as #fff since it's part of the top navbar design */
  margin: 0.25rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1; /* Allow shrinking if needed */
}

/* Allow wrapping on very small screens */
@media (max-width: 400px) {
  #app-title {
    white-space: normal;
    text-overflow: initial;
    overflow: visible;
  }
}

.app-title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem; /* Reduced gap */
  overflow: hidden;
  box-sizing: border-box;
}

.app-logo {
  flex-shrink: 0;
  width: 3rem; /* Reduced logo size */
  height: 3rem;
}

/**************************************************************
* 2) Global Buttons
**************************************************************/
button {
  border: none;
  border-radius: 12px; /* More rounded corners */
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  color: var(--button-text-color);
  background-color: var(--button-bg-color);
  box-shadow: 0 2px 4px var(--shadow-color);
}

button:hover {
  opacity: 0.9;
  box-shadow: 0 4px 8px var(--shadow-color);
}

button:active {
  transform: scale(0.98);
}

/* Primary button */
.primary-button {
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
}

/* Secondary button */
.secondary-button {
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
}

/* Danger button */
.danger-button {
  background-color: var(--danger-button);
  color: var(--button-text-color); /* Updated to use theme variable */
  box-shadow: 0 2px 4px var(--shadow-color);
}

.dark-theme .danger-button {
  background-color: var(--danger-button);
}

.danger-button:hover {
  opacity: 0.9;
  box-shadow: 0 4px 8px var(--shadow-color);
}

/**************************************************************
* 3) Navbar (Top & Bottom)
**************************************************************/
#top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5rem;
  background-color: var(--accent-color);
  z-index: 100;
  padding: 0 1rem;
  box-sizing: border-box;
}

.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#app-title {
  font-size: 2rem;
  color: #fff; /* Kept as #fff since it's part of the top navbar design */
  margin: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.collections-container {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0;
}

#collection-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-color);

}

/* Bottom Navbar */
#bottom-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3.5rem;
  background: var(--container-bg-gradient);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  color: var(--nav-icon-color);
  box-shadow: 0 -2px 4px var(--shadow-color);
  max-width: 100vw;
  box-sizing: border-box;
}

body.light-theme #bottom-navbar button {
  color: var(--nav-icon-color);
}

/**************************************************************
* 4) Screens & Layout
**************************************************************/
.screen {
  position: fixed;
  top: 5rem;
  bottom: 3.5rem;
  left: 0;
  right: 0;
  height: calc(100vh - 8.5rem);
  height: calc(100 * var(--vh, 1vh) - 8.5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

#collection-detail-screen {
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

.screen.active {
  display: block;
  z-index: 10;
}

/* Screen header */
.screen-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--container-bg-gradient);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px var(--shadow-color);
}

.screen-header .detail-title {
  flex: 1;
  text-align: center;
  color: var(--text-color);
}

/* Animations */
@keyframes slideRightEnter {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideLeftEnter {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}
.slide-right-enter { animation: slideRightEnter 0.3s forwards; }
.slide-left-enter { animation: slideLeftEnter 0.3s forwards; }
.fade-enter { animation: fadeEnter 0.3s forwards; }

/**************************************************************
* 5) Home Screen
**************************************************************/
.home-content {
  text-align: center;
  margin: 0 auto;
  padding: 1rem;
  background: var(--container-bg-gradient);
  border-radius: 12px;
  box-shadow: 0 4px 8px var(--shadow-color);
}

.home-welcome {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* New Collection button in light theme */
body.light-theme .home-create-btn {
  color: var(--button-text-color);
  background-color: var(--button-bg-color);
}

.home-create-btn {
  font-size: 1.1rem;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.hint {
  color: var(--hint-color);
  margin-top: 1rem;
  font-size: 0.95rem;
}

/**************************************************************
* 6) Collections Grid (Home)
**************************************************************/
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 1rem;
}

@media (max-width: 767px) {
  .collections-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .collections-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .collections-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}

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

  border: none;
  border-radius: 12px;
  text-align: center;
  margin: 0 auto;
  width: 8rem;
  height: 8rem; /* Increased to accommodate square thumbnail */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px var(--shadow-color);
    color: var(--text-color);

}

.collection-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px var(--shadow-color);
}

.collection-thumbnail {
  display: inline-block; /* Ensure dimensions are respected */
  width: 3rem !important; /* Override inline styles */
  height: 3rem !important;
  object-fit: cover;
  margin-bottom: 0.25rem;
  border-radius: 8px;
}

/* Override width and height attributes if present */
.collection-thumbnail[width],
.collection-thumbnail[height] {
  width: 3rem !important;
  height: 3rem !important;
}

.collection-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

/**************************************************************
* 7) Memory Grid (Detail Screen)
**************************************************************/
.memories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
  justify-content: center;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  padding-bottom: 5rem;
}

.memory-card {
  background: var(--bg-color);
  border-radius: 12px;
  box-shadow: 0 2px 4px var(--shadow-color);
  text-align: center;
  padding: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 9rem;
  box-sizing: border-box;
    color: var(--text-color);

}

.memory-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px var(--shadow-color);
}

.memory-card img {
  width: 100%;
  height: 6.5rem;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border: 3px solid var(--image-border-color);
}

.memory-card .memory-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  text-align: center;
  margin-top: 0.5rem;
}

/**************************************************************
* 8) Edit Memory Screen
**************************************************************/
.edit-memory-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
}

.edit-memory-screen .screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 1rem;
}

.edit-memory-screen .screen-header h2 {
  margin: 0;
}

.memory-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 90vw; /* 90% of the viewport width */
  width: 100%;
  background: var(--container-bg-gradient);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px var(--shadow-color);
  margin: 0 auto;
  overflow-y: auto;
}

.memory-form .field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.memory-form .field-group label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.photo-area {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

#photo-preview-container {
  width: 8rem;
  height: 8rem;
  border: 3px solid var(--image-border-color);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--photo-preview-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/**************************************************************
* 9) New Collection Screen
**************************************************************/
.new-collection-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  min-height: calc(100vh - 8.5rem);
  box-sizing: border-box;
  overflow-y: auto;
}

.new-collection-screen .screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  margin-bottom: 1rem;
}

.new-collection-screen .screen-content {
  box-sizing: border-box;
  padding-bottom: 5rem; /* ensure space above bottom nav */
  overflow-x: hidden;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1rem;
  gap: 1.5rem;
  background: var(--container-bg-gradient);
  border-radius: 12px;
  box-shadow: 0 4px 8px var(--shadow-color);
  margin: 0 auto;
}

.screen-content {
  width: 100%;
}

.new-collection-screen .screen-content label,
.new-collection-screen .screen-content h3 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.new-collection-screen .screen-content input,
.new-collection-screen .screen-content textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--input-border-color);
  border-radius: 6px;
  box-sizing: border-box;
}

.new-collection-screen .screen-content input:focus,
.new-collection-screen .screen-content textarea:focus {
  border-color: var(--accent-color);
  outline: none;
}

.new-collection-screen .action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.new-collection-screen .action-buttons button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 12px;
  cursor: pointer;
  border: none;
}

/**************************************************************
* 10) Settings Screen
**************************************************************/
.settings-screen {
  overflow-y: auto;
  min-height: calc(100vh - 8.5rem);
  box-sizing: border-box;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 90vw; /* 90% of the viewport width */
  margin: 1rem auto;
  background: var(--container-bg-gradient);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 8px var(--shadow-color);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.setting-item label {
  font-weight: 600;
  margin-right: 1rem;
  min-width: 4rem;
}

/* Theme Dropdown */
.theme-dropdown {
  position: relative;
  width: 10rem; /* Fixed width for consistency */
}

/* Dropdown Trigger */
#theme-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 2px 4px var(--shadow-color);
  transition: all 0.2s ease;
  position: relative;
}

/* Add a chevron icon using a pseudo-element */
#theme-dropdown-trigger::after {
  content: '▼';
  font-size: 0.8rem;
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

/* Rotate the chevron when the dropdown is open */
#theme-dropdown-trigger.active::after {
  transform: rotate(180deg);
}

#theme-dropdown-trigger:hover {
  opacity: 0.9;
  box-shadow: 0 4px 8px var(--shadow-color);
}

#theme-dropdown-trigger:active {
  transform: scale(0.98);
}

/* Dropdown Options */
#theme-dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--container-bg-gradient);
  border-radius: 12px;
  box-shadow: 0 4px 8px var(--shadow-color);
  z-index: 10;
  margin-top: 0.5rem;
  padding: 0;
  list-style: none;
  overflow: hidden;
  max-height: 0; /* Start closed */
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

/* Open state */
#theme-dropdown-options:not(.hidden) {
  max-height: 12rem; /* Enough for 3 options */
  opacity: 1;
  visibility: visible;
}

/* Option Items */
#theme-dropdown-options li {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  border-bottom: 1px solid var(--dropdown-border-color);
}

/* Remove border from the last item */
#theme-dropdown-options li:last-child {
  border-bottom: none;
}

#theme-dropdown-options li:hover {
  background-color: var(--dropdown-hover-bg);
  transform: scale(1.02);
}

#theme-dropdown-options li:active {
  background-color: var(--dropdown-active-bg);
  transform: scale(0.98);
}

/* Adjust for dark theme */
.dark-theme #theme-dropdown-options {
  /* Removed hardcoded gradient, already set in --container-bg-gradient */
}

.dark-theme #theme-dropdown-options li {
  color: var(--text-color);
}

.dark-theme #theme-dropdown-options li:hover {
  background-color: var(--dropdown-hover-bg);
}

.dark-theme #theme-dropdown-options li:active {
  background-color: var(--dropdown-active-bg);
}

/* Adjust for custom (pastel) theme */
.custom-theme #theme-dropdown-options {
  /* Removed hardcoded gradient, already set in --container-bg-gradient */
}

/**************************************************************
* 11) Manage Collection Screen
**************************************************************/
.manage-collection-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 90vw; /* 90% of the viewport width */
  margin: 1rem auto;
  background: var(--container-bg-gradient);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 8px var(--shadow-color);
}

.collection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/**************************************************************
* 12) Slideshow Screen
**************************************************************/
#slideshow-screen {
  display: flex;
  flex-direction: column;
  background: var(--container-bg-gradient);
  height: 100%;
}

.slideshow-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--container-bg-gradient);
  border-bottom: 1px solid var(--border-color);
}

.slideshow-header .detail-title {
  flex: 1;
  text-align: center;
}

.slideshow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem;
  background: var(--container-bg-gradient);
  margin: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 8px var(--shadow-color);
  flex: 1;
}

#slideshow-image {
  height: 20em;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

#slideshow-clue {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-color);
}

.slideshow-buttons {
  display: flex;
  justify-content: space-between;
  width: 80%;
  margin-top: 3%;
}

.slideshow-buttons button {
  flex: 1;
  margin: 0 0.5rem;
}

/* Disabled button style */
button.disabled-button {
  background-color: var(--disabled-button-bg) !important;
  color: var(--disabled-button-text) !important;
  cursor: default !important;
}

/**************************************************************
* 13) Learn Screen
**************************************************************/
#learn-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Background removed; let .screen handle it */
}

.learn-container {
  display: flex;
  flex-direction: row;
  padding: 1rem;
  margin: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 8px var(--shadow-color);
  flex: 1;
  gap: 1rem;
  /* Background removed; let .screen handle it */
}

.learn-progress-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 13rem;
  gap: 1rem;
}

#learn-progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.progress-wrapper {
  position: relative;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  /* Removed background */
  box-shadow: 0 4px 8px var(--shadow-color), inset 0 2px 4px var(--inner-shadow-color);
  transition: transform 0.3s ease;
}

.progress-wrapper.updated {
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

#progress-circle {
  transform: rotate(-90deg);
}

.progress-bg {
  stroke: var(--progress-bg);
  opacity: 0.3;
}

#progress-circle-fill {
  stroke: var(--progress-fill-start); /* Use the start color directly */
  transition: stroke-dasharray 0.5s ease-in-out;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  text-shadow: 0 1px 2px var(---shadow-color);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60%;
  height: 60%;
  line-height: 1;
  border-radius: 50%;
}

#feedback {
  white-space: pre-line;
}

.progress-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  text-align: center;
}

.learn-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
}

#learn-image {
  height: 15em;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.svg-placeholder path {
  fill: var(--svg-fill-color);
}

.learn-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 80%;
  margin-bottom: 1rem;
}

.learn-options button {
  padding: 0.75rem;
  font-size: 1rem;
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.learn-options button:hover {
  opacity: 0.9;
  box-shadow: 0 4px 8px var(--shadow-color);
}

.learn-feedback {
  font-size: 1.2rem;
  text-align: center;
  padding: 0.5rem;
  border-radius: 12px;
  width: 80%;
}

.learn-feedback.correct {
  background-color: var(--feedback-correct-bg);
  color: var(--feedback-correct-text);
}

.learn-feedback.incorrect {
  background-color: var(--feedback-incorrect-bg);
  color: var(--feedback-incorrect-text);
}

.incorrect-answers {
  width: 100%;
  text-align: center;
}

.incorrect-answers h3 {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.incorrect-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.incorrect-tag {
  background-color: var(--incorrect-tag-bg);
  color: var(--incorrect-tag-text);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 2px 4px var(--shadow-color);
}

/**************************************************************
* 14) Trophy Screen
**************************************************************/
#trophy-screen {
  display: flex;
  flex-direction: column;
  background: var(--container-bg-gradient);
  height: 100%;
}

.trophy-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--container-bg-gradient);
  margin: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 8px var(--shadow-color);
  flex: 1;
}

#trophy-icon {
  margin-bottom: 1rem;
}

.trophy-container p {
  font-size: 1.5rem;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 2rem;
}

#trophy-return-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
}

.import-file-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}