/* リセット & グローバルスタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --card-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

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

/* サイトヘッダー */
.site-header {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  padding: 20px 0;
}

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

.site-header h1 {
  font-size: 1.8rem;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.site-tagline {
  color: #666;
  font-size: 0.95rem;
  margin-top: 5px;
}

/* 言語切替ボタン */
.lang-toggle {
  padding: 10px 20px;
  border: 2px solid var(--primary-color);
  border-radius: 25px;
  background: white;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.lang-toggle:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* ヘッダー */
.header {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 30px;
}

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

.logo-section h1 {
  font-size: 1.8rem;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.logo-section p {
  color: #666;
  font-size: 0.95rem;
}

.language-selector select {
  padding: 10px 20px;
  border: 2px solid var(--primary-color);
  border-radius: 25px;
  background: white;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.language-selector select:hover {
  background: var(--primary-color);
  color: white;
}

/* 検索バー */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-bar button {
  padding: 14px 30px;
  background: var(--bg-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.search-bar button:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

/* フィルターバー */
.filters-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.filter-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.filter-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.filter-group select:hover,
.filter-group select:focus {
  border-color: var(--primary-color);
}

/* メインコンテンツ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.results-header h2 {
  font-size: 1.5rem;
  color: #333;
}

.results-count {
  color: #666;
  font-size: 1rem;
}

/* チュートリアルグリッド */
.tutorials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

/* チュートリアルカード */
.tutorial-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.tutorial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.tutorial-thumbnail {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: white;
}

.engine-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.difficulty-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.difficulty-beginner {
  background: #4caf50;
  color: white;
}

.difficulty-intermediate {
  background: #ff9800;
  color: white;
}

.difficulty-advanced {
  background: #f44336;
  color: white;
}

.tutorial-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
  gap: 10px;
}

.tutorial-title {
  font-size: 1.3rem;
  color: #222;
  line-height: 1.3;
  flex: 1;
}

.category-tag {
  background: #f0f0f0;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  white-space: nowrap;
  color: #555;
}

.tutorial-description {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.tutorial-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
}

.meta-icon {
  font-size: 16px;
}

.tutorial-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.btn-view-tutorial {
  display: inline-block;
  width: 100%;
  padding: 12px;
  background: var(--bg-gradient);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
  margin-top: auto;
}

.btn-view-tutorial:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

/* 結果なし */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.no-results-icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

.no-results h3 {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 10px;
}

.no-results p {
  color: #666;
  font-size: 1.1rem;
}

/* フッター */
.footer {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  text-align: center;
  margin-top: 40px;
}

.footer p {
  color: #666;
  font-size: 14px;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
  .tutorials-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .logo-section h1 {
    font-size: 1.5rem;
  }
  
  .search-bar {
    flex-direction: column;
  }
  
  .filters-bar {
    grid-template-columns: 1fr;
  }
  
  .tutorials-grid {
    grid-template-columns: 1fr;
  }
  
  .results-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px;
  }
  
  .header-content {
    padding: 15px;
  }
  
  .tutorial-card {
    margin: 0 -5px;
  }
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tutorial-card {
  animation: fadeIn 0.5s ease-out;
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-gradient);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* セクションスタイル */
.search-section,
.filter-section,
.tutorials-section {
  margin-bottom: 30px;
}

/* 検索バー */
.search-bar {
  display: flex;
  gap: 10px;
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.search-bar input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-bar button {
  padding: 14px 30px;
  background: var(--bg-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-bar button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* フィルターセクション */
.filter-section {
  background: white;
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

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

.filter-item label {
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.filter-item select {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  background: white;
}

.filter-item select:hover,
.filter-item select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* チュートリアルグリッド */
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

/* チュートリアルカード */
.tutorial-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  cursor: pointer;
}

.tutorial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.tutorial-thumbnail {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.tutorial-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.tutorial-card:hover .tutorial-thumbnail img {
  transform: scale(1.05);
}

.tutorial-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.difficulty-beginner {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.difficulty-intermediate {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.difficulty-advanced {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.tutorial-info {
  padding: 20px;
}

.tutorial-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #333;
}

.tutorial-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 15px;
}

.tutorial-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.meta-item {
  font-size: 0.85rem;
  color: #777;
}

.meta-item strong {
  color: #555;
}

.tutorial-link {
  display: inline-block;
  padding: 12px 24px;
  background: var(--bg-gradient);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
}

.tutorial-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* エラーメッセージ */
.error-message {
  grid-column: 1 / -1;
  background: white;
  padding: 40px;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--card-shadow);
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.error-message h3 {
  color: #e53e3e;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.error-message p {
  color: #666;
  margin-bottom: 10px;
  line-height: 1.6;
}

.error-hint {
  margin-top: 20px;
  padding: 20px;
  background: #f7fafc;
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  text-align: left;
}

.error-hint strong {
  color: var(--primary-color);
  display: block;
  margin-bottom: 10px;
}

.error-hint code {
  background: #2d3748;
  color: #68d391;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

/* 結果なしメッセージ */
.no-results {
  grid-column: 1 / -1;
  background: white;
  padding: 60px 40px;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--card-shadow);
}

.no-results p {
  color: #666;
  font-size: 1.1rem;
}

/* 読み込み中メッセージ */
.loading-message {
  grid-column: 1 / -1;
  background: white;
  padding: 60px 40px;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--card-shadow);
}

.loading-message p {
  color: #666;
  font-size: 1.1rem;
}

/* フッター */
.site-footer {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px 0;
  margin-top: 50px;
  text-align: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.site-footer p {
  color: #666;
  margin: 10px 0;
}

.footer-note {
  margin-top: 15px;
  padding: 15px;
  background: #f7fafc;
  border-radius: 8px;
  display: inline-block;
}

.footer-note strong {
  color: #e53e3e;
}

.footer-note code {
  background: #2d3748;
  color: #68d391;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .site-header h1 {
    font-size: 1.5rem;
  }

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

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

  .search-bar {
    flex-direction: column;
  }

  .search-bar button {
    width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .tutorial-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 言語セレクター（ドロップダウン） */
.lang-select {
    padding: 10px 30px 10px 15px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    background: white;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    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='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.lang-select:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    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='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.lang-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.lang-select option {
    background: white;
    color: #333;
    padding: 10px;
}

/* フッターリンク */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px;
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.footer-link:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.footer-link-icon {
  font-size: 18px;
}

.footer-copyright {
  margin: 10px 0;
  color: #666;
}

.footer-note {
  margin: 10px 0;
  font-size: 0.9rem;
  color: #888;
}

@media (max-width: 768px) {
  .footer-links {
    gap: 10px;
  }
  
  .footer-link {
    font-size: 12px;
    padding: 6px 12px;
  }
}
