/* Weather Dashboard - Vanilla CSS */

/* === CSS Variables === */
:root {
  /* Primary - Warm Sunset Orange */
  --color-primary-50: #fff7ed;
  --color-primary-100: #ffedd5;
  --color-primary-200: #fed7aa;
  --color-primary-300: #fdba74;
  --color-primary-400: #fb923c;
  --color-primary-500: #f97316;
  --color-primary-600: #ea580c;
  --color-primary-700: #c2410c;

  /* Neutral - Warm Gray */
  --color-gray-50: #fafaf9;
  --color-gray-100: #f5f5f4;
  --color-gray-200: #e7e5e4;
  --color-gray-300: #d6d3d1;
  --color-gray-400: #a8a29e;
  --color-gray-500: #78716c;
  --color-gray-600: #57534e;
  --color-gray-700: #44403c;
  --color-gray-800: #292524;
  --color-gray-900: #1c1917;

  /* Semantic Colors */
  --color-success: #22c55e;
  --color-success-light: #dcfce7;
  --color-warning: #eab308;
  --color-warning-light: #fef9c3;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;
  --color-info: #3b82f6;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

/* === Base Styles === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-gray-50);
  color: var(--color-gray-900);
  line-height: 1.5;
}

/* === Utility Classes === */
.min-h-screen {
  min-height: 100vh;
}

.bg-gray-50 {
  background-color: var(--color-gray-50);
}

.lg-hidden {
  display: flex;
}

.lg-flex {
  display: none;
}

@media (min-width: 1024px) {
  .lg-hidden {
    display: none !important;
  }
  .lg-flex {
    display: flex !important;
  }
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-gray-100);
}

.header-container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-primary-500);
}

.header-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.header-settings-btn {
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  color: var(--color-gray-400);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.header-settings-btn:hover {
  color: var(--color-gray-600);
  background-color: var(--color-gray-100);
}

.header-settings-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* === Desktop Navigation === */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-600);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: var(--color-gray-100);
}

.nav-link.active {
  background-color: var(--color-primary-50);
  color: var(--color-primary-600);
}

/* === Main Content === */
.main-content {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 6rem;
}

@media (min-width: 1024px) {
  .main-content {
    padding-bottom: 2rem;
  }
}

/* === Day Slider === */
.day-slider-container {
  position: relative;
}

.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2rem;
  height: 2rem;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: white;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-full);
  border: none;
  color: var(--color-gray-600);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.scroll-btn:hover {
  background-color: var(--color-gray-50);
}

.scroll-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.scroll-btn-left {
  left: 0;
}

.scroll-btn-right {
  right: 0;
}

.date-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.date-pills::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1024px) {
  .date-pills {
    padding: 0.5rem 2.5rem;
  }
}

.date-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 4rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-xl);
  scroll-snap-align: center;
  transition: all 0.2s ease;
  border: 1px solid var(--color-gray-200);
  background-color: white;
  color: var(--color-gray-700);
  cursor: pointer;
}

.date-pill:hover {
  background-color: var(--color-gray-50);
}

.date-pill:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary-500), 0 0 0 4px white;
}

.date-pill.selected {
  background-color: var(--color-primary-500);
  color: white;
  border-color: var(--color-primary-500);
  box-shadow: var(--shadow-md);
}

.date-pill.past {
  background-color: var(--color-gray-100);
  color: var(--color-gray-400);
  border-color: transparent;
}

.date-pill.past:hover {
  background-color: var(--color-gray-200);
}

.date-pill-day {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.date-pill-date {
  font-size: 1.125rem;
  font-weight: 700;
}

.date-pill-month {
  font-size: 0.75rem;
}

.date-pill-today {
  margin-top: 0.25rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-500);
}

.date-pill.selected .date-pill-today {
  background-color: white;
}

/* === Box Grid === */
.box-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .box-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.weather-box {
  background-color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 1rem;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.weather-box:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.weather-box:active {
  transform: scale(0.98);
}

.weather-box:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary-500), 0 0 0 4px white;
}

.weather-box-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.weather-box-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.weather-box-chevron {
  color: var(--color-gray-300);
}

.weather-box-chevron svg {
  width: 1rem;
  height: 1rem;
}

.weather-box-counts {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.weather-box-city-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-gray-900);
}

.weather-box-separator {
  font-size: 1.125rem;
  color: var(--color-gray-400);
}

.weather-box-country-count {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-gray-500);
}

.weather-box-footer {
  font-size: 0.75rem;
  color: var(--color-gray-400);
  margin-top: 0.25rem;
}

/* === Skeleton Loading === */
.skeleton {
  background-color: var(--color-gray-200);
  border-radius: var(--radius-md);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton-box {
  background-color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 1rem;
}

.skeleton-box-label {
  height: 1rem;
  width: 4rem;
  margin-bottom: 0.75rem;
}

.skeleton-box-count {
  height: 2rem;
  width: 5rem;
  margin-bottom: 0.5rem;
}

.skeleton-box-footer {
  height: 0.75rem;
  width: 6rem;
}

.skeleton-title {
  height: 2rem;
  width: 8rem;
  margin-bottom: 1.5rem;
}

.skeleton-card {
  height: 16rem;
  width: 100%;
  border-radius: var(--radius-xl);
  margin-bottom: 1rem;
}

.skeleton-card-sm {
  height: 8rem;
  width: 100%;
  border-radius: var(--radius-xl);
  margin-bottom: 1rem;
}

/* === Triggered List === */
.triggered-section {
  margin-top: 0.5rem;
}

.triggered-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.triggered-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray-700);
}

.triggered-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.triggered-empty {
  padding: 1.5rem;
  background-color: var(--color-gray-50);
  border-radius: var(--radius-xl);
  text-align: center;
}

.triggered-empty-icon {
  color: var(--color-gray-300);
  margin-bottom: 0.5rem;
}

.triggered-empty-icon svg {
  width: 2rem;
  height: 2rem;
  margin: 0 auto;
}

.triggered-empty-text {
  color: var(--color-gray-500);
}

.triggered-city {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.triggered-city:hover {
  box-shadow: var(--shadow-md);
}

.triggered-city-flag {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background-color: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

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

.triggered-city-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.triggered-city-name {
  font-weight: 500;
  color: var(--color-gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.triggered-city-flame {
  color: #f97316;
  flex-shrink: 0;
}

.triggered-city-flame svg {
  width: 1rem;
  height: 1rem;
}

.triggered-city-country {
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.triggered-city-temps {
  text-align: right;
}

.triggered-city-max {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-900);
}

.triggered-city-min {
  font-size: 0.75rem;
  color: var(--color-gray-400);
}

/* === Badge === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background-color: var(--color-success-light);
  color: #166534;
}

.badge-success svg {
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.25rem;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  background-color: white;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius-xl);
    animation: fadeIn 0.2s ease;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.modal-close {
  padding: 0.25rem;
  border-radius: var(--radius-lg);
  color: var(--color-gray-400);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--color-gray-600);
  background-color: var(--color-gray-100);
}

.modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.modal-summary {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-bottom: 1rem;
}

.modal-cities {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-city {
  padding: 0.75rem;
  background-color: var(--color-gray-50);
  border-radius: var(--radius-lg);
  transition: background-color 0.2s ease;
}

.modal-city:hover {
  background-color: var(--color-gray-100);
}

.modal-city-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.modal-city-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-city-flag {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.modal-city-name {
  font-weight: 500;
  color: var(--color-gray-900);
}

.modal-city-country {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

.modal-city-temp {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-gray-900);
}

.modal-city-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  font-size: 0.75rem;
}

.modal-city-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-gray-500);
}

.modal-city-stat svg {
  width: 0.75rem;
  height: 0.75rem;
}

.modal-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--color-gray-500);
}

/* === Tab Bar === */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid var(--color-gray-200);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 40;
}

.tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 4rem;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--color-gray-400);
  text-decoration: none;
  transition: color 0.2s ease;
}

.tab-item:hover {
  color: var(--color-gray-600);
}

.tab-item.active {
  color: var(--color-primary-500);
}

.tab-icon {
  margin-bottom: 0.25rem;
}

.tab-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.tab-label {
  font-size: 0.75rem;
  font-weight: 500;
}

/* === Login Page === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(to bottom right, var(--color-primary-50), var(--color-gray-100));
}

.login-container {
  width: 100%;
  max-width: 24rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-100);
  margin-bottom: 1rem;
}

.login-icon svg {
  width: 2rem;
  height: 2rem;
  color: var(--color-primary-500);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-gray-900);
}

.login-subtitle {
  color: var(--color-gray-500);
  margin-top: 0.25rem;
}

.login-form {
  background-color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

/* === Form Elements === */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-300);
  background-color: white;
  font-size: 1rem;
  color: var(--color-gray-900);
  transition: all 0.2s ease;
}

.form-input::placeholder {
  color: var(--color-gray-400);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.form-input:disabled {
  background-color: var(--color-gray-100);
  cursor: not-allowed;
}

.form-input.small {
  width: 5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  text-align: right;
}

.password-input-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-gray-400);
  cursor: pointer;
  padding: 0.25rem;
}

.password-toggle:hover {
  color: var(--color-gray-600);
}

.password-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.error-message {
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  background-color: var(--color-error-light);
  color: #b91c1c;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  border-radius: var(--radius-lg);
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-primary-500);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--color-primary-500);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-600);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: white;
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-gray-50);
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  margin-right: 0.5rem;
}

.btn-icon svg {
  width: 1rem;
  height: 1rem;
}

.btn-loader {
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Pending Page === */
.pending-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(to bottom right, var(--color-primary-50), var(--color-gray-100));
}

.pending-container {
  width: 100%;
  max-width: 24rem;
}

.pending-card {
  background-color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  text-align: center;
}

.pending-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-full);
  background-color: var(--color-warning-light);
  margin-bottom: 1.5rem;
}

.pending-icon svg {
  width: 2rem;
  height: 2rem;
  color: #ca8a04;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pending-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 0.5rem;
}

.pending-text {
  color: var(--color-gray-500);
  margin-bottom: 1.5rem;
}

.device-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--color-gray-50);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  text-align: left;
}

.device-icon {
  color: var(--color-gray-400);
}

.device-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.device-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
}

.device-name {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--color-success);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-dot.checking {
  background-color: var(--color-warning);
}

/* === Settings Page === */
.settings-content {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 6rem;
}

@media (min-width: 1024px) {
  .settings-content {
    padding-bottom: 2rem;
  }
}

.settings-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 1.5rem;
}

.settings-card {
  background-color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.settings-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.settings-section-desc {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.threshold-group {
  margin-bottom: 1rem;
}

.threshold-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-gray-600);
  margin-bottom: 0.5rem;
}

.threshold-icon svg {
  width: 1rem;
  height: 1rem;
}

.threshold-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.threshold-inputs {
  padding-left: 1.5rem;
}

.threshold-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.threshold-input-row label {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-unit {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  min-width: 2rem;
}

.threshold-divider {
  height: 1px;
  background-color: var(--color-gray-100);
  margin: 1rem 0;
}

/* === Toggle === */
.toggle-list {
  display: flex;
  flex-direction: column;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-gray-100);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 0.875rem;
  color: var(--color-gray-700);
}

.toggle {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--color-gray-200);
  transition: all 0.2s ease;
  border-radius: var(--radius-full);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 1.25rem;
  width: 1.25rem;
  left: 0.125rem;
  bottom: 0.125rem;
  background-color: white;
  transition: all 0.2s ease;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
  background-color: var(--color-primary-500);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(1.25rem);
}

.toggle input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* === Settings Actions === */
.settings-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.settings-actions .btn {
  flex: 1;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 50;
  animation: fadeIn 0.2s ease;
}

.toast.success {
  background-color: #16a34a;
  color: white;
}

.toast.error {
  background-color: #dc2626;
  color: white;
}

.toast-icon svg {
  width: 1rem;
  height: 1rem;
}

.toast-message {
  font-size: 0.875rem;
  font-weight: 500;
}

/* === Error Banner === */
.error-banner {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: var(--color-error-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #b91c1c;
}

.error-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.error-text {
  font-size: 0.875rem;
}

/* === Device Management === */
.devices-loading {
  padding: 1.5rem;
  text-align: center;
}

.devices-loading-text {
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.devices-empty {
  padding: 1.5rem;
  text-align: center;
  background-color: var(--color-gray-50);
  border-radius: var(--radius-lg);
}

.devices-empty-text {
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.devices-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.device-item {
  padding: 0.875rem;
  background-color: var(--color-gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.device-item.device-pending {
  border-color: var(--color-warning);
  background-color: var(--color-warning-light);
}

.device-info-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.device-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.device-name-text {
  font-weight: 500;
  color: var(--color-gray-900);
  font-size: 0.875rem;
}

.device-status {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.device-status-approved {
  background-color: var(--color-success-light);
  color: #166534;
}

.device-status-pending {
  background-color: var(--color-warning-light);
  color: #854d0e;
}

.device-status-rejected {
  background-color: var(--color-error-light);
  color: #b91c1c;
}

.device-last-seen {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

.device-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-success {
  background-color: var(--color-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background-color: #16a34a;
}

.btn-danger {
  background-color: var(--color-error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
}

/* === City Management === */
.add-city-form {
  margin-bottom: 1rem;
}

.search-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.search-input-wrapper .form-input {
  flex: 1;
}

.city-search-results {
  margin-top: 0.5rem;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
}

.search-loading {
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-gray-100);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.search-result-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-gray-900);
}

.search-result-country {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

.search-result-added {
  font-size: 0.75rem;
  color: var(--color-gray-400);
  font-style: italic;
}

.cities-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.city-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: var(--color-gray-50);
  border-radius: var(--radius-lg);
}

.city-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.city-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-gray-900);
}

.city-country {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

/* === Data Actions === */
.data-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.data-action-hint {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  min-height: 1.125rem;
}

/* === Toast Warning === */
.toast.warning {
  background-color: #ca8a04;
  color: white;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
