/* market-monitor.css - Recovery Market Monitor スタイル */

:root {
  --primary-color: #2563eb;
  --secondary-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

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

/* ========================================
 * ヘッダー
 * ======================================== */
.header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
}

.header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.header .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 5px;
}

.header .update-time {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ========================================
 * サマリーカード
 * ======================================== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card.alert {
  border-left: 4px solid var(--danger-color);
}

.card-icon {
  font-size: 2.5rem;
}

.card-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--gray-900);
}

.card-label {
  font-size: 0.9rem;
  color: var(--gray-600);
}

/* ========================================
 * メインコンテンツ
 * ======================================== */
.main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

@media (max-width: 968px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* ========================================
 * セクション
 * ======================================== */
.section {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.section h2 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: var(--gray-900);
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 10px;
}

.section-description {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin: -10px 0 15px 0;
  padding: 12px;
  background: var(--gray-50);
  border-left: 3px solid var(--info-color);
  border-radius: 4px;
  line-height: 1.5;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--gray-700);
  margin: -5px 0 15px 0;
  padding: 10px 12px;
  background: linear-gradient(to right, rgba(59, 130, 246, 0.05), transparent);
  border-left: 3px solid var(--info-color);
  font-weight: 500;
}

.section-note {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin: 15px 0 0 0;
  padding: 10px;
  background: var(--gray-50);
  border-radius: 4px;
  font-style: italic;
}

.section.alert-section {
  border-left: 4px solid var(--warning-color);
}

/* ========================================
 * フィルターバー
 * ======================================== */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: var(--gray-200);
}

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

.filter-btn.alert-critical {
  border-color: var(--danger-color);
}

.filter-btn.alert-critical.active {
  background: var(--danger-color);
}

.filter-btn.alert-warning {
  border-color: var(--warning-color);
}

.filter-btn.alert-warning.active {
  background: var(--warning-color);
}

.filter-btn.alert-advisory {
  border-color: var(--info-color);
}

.filter-btn.alert-advisory.active {
  background: var(--info-color);
}

/* ========================================
 * ニュースリスト（PRTIMES風カードグリッド）
 * ======================================== */
.news-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

/* レスポンシブ: 4列 → 2列 → 1列 */
@media (max-width: 1200px) {
  .news-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .news-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .news-list {
    grid-template-columns: 1fr;
  }
}

/* ニュースカード */
.news-card {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.1s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* サムネイルリンク */
.news-card-thumbnail-link {
  display: block;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
}

.news-card-thumbnail-link:hover .news-card-thumbnail img {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* サムネイル */
.news-card-thumbnail {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ebf0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e8e8e8;
  overflow: hidden;
  position: relative;
}

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

.news-card-thumbnail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #ccc;
}

.news-card-thumbnail-placeholder svg {
  opacity: 0.4;
}

/* コンテンツ */
.news-card-content {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* タイトル（2行省略） */
.news-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.8em;
}

.news-card-title:hover {
  color: #0066cc;
}

/* メタ情報 */
.news-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #999;
  margin-top: auto;
  flex-wrap: wrap;
}

.news-card-source {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  font-size: 0.7rem;
}

.news-card-brand {
  background: #f0f0f0;
  color: #666;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.news-card-time {
  color: #999;
}

/* ========================================
 * アラートリスト
 * ======================================== */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  padding: 15px;
  border-left: 4px solid var(--info-color);
  border-radius: 8px;
  background: var(--gray-50);
}

.alert-item.critical {
  border-left-color: var(--danger-color);
  background: #fef2f2;
}

.alert-item.warning {
  border-left-color: var(--warning-color);
  background: #fffbeb;
}

.alert-item.advisory {
  border-left-color: var(--info-color);
  background: #eff6ff;
}

.alert-item-title {
  font-weight: 600;
  color: var(--gray-900);
  text-decoration: none;
  display: block;
  margin-bottom: 5px;
}

.alert-item-title:hover {
  text-decoration: underline;
}

.alert-item-level {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 8px;
}

.alert-item-level.critical {
  background: var(--danger-color);
  color: white;
}

.alert-item-level.warning {
  background: var(--warning-color);
  color: white;
}

.alert-item-level.advisory {
  background: var(--info-color);
  color: white;
}

.alert-item-meta {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 5px;
}

/* ========================================
 * ブランド統計
 * ======================================== */
.brand-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--gray-50);
  border-radius: 6px;
}

.brand-stat-name {
  font-weight: 500;
  color: var(--gray-800);
}

.brand-stat-count {
  font-weight: 600;
  color: var(--primary-color);
  background: white;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ========================================
 * テーマ
 * ======================================== */
.themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-tag {
  background: var(--secondary-color);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ========================================
 * 備考
 * ======================================== */
.notes {
  background: var(--gray-50);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  color: var(--gray-700);
  line-height: 1.8;
}

/* ========================================
 * ローディング
 * ======================================== */
.loading {
  text-align: center;
  color: var(--gray-600);
  padding: 20px;
  font-style: italic;
}

/* ========================================
 * フッター
 * ======================================== */
.footer {
  background: var(--gray-800);
  color: var(--gray-300);
  padding: 30px;
  border-radius: 12px;
  margin-top: 30px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
}

@media (max-width: 968px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}

.footer h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: white;
}

.footer p {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.credit {
  text-align: right;
}

@media (max-width: 968px) {
  .credit {
    text-align: left;
  }
}
