/* ========================================
   設定ページ専用スタイル
======================================== */

.settings-main {
  padding-top: 140px;
  padding-bottom: 4rem;
  align-items: flex-start;
  min-height: auto;
}

.settings-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.settings-header {
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #f5f5f5;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: #ebebeb;
  border-color: #d0d0d0;
  transform: translateX(-2px);
}

.settings-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

/* ========================================
   セクション
======================================== */

.settings-section {
  background: white;
  border: 2px solid #e5e5e5;
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.settings-section:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.section-title svg {
  color: #666666;
}

.section-description {
  color: #666666;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ========================================
   設定項目
======================================== */

.setting-item {
  margin-bottom: 2rem;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-label {
  display: block;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.setting-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #f8f8f8;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
}

.setting-input:hover {
  border-color: #d0d0d0;
  background: #f5f5f5;
}

.setting-input:focus {
  border-color: #1a1a1a;
  background: #ffffff;
}

.setting-hint {
  font-size: 0.85rem;
  color: #999999;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ========================================
   ファビコンアップロード
======================================== */

.favicon-upload-area {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  background: #f8f8f8;
  border: 2px dashed #d0d0d0;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.favicon-upload-area:hover {
  border-color: #1a1a1a;
  background: #f5f5f5;
}

.favicon-preview {
  width: 64px;
  height: 64px;
  background: white;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.favicon-preview img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
}

.favicon-upload-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
}

/* ========================================
   ボタン
======================================== */

.btn-upload,
.btn-reset,
.btn-save,
.btn-add,
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-upload {
  background: #1a1a1a;
  color: white;
}

.btn-upload:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-reset {
  background: #f5f5f5;
  color: #666666;
  border: 2px solid #e5e5e5;
}

.btn-reset:hover {
  background: #ebebeb;
  color: #1a1a1a;
}

.btn-save {
  background: #1a1a1a;
  color: white;
  width: 100%;
  justify-content: center;
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
}

.btn-save:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-add {
  background: #1a1a1a;
  color: white;
}

.btn-add:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-danger {
  background: #fee;
  color: #dc2626;
  border: 2px solid #fecaca;
}

.btn-danger:hover {
  background: #fecaca;
  border-color: #dc2626;
  transform: translateY(-2px);
}

/* ========================================
   ブックマーク
======================================== */

.bookmarks-list {
  margin-bottom: 2rem;
}

.bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f8f8f8;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.bookmark-item:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

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

.bookmark-name {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-url {
  font-size: 0.85rem;
  color: #666666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-bookmark-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: white;
  color: #666666;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-bookmark-action:hover {
  background: #1a1a1a;
  color: white;
  transform: scale(1.1);
}

.btn-bookmark-delete:hover {
  background: #dc2626;
  color: white;
}

.empty-bookmarks {
  text-align: center;
  padding: 3rem 1rem;
  color: #999999;
}

.empty-bookmarks svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* ========================================
   フォーム
======================================== */

.add-bookmark-form {
  background: #f8f8f8;
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid #e5e5e5;
}

.form-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: #666666;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* ========================================
   危険ゾーン
======================================== */

.danger-section {
  border-color: #fecaca;
  background: #fff5f5;
}

.danger-section .section-title {
  color: #dc2626;
}

/* ========================================
   トースト通知
======================================== */

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: #1a1a1a;
  color: white;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: #10b981;
}

.toast.error {
  background: #dc2626;
}

/* ========================================
   レスポンシブ
======================================== */

@media (max-width: 768px) {
  .settings-main {
    padding-top: 100px;
  }

  .settings-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .settings-title {
    font-size: 1.75rem;
  }

  .settings-section {
    padding: 1.5rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .favicon-upload-area {
    flex-direction: column;
    align-items: flex-start;
  }

  .favicon-upload-controls {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .settings-section {
    padding: 1.25rem;
  }

  .btn-upload,
  .btn-reset,
  .btn-save,
  .btn-add {
    width: 100%;
    justify-content: center;
  }

  .bookmark-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .bookmark-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ========================================
   ダークモード
======================================== */

@media (prefers-color-scheme: dark) {
  .settings-section {
    background: #1a1a1a;
    border-color: #2a2a2a;
  }

  .settings-section:hover {
    border-color: #3a3a3a;
  }

  .settings-title,
  .section-title,
  .setting-label,
  .bookmark-name {
    color: #f5f5f5;
  }

  .section-description,
  .setting-hint,
  .bookmark-url {
    color: #999999;
  }

  .back-button {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #f5f5f5;
  }

  .back-button:hover {
    background: #2a2a2a;
    border-color: #3a3a3a;
  }

  .setting-input {
    background: #0a0a0a;
    border-color: #2a2a2a;
    color: #f5f5f5;
  }

  .setting-input:hover {
    border-color: #3a3a3a;
    background: #1a1a1a;
  }

  .setting-input:focus {
    border-color: #f5f5f5;
  }

  .favicon-upload-area {
    background: #0a0a0a;
    border-color: #3a3a3a;
  }

  .favicon-upload-area:hover {
    border-color: #f5f5f5;
  }

  .favicon-preview {
    background: #1a1a1a;
    border-color: #2a2a2a;
  }

  .btn-reset {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #999999;
  }

  .btn-reset:hover {
    background: #2a2a2a;
    color: #f5f5f5;
  }

  .bookmark-item {
    background: #0a0a0a;
    border-color: #2a2a2a;
  }

  .bookmark-item:hover {
    background: #1a1a1a;
    border-color: #3a3a3a;
  }

  .btn-bookmark-action {
    background: #1a1a1a;
    color: #999999;
  }

  .btn-bookmark-action:hover {
    background: #f5f5f5;
    color: #0a0a0a;
  }

  .add-bookmark-form {
    background: #0a0a0a;
    border-color: #2a2a2a;
  }

  .form-group label {
    color: #999999;
  }

  .danger-section {
    background: #1a0a0a;
    border-color: #3a1a1a;
  }
}