/* Settings specific styles */

/* Settings wrap */
.settings-wrap {
  background: var(--bg);
  min-height: 100vh;
}

/* Hero section improvements */
.settings-hero {
  background: linear-gradient(135deg, rgb(15, 111, 75) 0%, rgb(12, 62, 24) 100%);
  position: relative;
  border-radius: 40px;
  margin: 0;
  min-height: 90vh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 48px;
  align-items: center;
  padding: clamp(40px, 8vw, 120px) clamp(24px, 6vw, 80px);
  overflow: hidden;
}

.settings-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(208, 161, 43, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.settings-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(12, 62, 24, 0.6));
  pointer-events: none;
}

.hero-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
}

.settings-hero .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.settings-hero h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.settings-hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 540px;
  margin: 0;
}

/* Quick settings cards */
.quick-settings {
  display: grid;
  gap: 14px;
  margin-top: 32px;
  width: 100%;
  max-width: 520px;
}

.quick-setting {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  cursor: pointer;
}

.quick-setting:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(6px);
  border-color: rgba(255, 255, 255, 0.25);
}

.quick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  font-size: 1.5em;
  color: #ffffff;
  flex-shrink: 0;
}

.quick-info {
  flex: 1;
  min-width: 0;
}

.quick-label {
  font-weight: 600;
  color: #ffffff;
  font-size: 1.05em;
  margin-bottom: 4px;
}

.quick-value {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88em;
}

.quick-action {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.quick-setting:hover .quick-action {
  background: rgba(255, 255, 255, 0.15);
}

/* Status display in hero card */
.hero-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card-inner.glass {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(30px);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 32px;
  padding: 32px;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.status-display {
  display: grid;
  gap: 28px;
}

.status-section {
  display: grid;
  gap: 10px;
}

.status-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.status-value {
  font-size: 2.8rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
}

.status-sublabel {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.status-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.status-progress {
  height: 100%;
  background: linear-gradient(90deg, #d0a12b 0%, #f9cd55 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(249, 205, 85, 0.5);
}

.status-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88em;
  line-height: 1.5;
  padding-top: 8px;
}

.status-note ion-icon {
  font-size: 1.3em;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Menu cards */
.menu-card {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(12, 62, 24, 0.08);
  border-radius: 28px;
  padding: 36px;
  margin: 24px clamp(24px, 6vw, 80px);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(12, 62, 24, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 80px rgba(12, 62, 24, 0.16);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.card-header > div {
  flex: 1;
}

.menu-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), rgba(12, 62, 24, 0.8));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6em;
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(12, 62, 24, 0.2);
}

.menu-card h2 {
  font-size: 1.75em;
  margin: 0 0 8px 0;
  color: var(--text);
  font-weight: 700;
}

.menu-card p {
  color: var(--muted);
  font-size: 1.05em;
  margin: 0;
  line-height: 1.6;
}

/* Theme selector grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.theme-option {
  cursor: pointer;
}

.theme-option input[type="radio"] {
  display: none;
}

.theme-card {
  background: var(--surface-soft);
  border: 2px solid rgba(12, 62, 24, 0.1);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-option:hover .theme-card {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(12, 62, 24, 0.15);
}

.theme-option input[type="radio"]:checked + .theme-card {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring), 0 12px 30px rgba(12, 62, 24, 0.2);
  transform: scale(1.02);
}

.theme-preview {
  height: 100px;
  position: relative;
  overflow: hidden;
}

.light-preview {
  background: linear-gradient(135deg, #f9fbf6 0%, #ffffff 100%);
}

.dark-preview {
  background: linear-gradient(135deg, #1a2e1f 0%, #0f1e13 100%);
}

.sepia-preview {
  background: linear-gradient(135deg, #f7efe1 0%, #f0e3ca 100%);
}

.theme-sample {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 8px;
  background: rgba(12, 62, 24, 0.15);
  border-radius: 4px;
}

.theme-sample::before,
.theme-sample::after {
  content: "";
  position: absolute;
  height: 4px;
  background: rgba(12, 62, 24, 0.2);
  border-radius: 2px;
}

.theme-sample::before {
  top: 16px;
  left: 0;
  width: 60%;
}

.theme-sample::after {
  top: 28px;
  left: 0;
  width: 80%;
}

.dark-preview .theme-sample {
  background: rgba(255, 255, 255, 0.2);
}

.dark-preview .theme-sample::before,
.dark-preview .theme-sample::after {
  background: rgba(255, 255, 255, 0.15);
}

.sepia-preview .theme-sample {
  background: rgba(138, 95, 26, 0.2);
}

.sepia-preview .theme-sample::before,
.sepia-preview .theme-sample::after {
  background: rgba(138, 95, 26, 0.15);
}

.theme-info {
  padding: 16px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.theme-info ion-icon {
  font-size: 1.8em;
  color: var(--primary);
  margin: 0 auto 4px;
}

.theme-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1.05em;
}

.theme-desc {
  font-size: 0.85em;
  color: var(--muted);
}

/* Slider improvements */
.slider-container {
  display: grid;
  gap: 12px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

.slider-label {
  font-size: 0.85em;
  color: var(--muted);
  font-weight: 500;
}

.slider-wrapper {
  position: relative;
}

.modern-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to right, 
    rgba(12, 62, 24, 0.08) 0%, 
    rgba(12, 62, 24, 0.12) 100%);
  outline: none;
  border: 1px solid rgba(12, 62, 24, 0.08);
  cursor: pointer;
}

.modern-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--primary), rgba(12, 62, 24, 0.9));
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(12, 62, 24, 0.3);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(12, 62, 24, 0.4);
}

.modern-range::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

.modern-range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--primary), rgba(12, 62, 24, 0.9));
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(12, 62, 24, 0.3);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  background: rgba(12, 62, 24, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(12, 62, 24, 0.08);
}

.slider-value span {
  font-weight: 700;
  font-size: 1.4em;
  color: var(--primary);
}

.slider-unit {
  font-size: 0.9em !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
}

/* Select styling */
.select-wrapper {
  display: grid;
  gap: 8px;
}

.input-label {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text);
}

.modern-select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  border-radius: 16px;
  border: 2px solid rgba(12, 62, 24, 0.12);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 1.05em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230c3e18'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}

.modern-select:hover {
  background-color: rgba(12, 62, 24, 0.02);
  border-color: rgba(12, 62, 24, 0.2);
}

.modern-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
  background-color: #ffffff;
}

.modern-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: rgba(12, 62, 24, 0.04);
}

/* Toggle option */
.toggle-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface-soft);
  border: 2px solid rgba(12, 62, 24, 0.12);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-option:hover {
  background: rgba(12, 62, 24, 0.02);
  border-color: rgba(12, 62, 24, 0.2);
}

.toggle-option input[type="checkbox"] {
  display: none;
}

.toggle-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 62, 24, 0.08);
  border-radius: 12px;
  color: var(--primary);
  font-size: 1.4em;
  flex-shrink: 0;
}

.toggle-text {
  display: grid;
  gap: 4px;
}

.toggle-label {
  font-weight: 600;
  color: var(--text);
  font-size: 1.05em;
}

.toggle-desc {
  font-size: 0.88em;
  color: var(--muted);
}

.toggle-switch {
  position: relative;
  width: 56px;
  height: 32px;
  background: rgba(12, 62, 24, 0.15);
  border-radius: 999px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.toggle-switch::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-option input[type="checkbox"]:checked ~ .toggle-switch {
  background: var(--primary);
}

.toggle-option input[type="checkbox"]:checked ~ .toggle-switch::before {
  transform: translateX(24px);
}

/* Preview areas */
.preview {
  background: var(--surface-soft);
  border: 2px solid rgba(12, 62, 24, 0.12);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview:hover {
  background: rgba(12, 62, 24, 0.02);
  border-color: rgba(12, 62, 24, 0.2);
}

.arabic-preview {
  font-family: 'Amiri Quran', serif;
  direction: rtl;
  line-height: 1.8;
  color: var(--text);
}

.translation-preview {
  line-height: 1.7;
  color: var(--text-dim);
}

/* Sync status box */
.sync-status-box {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--surface-soft);
  border: 2px solid rgba(12, 62, 24, 0.12);
  border-radius: 18px;
}

.sync-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 62, 24, 0.08);
  border-radius: 16px;
  color: var(--muted);
  font-size: 2em;
  flex-shrink: 0;
}

.sync-icon.connected {
  background: rgba(16, 185, 129, 0.12);
  color: rgb(16, 185, 129);
}

.sync-info {
  flex: 1;
  display: grid;
  gap: 4px;
}

.sync-label {
  font-weight: 700;
  font-size: 1.2em;
  color: var(--text);
}

.sync-desc {
  font-size: 0.9em;
  color: var(--muted);
  line-height: 1.5;
}

/* Sync features */
.sync-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 20px;
  background: rgba(12, 62, 24, 0.02);
  border-radius: 16px;
}

.sync-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95em;
  color: var(--text);
}

.sync-feature ion-icon {
  font-size: 1.3em;
  color: var(--primary);
  flex-shrink: 0;
}

/* Sync actions */
.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Menu meta */
.menu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.menu-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(12, 62, 24, 0.06);
  border: 1px solid rgba(12, 62, 24, 0.1);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.menu-meta ion-icon {
  font-size: 1.15em;
  --ionicon-stroke-width: 52px;
}

/* Stack layout */
.stack {
  display: grid;
  gap: 20px;
}

/* Row layout */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
  .settings-hero {
    grid-template-columns: 1fr;
    padding: 60px 24px;
  }
  
  .settings-hero h2 {
    font-size: 2.5rem;
  }
  
  .menu-card {
    padding: 28px 24px;
    margin: 20px 20px;
  }
  
  .card-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .theme-grid {
    grid-template-columns: 1fr;
  }
  
  .sync-features {
    grid-template-columns: 1fr;
  }
}

/* Dark theme support */
body[data-theme="dark"] .menu-card {
  background: rgba(20, 20, 20, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

body[data-theme="dark"] .menu-card h2 {
  color: #ffffff;
}

body[data-theme="dark"] .menu-card p {
  color: rgba(255, 255, 255, 0.7);
}

body[data-theme="dark"] .modern-select,
body[data-theme="dark"] .toggle-option,
body[data-theme="dark"] .sync-status-box,
body[data-theme="dark"] .preview {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

body[data-theme="dark"] .slider-value {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .slider-value span {
  color: rgba(255, 255, 255, 0.9);
}

body[data-theme="dark"] .theme-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .toggle-icon,
body[data-theme="dark"] .sync-icon {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

body[data-theme="dark"] .toggle-label,
body[data-theme="dark"] .sync-label {
  color: #ffffff;
}

body[data-theme="dark"] .toggle-desc,
body[data-theme="dark"] .sync-desc,
body[data-theme="dark"] .slider-label,
body[data-theme="dark"] .input-label,
body[data-theme="dark"] .theme-desc {
  color: rgba(255, 255, 255, 0.6);
}

body[data-theme="dark"] .menu-meta span {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

body[data-theme="dark"] .sync-feature {
  color: rgba(255, 255, 255, 0.9);
}

body[data-theme="dark"] .modern-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Dark theme page background */
body[data-theme="dark"] .settings-wrap {
  background: var(--bg);
}

/* Sepia theme support */
body[data-theme="sepia"] .settings-wrap {
  background: var(--bg);
}