/* Settings Page Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #fafaf9;
  color: #1a1815;
  line-height: 1.6;
}

.settings-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 80px);
}

/* Header */
.settings-header {
  margin-bottom: 40px;
}

.back-link {
  display: inline-block;
  color: #6e645a;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.back-link:hover {
  background-color: #f4f1ed;
  color: #1a1815;
}

.settings-header h1 {
  font-size: 2em;
  font-weight: 700;
  color: #1a1815;
  margin-bottom: 8px;
}

.settings-header .subtitle {
  color: #6e645a;
  font-size: 1.1em;
}

/* Sections */
.settings-section {
  background: white;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-section h2 {
  font-size: 1.4em;
  font-weight: 600;
  color: #1a1815;
  margin-bottom: 8px;
}

.section-description {
  color: #6e645a;
  margin-bottom: 24px;
  font-size: 0.95em;
}

/* Form Groups */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #1a1815;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d4cfc7;
  border-radius: 8px;
  font-size: 1em;
  font-family: 'Inter', sans-serif;
  background-color: #fafaf9;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1a1815;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(26, 24, 21, 0.1);
}

.help-text {
  font-size: 0.85em;
  color: #6e645a;
  margin-top: 8px;
}

/* Input with Button */
.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  flex: 1;
}

.input-with-button .btn {
  white-space: nowrap;
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-input {
  display: none;
}

.toggle-label {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  cursor: pointer;
}

.toggle-inner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d4cfc7;
  border-radius: 28px;
  transition: all 0.3s ease;
}

.toggle-switch {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-input:checked + .toggle-label .toggle-inner {
  background-color: #00695c;
}

.toggle-input:checked + .toggle-label .toggle-switch {
  transform: translateX(22px);
}

.toggle-text {
  font-size: 0.9em;
  color: #6e645a;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #1a1815;
  color: white;
}

.btn-primary:hover {
  background-color: #2d2a26;
}

.btn-secondary {
  background-color: #f4f1ed;
  color: #1a1815;
  border: 1px solid #d4cfc7;
}

.btn-secondary:hover {
  background-color: #e8e4df;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Test Result */
.test-result {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9em;
}

.test-result .success {
  color: #00695c;
}

.test-result .error {
  color: #dc2626;
}

.test-result .loading {
  color: #6e645a;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #f4f1ed;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2em;
  font-weight: 700;
  color: #1a1815;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.9em;
  color: #6e645a;
}

/* Data Actions */
.data-actions {
  display: grid;
  gap: 16px;
}

.action-card {
  background: #fafaf9;
  border: 1px solid #e8e4df;
  border-radius: 8px;
  padding: 20px;
}

.action-card h3 {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 8px;
}

.action-card p {
  color: #6e645a;
  font-size: 0.9em;
  margin-bottom: 16px;
}

.action-card.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.action-card.danger h3 {
  color: #dc2626;
}

/* About Section */
.about-content {
  background: #f4f1ed;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.about-content p {
  margin-bottom: 8px;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.about-links {
  display: flex;
  gap: 16px;
}

.about-link {
  color: #00695c;
  text-decoration: none;
  font-weight: 500;
}

.about-link:hover {
  text-decoration: underline;
}

/* Notification */
.notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #1a1815;
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.notification.error {
  background-color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
  .settings-container {
    padding: 16px;
  }

  .settings-section {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .input-with-button {
    flex-direction: column;
  }

  .about-links {
    flex-direction: column;
  }
}
