/* ══════════════════════════════════════
   cocouv — UV Index Realtime Monitor
   CSS VARIABLES（ダーク/ライト）
══════════════════════════════════════ */
:root {
  --bg:       #0a0710;
  --panel:    #140d1c;
  --panel2:   #1c1226;
  --border:   #2b1d3a;
  --accent:   #ff9d3c;   /* サン・オレンジ */
  --accent2:  #ffd166;
  --text:     #f0e6e0;
  --text2:    #b39dc4;
  --glow:     0 0 20px rgba(255,157,60,.35);
  --tip-bg:   rgba(20,13,28,.97);
  --leg-bg:   rgba(20,13,28,.92);
  --card-bg:  rgba(28,18,38,.85);

  /* UV指数レベル色（WHO標準） */
  --uv-low:      #34c759;  /* 0-2  低い */
  --uv-mid:      #ffcc00;  /* 3-5  中程度 */
  --uv-high:     #ff9500;  /* 6-7  高い */
  --uv-vhigh:    #ff3b30;  /* 8-10 非常に高い */
  --uv-extreme:  #af52de;  /* 11+  極端 */
}
:root.light {
  --bg:       #fff7ee;
  --panel:    #ffffff;
  --panel2:   #fdf1e3;
  --border:   #f0dcc6;
  --accent:   #e8730c;
  --accent2:  #d99a00;
  --text:     #2a2018;
  --text2:    #8a7560;
  --glow:     0 0 14px rgba(232,115,12,.25);
  --tip-bg:   rgba(255,255,255,.97);
  --leg-bg:   rgba(255,255,255,.93);
  --card-bg:  rgba(253,241,227,.9);
}

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

body {
  font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 58px calc(100vh - 58px);
  transition: background .35s, color .35s;
}

/* ══ HEADER ══ */
header {
  grid-column: 1/-1;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: relative; z-index: 1000;
}
header::after {
  content:''; position:absolute; bottom:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg,transparent,var(--accent),var(--accent2),transparent);
  background-size: 200% 100%; animation: hline 4s linear infinite;
}
@keyframes hline { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.logo { display:flex; align-items:baseline; gap:2px; font-weight:800; font-size:22px; letter-spacing:-.5px; }
.logo-coco { color: var(--text); }
.logo-uv   { color: var(--accent); text-shadow: var(--glow); }
.logo-sub  { font-family:'Share Tech Mono',monospace; font-size:10px; color:var(--text2); letter-spacing:1px; margin-left:8px; }
.header-right { display:flex; align-items:center; gap:10px; }
.nav-link {
  display:flex; align-items:center; gap:5px; background:transparent;
  border:1px solid var(--border); border-radius:20px; padding:4px 13px;
  font-family:'Share Tech Mono',monospace; font-size:10px; color:var(--text2);
  letter-spacing:1px; text-decoration:none; transition:all .2s;
}
.nav-link:hover { border-color:var(--accent); color:var(--accent); }
.live-badge {
  display:flex; align-items:center; gap:6px; font-family:'Share Tech Mono',monospace;
  font-size:11px; color:var(--accent); letter-spacing:1px;
}
.live-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); box-shadow:0 0 8px var(--accent); animation:blink 1.4s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
#theme-btn {
  display:flex; align-items:center; gap:5px; background:transparent;
  border:1px solid var(--border); border-radius:20px; padding:5px 12px;
  color:var(--text2); font-size:12px; cursor:pointer; transition:all .2s; font-family:inherit;
}
#theme-btn:hover { background:var(--accent); color:var(--bg); border-color:var(--accent); }

/* ══ SIDEBAR ══ */
aside {
  background: var(--panel); border-right:1px solid var(--border);
  overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:16px;
}
.search-box { position:relative; }
.search-box input {
  width:100%; padding:11px 14px; border-radius:12px; border:1px solid var(--border);
  background:var(--panel2); color:var(--text); font-size:14px; font-family:inherit; outline:none; transition:border-color .2s;
}
.search-box input:focus { border-color:var(--accent); box-shadow:var(--glow); }
.search-results {
  position:absolute; top:calc(100% + 4px); left:0; right:0; background:var(--panel);
  border:1px solid var(--border); border-radius:12px; max-height:260px; overflow-y:auto;
  z-index:50; display:none; box-shadow:0 8px 24px rgba(0,0,0,.3);
}
.search-results.open { display:block; }
.search-item { padding:10px 14px; cursor:pointer; font-size:13px; border-bottom:1px solid var(--border); transition:background .15s; }
.search-item:last-child { border-bottom:none; }
.search-item:hover { background:var(--panel2); }
.search-item .si-pref { color:var(--text2); font-size:11px; margin-left:6px; }

.now-card {
  background:var(--card-bg); border:1px solid var(--border); border-radius:16px; padding:18px; text-align:center;
}
.now-card-city { font-size:15px; font-weight:700; margin-bottom:4px; }
.now-card-val { font-size:52px; font-weight:900; line-height:1; margin:6px 0; font-family:'Outfit',sans-serif; }
.now-card-level { display:inline-block; padding:4px 14px; border-radius:20px; font-size:13px; font-weight:700; color:#fff; }
.now-card-advice { font-size:12px; color:var(--text2); margin-top:10px; line-height:1.6; }

.sb-head { font-size:12px; color:var(--text2); font-family:'Share Tech Mono',monospace; letter-spacing:1px; text-transform:uppercase; margin-bottom:-6px; }
#uv-list { display:flex; flex-direction:column; gap:6px; }
.uv-row {
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px;
  background:var(--panel2); cursor:pointer; transition:transform .12s;
}
.uv-row:hover { transform:translateX(3px); }
.uv-badge { width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-weight:800; color:#fff; font-size:15px; flex-shrink:0; }
.uv-row-name { font-size:13px; font-weight:600; flex:1; }
.uv-row-pref { font-size:10px; color:var(--text2); }
.status-bar { font-size:11px; color:var(--text2); font-family:'Share Tech Mono',monospace; padding-top:6px; border-top:1px solid var(--border); }

/* ══ MAP ══ */
.map-wrap { position:relative; }
#map { position:absolute; inset:0; background:var(--bg); }
.leaflet-container { background:var(--bg); }

.uv-legend {
  position:absolute; bottom:20px; right:16px; background:var(--leg-bg); backdrop-filter:blur(8px);
  border:1px solid var(--border); border-radius:12px; padding:12px 14px; z-index:500; font-size:12px;
}
.uv-legend-title { font-family:'Share Tech Mono',monospace; font-size:10px; color:var(--text2); letter-spacing:1px; margin-bottom:8px; text-transform:uppercase; }
.uv-legend-row { display:flex; align-items:center; gap:8px; margin:4px 0; }
.uv-legend-dot { width:14px; height:14px; border-radius:4px; }

/* UV円マーカー */
.uv-marker { border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; border:2px solid rgba(255,255,255,.85); box-shadow:0 2px 8px rgba(0,0,0,.4); font-family:'Outfit',sans-serif; }
.leaflet-popup-content-wrapper { background:var(--tip-bg); color:var(--text); border-radius:12px; }
.leaflet-popup-tip { background:var(--tip-bg); }
.uv-popup { text-align:center; min-width:150px; font-family:'Outfit','Zen Kaku Gothic New',sans-serif; }
.uv-popup-city { font-size:15px; font-weight:700; margin-bottom:4px; }
.uv-popup-val { font-size:34px; font-weight:900; line-height:1; }
.uv-popup-level { font-size:12px; font-weight:700; padding:2px 10px; border-radius:12px; color:#fff; display:inline-block; margin-top:4px; }

/* ══ RESPONSIVE ══ */
@media (max-width:900px) {
  body { grid-template-columns:1fr; grid-template-rows:58px 300px 1fr; }
  aside { border-right:none; border-bottom:1px solid var(--border); flex-direction:column; }
  .map-wrap { min-height:60vh; }
  .logo-sub { display:none; }
}

/* ══ SEOコンテンツ（地図下・indexで使用） ══ */
.seo-section { grid-column:1/-1; background:var(--panel); border-top:1px solid var(--border); padding:40px 22px; }
.seo-inner { max-width:820px; margin:0 auto; }
.seo-inner h2 { font-size:22px; margin:28px 0 12px; color:var(--accent); }
.seo-inner h3 { font-size:17px; margin:20px 0 8px; }
.seo-inner p { line-height:1.9; color:var(--text2); margin-bottom:12px; }
.seo-inner ul { margin:0 0 14px 20px; color:var(--text2); line-height:1.9; }
.uv-table { width:100%; border-collapse:collapse; margin:16px 0; font-size:14px; }
.uv-table th, .uv-table td { border:1px solid var(--border); padding:9px 12px; text-align:left; }
.uv-table th { background:var(--panel2); }
footer { grid-column:1/-1; background:var(--panel); border-top:1px solid var(--border); padding:24px 22px; text-align:center; color:var(--text2); font-size:12px; }
footer a { color:var(--text2); text-decoration:none; margin:0 8px; }
footer a:hover { color:var(--accent); }
