/* Arigato App - Main Styles */

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #f59e0b;
  --secondary-hover: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-light: #f9fafb;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header and Navigation */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin-bottom: 24px;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Loading Indicator */
.loading-indicator {
  text-align: center;
  padding: 40px 20px;
  margin: 20px 0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-indicator p {
  color: var(--text-light);
  font-size: 16px;
  margin: 0;
}

/* Language Selection Buttons */
.lang-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.lang-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.lang-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Premium Button */
.premium-btn {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.premium-btn:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Category Buttons */
.category-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.category-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Scene Button */
.scene-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 4px;
}

.scene-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.scene-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Scene Switcher */
#scene-switcher {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* Main Content */
.main-content {
  background: var(--bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.content-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* Phrase List */
.phrase-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.phrase-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: all 0.2s ease;
}

.phrase-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.phrase-number {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.phrase-content {
  flex: 1;
}

.phrase-english {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}

.phrase-japanese {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
}

.phrase-note {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}

.phrase-actions {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: var(--text-light);
}

.action-btn:hover {
  background: var(--bg-light);
  color: var(--primary);
}

/* Premium Modal */
.premium-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.premium-modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg);
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  border-radius: 4px;
}

.modal-close:hover {
  background: var(--bg-light);
  color: var(--text);
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.modal-description {
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.6;
}

.feature-list {
  list-style: none;
  margin-bottom: 24px;
}

.feature-list li {
  padding: 8px 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-list li::before {
  content: "✓";
  color: var(--success);
  font-weight: bold;
}

.pay-button {
  background: var(--success);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.pay-button:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.footer-btn {
  background: var(--bg-light);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin: 0 4px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.footer-btn:hover {
  background: var(--border);
  border-color: var(--border-hover);
}

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

  .nav-container {
    flex-direction: column;
    align-items: stretch;
  }

  .lang-container {
    justify-content: center;
  }

  .category-container {
    justify-content: center;
  }

  .phrase-item {
    flex-direction: column;
    gap: 8px;
  }

  .phrase-actions {
    margin-left: 0;
    justify-content: center;
  }

  .modal-content {
    padding: 24px;
    margin: 16px;
  }

  /* オノマトペ辞典のスマートフォン用1行ボタンレイアウト */
  .scene-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-align: left;
    height: 48px; /* iPhone SEで8行表示用 */
  }
  
  .scene-icon {
    font-size: 1.5em;
    margin-right: 12px;
    margin-bottom: 0;
    margin-top: 2mm;
    flex-shrink: 0;
  }
  
  .scene-title {
    flex: 1;
    font-size: 0.9rem; /* iPhone SEで8行表示用 */
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .scene-count {
    font-size: 0.75rem;
    margin-left: 8px;
    flex-shrink: 0;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none; }
.visible { display: block; }

/* オノマトペ辞典スタイル */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.scene-card {
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.scene-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.scene-icon {
  font-size: 2.5em;
  margin-bottom: 12px;
}

.scene-title {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.scene-count {
  font-size: 0.9em;
  color: var(--text-muted);
}

.back-btn {
  background: var(--bg-light);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.back-btn:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.onomatopoeia-item {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.onomatopoeia-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.item-number {
  background: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 600;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.item-main {
  font-size: 1.1em;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.5;
}

.item-romaji {
  font-size: 0.9em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: monospace;
  letter-spacing: 0.5px;
}

.item-description {
  font-size: 0.9em;
  color: var(--text-muted);
  line-height: 1.4;
}

.favorite-toggle-btn {
  transition: all 0.2s ease;
}

.favorite-toggle-btn:hover {
  transform: scale(1.1);
}

.speak-btn {
  transition: all 0.2s ease;
}

.speak-btn:hover {
  transform: scale(1.1);
  color: var(--primary);
}

/* 新しいページ用スタイル */
.premium-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.feature-card {
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-card.coming-soon {
  cursor: not-allowed;
  opacity: 0.7;
}

.feature-card.coming-soon:hover {
  transform: none;
  box-shadow: none;
}

.feature-icon {
  font-size: 3em;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.feature-description {
  font-size: 0.95em;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.feature-details {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.feature-count, .feature-scenes {
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.feature-status {
  background: var(--text-muted);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  margin-top: 16px;
}

.back-navigation {
  margin-bottom: 24px;
}

.scenes-intro {
  text-align: center;
  margin: 24px 0;
  color: var(--text-muted);
}

.scenes-intro p {
  font-size: 1.1em;
  margin: 0;
}
