/* ========================================================
   Android WebView Compatibility Checker - Stylesheet
   ※古いWebView (Chromium 44等) から最新まで安全に描画可能なCSS
   ======================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background-color: #0f172a;
  color: #f1f5f9;
  line-height: 1.5;
  font-size: 14px;
  padding-bottom: 40px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ヘッダー */
.app-header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 20px 16px;
  position: relative;
}

.header-content {
  max-width: 960px;
  margin: 0 auto;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #38bdf8;
}

.subtitle {
  color: #94a3b8;
  font-size: 0.825rem;
  margin-top: 6px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #334155;
  color: #cbd5e1;
}

.badge.pass {
  background-color: #065f46;
  color: #34d399;
}

.badge.warn {
  background-color: #854d0e;
  color: #facc15;
}

.badge.fail {
  background-color: #7f1d1d;
  color: #f87171;
}

/* カード共通 */
.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  margin-top: 20px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.card-header {
  background: #243247;
  padding: 12px 16px;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.card-header h2 {
  font-size: 1rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-body {
  padding: 16px;
}

.tag {
  font-size: 0.7rem;
  background: #475569;
  color: #cbd5e1;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ボタン */
.btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:active {
  background: #1d4ed8;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid #38bdf8;
  color: #38bdf8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-outline:active {
  background: rgba(56, 189, 248, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.log-status-text {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* 環境インフォメーション */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.info-item {
  background: #0f172a;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.info-item .label {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.info-item .value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-all;
}

.info-item .value.highlight {
  color: #38bdf8;
}

.ua-details {
  margin-top: 14px;
  background: #0f172a;
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid #334155;
}

.ua-details summary {
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.75rem;
  outline: none;
}

.ua-box {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: monospace;
}

/* フィルターとスコアグリッド */
.filter-controls {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.score-card-item {
  background: #0f172a;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.score-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.825rem;
}

.score-name {
  font-weight: 600;
  color: #e2e8f0;
}

.score-val {
  font-weight: 700;
  color: #38bdf8;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

/* ビジュアルテストエリア */
.section-desc {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.visual-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
}

.visual-box h4 {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.test-flex {
  display: flex;
  justify-content: space-around;
  background: #1e293b;
  padding: 10px;
  border-radius: 6px;
}

.test-flex div {
  background: #0284c7;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.test-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #1e293b;
  padding: 10px;
  border-radius: 6px;
}

.grid-cell {
  background: #4f46e5;
  color: white;
  text-align: center;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.test-gradient-shadow {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.test-backdrop-wrapper {
  position: relative;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: repeating-linear-gradient(45deg, #1e293b, #1e293b 10px, #334155 10px, #334155 20px);
}

.glass-layer {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.test-anim-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  background: #1e293b;
  border-radius: 6px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid #334155;
  border-top-color: #38bdf8;
  border-radius: 50%;
  -webkit-animation: spin 1s linear infinite;
  animation: spin 1s linear infinite;
}

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

/* カテゴリ別テスト結果テーブル */
.category-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  margin-top: 20px;
  overflow: hidden;
}

.category-header {
  background: #243247;
  padding: 12px 16px;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
}

.test-list {
  display: flex;
  flex-direction: column;
}

.test-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #28374d;
  font-size: 0.825rem;
}

.test-item:last-child {
  border-bottom: none;
}

.test-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 75%;
}

.test-name {
  font-weight: 600;
  color: #f8fafc;
}

.test-desc {
  font-size: 0.725rem;
  color: #94a3b8;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 600;
  min-width: 60px;
  justify-content: center;
}

.status-pill.pass {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.status-pill.fail {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

/* フッター */
.app-footer {
  margin-top: 40px;
  text-align: center;
  color: #64748b;
  font-size: 0.75rem;
}

.footer-sub {
  margin-top: 4px;
  color: #475569;
}
