/* Settings Menu Styles */
.settings-icon-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.settings-icon {
  width: 30px;
  height: 30px;
  cursor: pointer;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.settings-icon:hover {
  transform: rotate(30deg);
}

/* Fallbacks for when the SVG image doesn't load */
.settings-icon-svg {
  cursor: pointer;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.settings-icon-svg:hover {
  transform: rotate(30deg);
}

.settings-icon-text {
  font-size: 24px;
  cursor: pointer;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-icon-text:hover {
  transform: rotate(30deg);
}

.settings-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  display: none;
  overflow: hidden;
  z-index: 101;
}

.settings-dropdown.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-dropdown-item {
  padding: 12px 16px;
  display: block;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s;
  cursor: pointer;
  font-size: 14px;
}

.settings-dropdown-item:hover {
  background-color: #f5f5f5;
}

.settings-dropdown-divider {
  height: 1px;
  background-color: #eee;
  margin: 4px 0;
}

.settings-dropdown-header {
  padding: 12px 16px;
  font-weight: bold;
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: #f9f9f9;
}

/* Settings Modal Styles - Glassmorphism Update */
.settings-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Slightly lighter overlay */
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
  pointer-events: none;
}

.settings-modal-overlay.active {
  opacity: 1;
  display: flex;
  pointer-events: auto;
}

.settings-modal-content {
  /* Glassmorphism Design */
  background-color: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  color: #1a1a1a;
  
  border-radius: 15px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.settings-modal-overlay.active .settings-modal-content {
  transform: translateY(0);
}

.settings-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #0066CC; /* Primary Blue */
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-modal-close:hover {
  transform: rotate(90deg);
  background: #004C99; /* Primary Dark */
}

.settings-modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #0066CC; /* Primary Blue */
  font-size: 28px;
  text-align: center;
  font-family: 'Cabin Sketch', cursive;
  text-shadow: none;
}

.settings-section {
  margin-bottom: 25px;
  background: rgba(0, 0, 0, 0.03); /* Very light grey for contrast on white */
  padding: 15px;
  border-radius: 10px;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.05);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.settings-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #1a1a1a;
  font-size: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 8px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  text-shadow: none;
}

.settings-option {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  background-color: rgba(255, 255, 255, 0.5);
  width: auto;
}

.settings-option:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.settings-option label {
  font-size: 16px;
  color: #1a1a1a;
  font-family: 'Quicksand', sans-serif;
  text-shadow: none;
  margin-right: 10px;
}

.settings-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.settings-save-btn {
  flex: 3;
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-shadow: none;
}

.settings-save-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.settings-reset-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #f3f4f6;
  color: #1f2933;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-shadow: none;
}

.settings-reset-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  margin-left: 10px;
  flex: none;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb; /* gray-200 */
  transition: .3s;
  border-radius: 24px;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 2px;
  background: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .toggle-slider {
  background: #10B981; /* Success Green */
}

input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

.toggle-slider:hover {
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
}

/* Dropdown Styling */
select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db; /* gray-300 */
  background-color: white;
  color: #1a1a1a;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%231a1a1a' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  max-width: 120px;
}

select:hover {
  border-color: #9ca3af; /* gray-400 */
}

select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2); /* Primary Blue transparent */
  border-color: #0066CC; /* Primary Blue */
}

select option {
  background-color: white;
  color: #1a1a1a;
  padding: 8px;
}

/* Remove magic background animation as it doesn't fit the clean style */
.settings-modal-overlay::before {
  display: none;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .settings-icon-container {
    top: 10px;
    right: 10px;
  }
  
  .settings-icon {
    width: 25px;
    height: 25px;
  }
  
  .settings-modal-content {
    padding: 20px;
  }
  
  .settings-modal-content h2 {
    font-size: 22px;
  }
  
  .settings-section h3 {
    font-size: 18px;
  }
  
  .settings-option label {
    font-size: 14px;
  }
  
  .settings-save-btn {
    font-size: 16px;
    padding: 10px;
  }
}
