/* Settings Modal Styles */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.settings-modal-content {
  background-color: var(--card-bg, #fff);
  border-radius: var(--border-radius, 12px);
  box-shadow: var(--card-shadow, 0 8px 16px rgba(0, 0, 0, 0.2));
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: fadeIn 0.3s;
}

.settings-modal-header {
  position: sticky;
  top: 0;
  background-color: var(--primary-color, #e0a628);
  color: white;
  padding: 16px 20px;
  border-top-left-radius: var(--border-radius, 12px);
  border-top-right-radius: var(--border-radius, 12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

.settings-modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 500;
}

.settings-modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
}

.settings-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.settings-modal-body {
  padding: 20px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--text-color, #333);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.settings-item {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-item span {
  color: var(--text-color, #333);
  font-weight: 500;
}

/* Toggle Switch */
.settings-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.settings-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .settings-slider {
  background-color: var(--primary-color, #1e88e5);
}

input:focus + .settings-slider {
  box-shadow: 0 0 1px var(--primary-color, #1e88e5);
}

input:checked + .settings-slider:before {
  transform: translateX(22px);
}

/* Select styles */
.settings-select {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-color, #e0e0e0);
  background-color: var(--card-bg, #fff);
  color: var(--text-color, #333);
  min-width: 150px;
}

/* Range slider styles */
.settings-range {
  width: 100%;
  margin-top: 8px;
}

.range-value {
  display: inline-block;
  width: 40px;
  text-align: center;
  margin-left: 8px;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Radio buttons */
.settings-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.settings-radio-label {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 4px;
  cursor: pointer;
}

.settings-radio-label input {
  margin-right: 8px;
}

.settings-radio-label:has(input:checked) {
  background-color: rgba(30, 136, 229, 0.1);
  border-color: var(--primary-color, #1e88e5);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.settings-button {
  background-color: var(--primary-color, #e0a628);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.settings-button:hover {
  background-color: var(--primary-dark, #b88620);
}

.settings-button.secondary {
  background-color: transparent;
  color: var(--text-color, #333);
  border: 1px solid var(--border-color, #e0e0e0);
}

.settings-button.secondary:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* RTL Support */
[dir="rtl"] .settings-close {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .settings-radio-label input {
  margin-right: 0;
  margin-left: 8px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .settings-item-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .settings-switch, .settings-select {
    margin-top: 8px;
  }
  
  .settings-title {
    font-size: 1.1rem;
  }
  
  .settings-container {
    max-height: 92vh;
  }
}