/* app-page.css — ページ固有スタイル */

/* app-page.css — 設定ページ固有スタイル
   ※ style.css で基本変数・レイアウトを継承
   Extracted from app.html inline <style> */

/* 固定ナビゲーション */

.fixed-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, #0b1221, #0c1220);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--acc);
  margin: 0;
}

.nav-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-btn {
  background: var(--pill);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.nav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.15);
}

.nav-btn.active {
  border-color: var(--acc);
  color: var(--acc);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.2);
}

/* メインコンテンツ */

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
}

.main-title {
  font-size: 32px;
  text-align: center;
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--acc);
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 16px;
}

.card {
  background: linear-gradient(180deg, #0b1221, #0c1220);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--acc);
}

.profile-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.info-item {
  background: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s;
}

.info-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.info-label {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 4px;
}

.info-value {
  font-size: 18px;
  font-weight: 600;
}

/* ボタンは common-ui.css から継承 */

.btn-legacy {
  background: var(--pill);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px;
}

.btn-legacy:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-legacy.primary {
  background: var(--acc);
  color: #0f172a;
  border-color: var(--acc);
  font-weight: 600;
}

.btn-legacy.primary:hover {
  background: #06b6d4;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px;
  background: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
  box-sizing: border-box;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.form-select {
  width: 100%;
  padding: 12px;
  background: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
  box-sizing: border-box;
}

.weight-form {
  background: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.weight-input-group {
  display: flex;
  gap: 12px;
  align-items: end;
}

.weight-input-group .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* レスポンシブ対応 */

@media (max-width: 768px) {

  html,
  body {
    padding-top: 45px;
  }

  .container {
    padding: 4px 16px;
  }

  .main-title {
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 4px;
  }

  .subtitle {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .card {
    padding: 16px;
  }

  .profile-info {
    grid-template-columns: 1fr;
  }

  .weight-input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .weight-input-group .form-group {
    margin-bottom: 12px;
  }

  .nav-buttons {
    gap: 6px;
  }

  .nav-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* ポリシー設定セクション */

.policy-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  transition: all 0.2s;
}

.policy-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.policy-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--fg);
}

.policy-card-label .policy-icon {
  font-size: 20px;
}

.policy-card select {
  width: 100%;
  padding: 10px 14px;
  background: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.policy-card select:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.policy-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}

.policy-current-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.policy-current-badge.goal {
  background: rgba(34, 211, 238, 0.1);
  color: var(--acc);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.policy-current-badge.restriction {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.policy-current-badge.activity {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .policy-card {
  background: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .policy-card:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .policy-card select {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #212529;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="light"] .policy-card select:focus {
  border-color: #ff8800;
  box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.1);
}

[data-theme="light"] .policy-hint {
  background: #f1f3f5;
}

[data-theme="light"] .policy-current-badge.goal {
  background: rgba(255, 136, 0, 0.08);
  color: #e67700;
  border-color: rgba(255, 136, 0, 0.2);
}

[data-theme="light"] .policy-current-badge.restriction {
  background: rgba(34, 197, 94, 0.08);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.2);
}

[data-theme="light"] .policy-current-badge.activity {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
}

/* リマインダー設定 */

.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.reminder-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.reminder-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reminder-icon {
  font-size: 24px;
  width: 36px;
  text-align: center;
}

.reminder-name {
  font-weight: 600;
  font-size: 15px;
}

.reminder-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reminder-time {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--fg);
  font-size: 14px;
  font-family: 'SF Mono', 'Consolas', monospace;
  width: 80px;
  text-align: center;
}

.reminder-time:focus {
  outline: none;
  border-color: var(--acc);
}

/* トグルスイッチ */

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  transition: all 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--muted);
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--acc);
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(22px);
  background: #fff;
}

.notification-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.notification-status.granted {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--green);
}

.notification-status.denied {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
}

.notification-status.default {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--yellow);
}

/* ライトモード通知ステータス — 黒文字で可読性UP */
[data-theme="light"] .notification-status.default {
  color: #78350f;
}

[data-theme="light"] .btn-request-perm {
  background: var(--acc);
  color: #1a1a1a;
}

[data-theme="light"] .btn-request-perm:hover {
  box-shadow: 0 4px 12px rgba(255, 136, 0, 0.4);
}

.notification-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.btn-request-perm {
  background: var(--acc);
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}

.btn-request-perm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 136, 0, 0.4);
}

.btn-test-notif {
  background: var(--pill);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-test-notif:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 480px) {
  .main-title {
    font-size: 20px;
    margin-top: 4px;
  }

  .card-title {
    font-size: 18px;
  }

  .info-value {
    font-size: 16px;
  }
}