/* ── NORA — Stats, Settings & Controls ─────────────── */

/* ── Stats ───────────────────────────────────────────── */
.stats-card {
  background: rgba(30, 30, 60, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.stats-card h3 { font-size: var(--text-sm); color: var(--hint); margin-bottom: 8px; }
.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: var(--text-base);
}
.stats-row .label { color: var(--hint); }
.stats-bar-bg {
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}
.stats-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--success), #6c5ce7);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 6px rgba(0, 204, 136, 0.3);
}

/* ── Settings ────────────────────────────────────────── */
.settings-section {
  background: rgba(30, 30, 60, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.settings-section h3 {
  font-size: var(--text-sm);
  color: var(--hint);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#style-picker, #reminder-profile-picker { display: flex; flex-direction: column; gap: 8px; }

/* ── Styled Dropdown (card-like) ─────────────────────── */
.styled-dropdown { position: relative; width: 100%; }
.sd-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: rgba(30, 30, 60, 0.7);
  cursor: pointer;
  transition: border-color 0.2s;
}
.styled-dropdown.open .sd-trigger { border-color: var(--btn-bg); }
.sd-trigger-content { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sd-trigger-label { font-weight: 600; font-size: 0.9rem; color: var(--fg); }
.sd-trigger-desc { font-size: 0.75rem; color: var(--hint); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-arrow { font-size: 0.9rem; color: var(--hint); transition: transform 0.2s; flex-shrink: 0; margin-left: 8px; }
.styled-dropdown.open .sd-arrow { transform: rotate(180deg); }
.sd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 50;
  background: rgba(22, 22, 48, 0.92);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
}
.sd-menu.hidden { display: none; }
.sd-option {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}
.sd-option:last-child { border-bottom: none; }
.sd-option:hover { background: rgba(255,255,255,0.05); }
.sd-option.active {
  border-left: 3px solid var(--btn-bg);
  background: color-mix(in srgb, var(--btn-bg) 12%, var(--secondary-bg));
}
.sd-option-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.sd-option.active .sd-option-label { color: var(--btn-bg); }
.sd-option-desc { font-size: 0.75rem; color: var(--hint); line-height: 1.35; }

.settings-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass-bg-strong);
  color: var(--fg);
  font-size: var(--text-base);
  cursor: pointer;
  appearance: auto;
}
.settings-select:focus { border-color: var(--btn-bg); outline: none; box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2); }
.option-card {
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass-bg);
  cursor: pointer;
  transition: all 0.2s;
}
.option-card.active {
  border-color: var(--btn-bg);
  background: rgba(108, 92, 231, 0.15);
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.2);
}
.option-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.option-card.active .option-label { color: var(--btn-bg); }
.option-desc {
  font-size: 0.75rem;
  color: var(--hint);
  line-height: 1.35;
}

#quiet-hours-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
#quiet-hours-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--hint);
}
#quiet-hours-form input.ts-num {
  width: 48px;
}
#quiet-hours-form .action-btn { flex: 0; min-width: auto; padding: 8px 16px; }

#profile-info { font-size: 0.9rem; line-height: 1.6; }

/* ── Loading Button State ────────────────────────────── */
.action-btn.loading {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}
.action-btn.loading::after {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Paused Label ────────────────────────────────────── */
.paused-label { color: var(--accent-orange); font-style: italic; }

/* ── Time Slot Rows ──────────────────────────────────── */
.ts-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ts-row:last-child { border-bottom: none; }
.ts-label {
  text-transform: capitalize;
  font-size: 0.9rem;
}
.ts-input {
  padding: 6px 10px;
  border: 1px solid var(--hint);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 0.9rem;
  width: 100px;
}
.ts-time-edit { display: flex; align-items: center; gap: 2px; }
.ts-num {
  width: 48px;
  padding: 6px 4px;
  border: 1px solid var(--hint);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 0.9rem;
  text-align: center;
  -moz-appearance: textfield;
}
.ts-num::-webkit-inner-spin-button, .ts-num::-webkit-outer-spin-button { -webkit-appearance: none; }
.ts-colon { font-size: 1.1rem; font-weight: 600; color: var(--hint); }
.ts-anytime-btn {
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 16px;
  border: 1.5px solid var(--hint);
  background: transparent;
  color: var(--hint);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.ts-anytime-btn.active {
  background: var(--btn-bg);
  color: var(--btn-color, #fff);
  border-color: var(--btn-bg);
  font-weight: 600;
}
.ts-time-edit.hidden { display: none; }

/* ── Item Manager ────────────────────────────────────── */
.im-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.im-row:last-child { border-bottom: none; }
.im-row.paused .im-name { opacity: 0.5; text-decoration: line-through; }
.im-name { font-size: 0.9rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
  transition: all 0.2s;
}
.im-btn.pause {
  background: rgba(255,152,0,0.15);
  color: var(--accent-orange);
}
.im-btn.resume {
  background: rgba(76,175,80,0.15);
  color: var(--accent-green);
}

/* ── Toggle Row ──────────────────────────────────────── */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  cursor: pointer;
}
.toggle-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--btn-bg);
}

/* Shake animation for required field validation */
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
.shake { animation: shake 0.4s ease; border-color: var(--accent-red) !important; }

/* ── Feedback Form ───────────────────────────────────── */
.feedback-form { display: flex; flex-direction: column; gap: 8px; }
.feedback-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hint);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 60px;
}
.feedback-form .action-btn { align-self: flex-end; min-width: auto; flex: 0; }

/* ── Hint Text ───────────────────────────────────────── */
.hint-text { color: var(--hint); font-size: 0.85rem; font-style: italic; padding: 4px 0; }
