/**
 * AI Features Styles for My Film School
 * AI要約・レコメンデーション用スタイル
 */

/* ========== AI要約ボックス ========== */

.ai-summary-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #7dd3fc;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 12px rgba(125, 211, 252, 0.2);
}

.dark .ai-summary-box {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2f4a 100%);
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.summary-header {
  display: flex;
  align-items: center;
  font-size: 1rem;
  color: #0369a1;
  margin-bottom: 0.75rem;
}

.dark .summary-header {
  color: #60a5fa;
}

.summary-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #1e40af;
}

.dark .summary-text {
  color: #93c5fd;
}

/* ========== 関連記事セクション ========== */

.related-articles-section {
  margin: 3rem 0;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 16px;
}

.dark .related-articles-section {
  background: #1f2937;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.dark .section-title {
  color: #f9fafb;
}

.section-title i {
  color: #f59e0b;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .related-articles-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 関連記事カード ========== */

.related-article-card {
  display: block;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.dark .related-article-card {
  background: #374151;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.related-article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.dark .related-article-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.related-article-card .article-thumbnail {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-article-card .article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.related-article-card .thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0.5;
}

.related-article-card .article-info {
  padding: 1rem;
}

.related-article-card .article-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark .related-article-card .article-title {
  color: #f9fafb;
}

.related-article-card .article-summary {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark .related-article-card .article-summary {
  color: #9ca3af;
}

.related-article-card .article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
}

.dark .related-article-card .article-meta {
  color: #9ca3af;
}

.related-article-card .category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.related-article-card .reading-time {
  display: flex;
  align-items: center;
}

/* ========== パーソナライズドレコメンデーション ========== */

.recommendations-section {
  margin: 3rem 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  display: block;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.dark .article-card {
  background: #374151;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.dark .article-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.article-card .article-thumbnail {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.article-card .article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-thumbnail img {
  transform: scale(1.1);
}

.article-card .thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0.6;
}

.article-card .article-content {
  padding: 1.5rem;
}

.article-card .article-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.article-card .article-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark .article-card .article-title {
  color: #f9fafb;
}

.article-card .article-summary {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark .article-card .article-summary {
  color: #9ca3af;
}

.article-card .article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #6b7280;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.dark .article-card .article-footer {
  color: #9ca3af;
  border-top-color: #4b5563;
}

.article-card .reading-time,
.article-card .view-count {
  display: flex;
  align-items: center;
}

/* ========== ローディング状態 ========== */

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@media (max-width: 640px) {
  .ai-summary-box {
    padding: 1rem;
  }

  .related-articles-section {
    padding: 1.5rem;
  }

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