/* ==============================================
   Clory UX改善CSS v1.0
   ============================================== */

/* === 1. 視認性向上（初心者向け） === */
body {
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.btn-primary,
.btn-secondary,
button {
  min-height: 44px;
  min-width: 44px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* フォーカス表示の強化（:focus-visibleで視覚フォーカスのみ表示） */
*:focus-visible {
  outline: var(--focus-ring-width) var(--focus-ring-style) var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* === 2. 効率性向上（効率重視ユーザー向け） === */
.quick-action-bar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

.quick-action-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--text-on-primary);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.quick-action-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ワンクリックアクション */
.one-click-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background: var(--card-action-overlay-bg);
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.one-click-favorite:active {
  transform: scale(0.95);
  background: var(--accent-primary);
  color: var(--text-on-primary);
}

/* === 3. 探索要素（探索好きユーザー向け） === */
.discovery-section {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
  padding: 20px;
  border-radius: 16px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.discovery-section::before {
  content: '✨';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 100px;
  opacity: 0.1;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.surprise-me-btn {
  background: var(--gradient-favorite);
  color: var(--text-on-primary);
  border: none;
  padding: 15px 30px;
  border-radius: 30px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.surprise-me-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.surprise-me-btn:hover::after {
  width: 300px;
  height: 300px;
}

/* === 4. フィードバック強化 === */
.success-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--accent-success);
  color: var(--text-primary);
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  animation:
    slideIn 0.3s ease,
    slideOut 0.3s ease 2.7s;
  z-index: 10000;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* === 5. エラー状態の改善 === */
.error-message {
  background: var(--error-bg-soft);
  border-left: 4px solid var(--error-color);
  color: var(--error-color);
  padding: 12px 16px;
  border-radius: 4px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-message::before {
  content: '⚠️';
  font-size: 20px;
}

.error-recovery-hint {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg-info-soft);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* === 6. モバイル最適化 === */
@media (max-width: 768px) {
  /* 親指ゾーン最適化 */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
  }

  .bottom-nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
  }

  .bottom-nav-item.active {
    color: var(--accent-primary);
  }

  /* 片手操作対応 */
  .main-content {
    padding-bottom: 80px;
  }

  .floating-action-btn {
    bottom: 80px;
    right: 20px;
  }

  /* スワイプ操作のヒント */
  .swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    margin: 10px 0;
    font-size: 14px;
    color: var(--text-tertiary);
  }

  .swipe-hint::before {
    content: '👆';
    margin-right: 8px;
    animation: swipeHint 1s ease-in-out infinite;
  }

  @keyframes swipeHint {
    0%,
    100% {
      transform: translateX(0);
    }
    50% {
      transform: translateX(10px);
    }
  }
}

/* === 7. ダークモード対応 === */
[data-theme='dark'] .bottom-nav {
  background: var(--bg-secondary);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .bottom-nav-item {
  color: var(--text-secondary);
}

[data-theme='dark'] .one-click-favorite {
  background: rgba(0, 0, 0, 0.7);
}

/* === 8. アニメーション設定（モーション酔い対策） === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === 9. 高コントラストモード === */
@media (prefers-contrast: high) {
  * {
    border-width: 2px !important;
  }

  button,
  .btn-primary,
  .btn-secondary {
    border: 2px solid currentColor !important;
  }

  *:focus-visible {
    outline-width: 4px !important;
  }
}

/* === 10. プリント対応 === */
@media print {
  .no-print,
  .bottom-nav,
  .quick-action-bar,
  .floating-action-btn {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a {
    text-decoration: underline;
  }
}
