@import url('https://fonts.cdnfonts.com/css/digital-numbers');

/* --- Global Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

html { height: 100%; }

body {
    font-family: 'Roboto Mono', monospace;
    margin: 0;
    padding: 0;
    background-image: url('stripe-min.png');
    background-repeat: repeat;
    background-color: #0d1117;
    color: #00ff41;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* CRT Scanline */
body::before {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.15) 0.6px, transparent 2px, transparent 4px);
    z-index: 9999; opacity: 0.3;
}

/* --- Header --- */
.main-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
    background-image: url('stripe-min3.png');
    background-repeat: repeat;
    background-color: #1a1a2e;
    border-bottom: 2px solid #ff004f;
    box-shadow: 0 2px 10px rgba(0, 255, 65, 0.2);
}
.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff004f;
    display: flex;
    align-items: center;
    text-shadow: 0 0 5px rgba(255, 0, 79, 0.8);
}

/* --- Layout: Map Top --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    flex: 1;
    display: flex;
    width: 100%;
}

.sidebar-map-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0rem;
    width: 100%;
}

.map-section {
    order: 1;
    display: flex;
    flex-direction: column;
}

.sidebar {
    order: 2;
    display: flex;
    flex-direction: column;
}

/* --- Map Component --- */
.map-container {
    flex: 1;
    background-image: linear-gradient(rgba(255, 125, 59, 0.1), rgba(255, 235, 100, 0.2)), url('stripe-min2.png');
    background-repeat: repeat;
    min-height: 500px;
    height: 85vh !important;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    border: 1px solid #00ff41;
  
    /* --- アニメーションの追加 --- */
    /* 5秒かけて背景を右へループさせる (linearで一定速度) */
    animation: stripe-scroll-map 1.0s linear infinite;
    /* 背景画像のサイズを指定（画像自体のサイズに合わせて調整してください） */
    background-size: 5px 5px; 
}

/* 背景を動かす定義 */
@keyframes stripe-scroll-map {
    from {
        background-position: 0 0;
    }
    to {
        /* X軸を画像の幅分動かすことで無限ループに見せる */
        background-position: -10px -10px; 
    }
}

#map { height: 100% !important; width: 100%; z-index: 1; }

/* --- Sidebar Sections --- */
.sidebar > section {
    background-color: #1a1a2e;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.15);
    margin-bottom: 1.5rem;
    border: 1px solid #00ff41;
}

/* --- Legend & Stats --- */
.stats-cards { 
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.7rem;
  margin-top: 1.0rem !important;
  /* margin-bottom: 1.5rem; */
}
.stat-card {
    background: #0d1117;
    color: #e0e0e0;
  font-size: 0.6rem;
  font-weight: bold;
  font-family: 'Digital Numbers', 'Roboto Mono', monospace;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    border: 2px solid rgba(0, 255, 65, 0.5);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.stat-card:hover {
    transform: translateY(-3px);
    background-color: #1a1a2e !important;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.8);
}
.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff004f;
    font-family: 'Digital Numbers', sans-serif;
  text-shadow: 0 0 5px rgba(0, 50, 79, 1), 0 0 20px rgba(255, 0, 79, 0.6);
  margin-top: 0.3rem;
}

.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; color: #e0e0e0; font-size: 0.9rem; }
.legend-dot { width: 16px; height: 16px; border-radius: 50%; border: 0.4px solid #edffff;}

/* --- Earthquake List --- */
/* ヘッダー全体を横並びにする（タイトルとボタン群を分ける） */
.list-header {
    display: flex !important;
    flex-direction: row !important; /* 横並びを強制 */
    justify-content: space-between !important; /* タイトルは左、ボタンは右 */
    align-items: center !important;
    margin-bottom: 1rem;
    width: 100%;
}

/* 親コンテナをFlexboxにして、タイトルとボタンを左右に振り分ける */
.list-header-with-pagination {
    display: flex !important;
    justify-content: space-between !important; /* タイトル(h2)を左、ボタン(div)を右 */
    align-items: center !important; /* 上下中央揃え */
    width: 100%;
    margin-bottom: 1rem;
}

/* タイトルの余計なマージンを消して高さを揃える */
.list-header-with-pagination h2 {
    margin: 0 !important;
}

/* ボタンを包むコンテナを横並びに固定 */
.list-pagination {
    display: flex !important;
    gap: 10px !important; /* NEXTとPREVの間の隙間 */
}

/* ボタンがJSで表示された際、縦にならないよう固定 */
.list-pagination .update-button {
    display: inline-block !important; /* もしJSがblockを指定してもinline-blockで上書き */
    white-space: nowrap !important;
}

.earthquake-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.earthquake-card {
    background: #0d1117;
    background-image:
      linear-gradient(
      rgba(255, 125, 59, 0.01), rgba(255, 235, 100, 0.08)),
      url('stripe-min4.png');
    background-repeat: repeat;
    color: #e0e0e0;
    border-radius: 4px;
    padding: 0.6rem;
    border-left: 4px solid #00ff41;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.earthquake-card:hover {
    transform: translateX(5px);
    background-color: #1a1a2e !important;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.8);
}

/* ★ バーの色分け：元のCSSセレクタを完全復元 ★ */
.earthquake-card.red { border-left-color: #ff004f; }
.earthquake-card.orange { border-left-color: #ff7f00; }
.earthquake-card.darkgreen { border-left-color: #00ff41; }
.earthquake-card.green { border-left-color: #00ff41; }
.earthquake-card.purple { border-left-color: #9b59b6; }
.earthquake-card.blue, .earthquake-card.gray { border-left-color: #00fff2; }

/* --- 文字スタイル --- */
.eq-title {
    font-weight: bold;
    font-size: 0.60rem;
    font-family: 'Digital Numbers', 'Roboto Mono', monospace;
    text-shadow: 0 0 5px rgba(255, 0, 79, 0.8);
    margin-bottom: 0.15rem;
    color: #ff0537;
}

.eq-country {
    font-weight: 900;
    font-size: 0.60rem;
    font-family: 'Digital Numbers', sans-serif;
    text-shadow: -4px 4px 10px rgba(0, 10, 10, 1);
    margin-bottom: 0.15rem;
    background-color: rgba(0, 0, 0, 0.4);
    background-image: url('stripe-min2.png');
    background-repeat: repeat;
    opacity: 0.8;
    padding: 2px 5px;
    color: #ff0537;

    text-align: right;       /* テキストを右に寄せる */
    display: block;          /* 横幅いっぱいに広げて右端を確定させる */
    box-sizing: border-box;
  
    /* --- アニメーションの追加 --- */
    /* 5秒かけて背景を右へループさせる (linearで一定速度) */
    animation: stripe-scroll 0.8s linear infinite;
    /* 背景画像のサイズを指定（画像自体のサイズに合わせて調整してください） */
    background-size: 5px 5px; 
}

/* 背景を動かす定義 */
@keyframes stripe-scroll {
    from {
        background-position: 0 0;
    }
    to {
        /* X軸を画像の幅分動かすことで無限ループに見せる */
        background-position: -5px -5px; 
    }
}

.eq-location {
    font-size: 0.65rem; color: #edffff; margin-bottom: 0.1rem;
    text-shadow: 0 0 4px rgba(204, 255, 242, 0.7), 0 0 8px rgba(204, 255, 242, 0.6);
}

/* 日付 : オレンジ背景に白グロー */
/*
.eq-datetime {
    color: #ffffff;
    font-weight: bold;
    font-size: 0.65rem;
    font-family: 'Digital Numbers', sans-serif;
    background-color: rgba(255, 127, 0, 0.7);
    padding: 5px 4px;
    display: inline-block;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}
*/
.eq-datetime {
    color: black;/*#e74c3c;*/
    /*font-weight: bold;*/
    font-size: 0.65rem;
    /* digit */
    font-family: 'Digital Numbers', 'Roboto Mono', monospace;
    background-color: rgba(255, 127, 0, 0.6); 
    padding: 2px 7px; /* 見栄えを良くするためのパディング */
    /* display: inline-block; */ /* パディングと背景色がテキスト幅に合わせるように */
}

/* Status(ACTIVE) : オレンジ・極太ボールド */
.eq-mag {
    color: #ff7f00 !important;
    font-weight: 900 !important;
    font-size: 0.65rem !important;
    font-family: 'Digital Numbers', 'Roboto Mono', monospace !important;
    text-shadow: 0 0 10px rgba(255, 127, 0, 0.8), 0 0 20px rgba(255, 127, 0, 0.5) !important;
    margin-bottom: 0.15rem;
    display: inline-block;
}

/* --- Scrollbar & Button --- */
.earthquake-list::-webkit-scrollbar { width: 8px; }
.earthquake-list::-webkit-scrollbar-thumb { background-color: #ff004f; border-radius: 4px; }

h2 { 
    margin: 0;
    border-left: 4px solid #ff004f; 
    padding-left: 12px; 
    color: #00ff41; 
    font-size: 0.9rem; 
}

.update-button {
    background-color: transparent; 
    color: #00ff41; 
    border: 1px solid #00ff41;
    padding: 0.4rem 1.0rem; 
    font-weight: 600; 
    cursor: pointer;
    transition: all 0.3s;
}

.update-button:hover {
    background-color: rgba(0, 255, 65, 0.1) !important;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.8);
}

/* 1. ポップアップの外枠と背景 */
.leaflet-popup-content-wrapper {
    /* 背景色とグラデーション */
    background-color: transparent !important; 
    background: 
        linear-gradient(rgba(255, 125, 59, 0.15), rgba(255, 235, 59, 0.2)),
        url('stripe-min4.png') !important;
    background-repeat: repeat !important;
    background-size: auto !important;

    /* ボーダー（緑） */
    border: 1px solid #00ff41 !important; 
    border-radius: 6px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.8);

    /* 重要：ここで color を指定すると子要素が緑に引きずられやすいため、
       中身の色は下の .leaflet-popup-content で個別に完全固定します。
    */
}

/* 2. 先端の三角形（しっぽ） */
.leaflet-popup-tip {
    background: transparent !important;
    border-left: 1.1px solid #00ff41 !important;
    border-bottom: 1px solid #00ff41 !important;
    box-shadow: none !important;
}

/* 3. ポップアップ内の基本テキスト色（黄色っぽい白） */
.leaflet-popup-content,
.leaflet-popup-content p,
.leaflet-popup-content div {
    color: #fffdc9 !important; /* ここで緑への「引きずられ」を上書き */
    font-family: 'Roboto Mono', monospace;
}

/* 4. ラベル部分（COORD:, MAG: 等）: 元のグレー */
.leaflet-popup-content b, 
.leaflet-popup-content strong,
.leaflet-popup-content .label {
    color: #a0a0a0 !important; 
    font-weight: bold;
    text-shadow: none !important;
}

/* 5. 見出し（場所など）: 黄色っぽい白 + 赤下線 */
.leaflet-popup-content h4 {
    color: #fffdc9 !important; 
    border-bottom: 2px solid #FF073A !important;
    margin: 5px 0 8px 0;
    padding-bottom: 3px;
    display: block;
}

/* --- ポップアップ内の特定テキストのサイズ調整 --- */
/* 1. 「◤ Google Maps ◢」部分のサイズアップ */
/* aタグ（リンク）または特定のクラスとして実装されている場合を想定 */
.leaflet-popup-content a,
.leaflet-popup-content .map-link {
    font-size: 0.8rem !important; /* COORDより大きく設定 */
    color: color:#80c1ed !important;
    text-decoration: none;
    display: inline-block;
    margin-top: 5px;
}
.leaflet-popup-content a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

/* 2. ラベル部分（COORD:, MAG: 等）のサイズ固定（比較用） */
.leaflet-popup-content b, 
.leaflet-popup-content strong,
.leaflet-popup-content .label {
    color: #a0a0a0 !important; 
    font-size: 0.85rem !important; /* こちらは標準サイズに固定 */
    font-weight: bold;
    text-shadow: none !important;
}

/* 3. ポップアップ全体の基本サイズ設定 */
.leaflet-popup-content {
    color: #fffdc9 !important;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem; /* 全体のベース */
    max-height: 300px;    /* 画面を占領しない程度の高さに制限 */
    overflow-y: auto;     /* 溢れた分はスクロールさせる */
    /*padding-right: 10px;*/
}


/* 6. 閉じるボタン (x) */
.leaflet-popup-close-button {
    color: #00ff41 !important;
}

/* クラスタリング（丸）の中の数字の色を変更 */
.marker-cluster div span {
    color: #fffdc9 !important;
}
.marker-cluster div span {
    font-weight: bold;
    font-family: 'Roboto Mono', monospace;
}

.link-btn {
    text-decoration: none;
    font-size: 0.85rem;
    padding: 5px;
    border: 1px solid transparent;
    text-align: center;
}

.link-btn.time-table { color: #ff7f00; border-color: #ff7f00; }
.link-btn.earth { color: #00fff2; border-color: #00fff2; }
.link-btn.maps { color: #80c1ed; border-color: #80c1ed; }

.link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 8px currentColor;
}

/* map pointing clusters 10件以上の時：枠線をオレンジに */
/* ベースとなる円の形 */
.custom-cluster {
    width: 40px;
    height: 40px;
    background: rgba(13, 17, 23, 0.9);
    border: 2px solid #00ff41; /* デフォルトは緑枠 */
    border-radius: 50%;
    color: #00ff41;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Digital Numbers', monospace;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.4);
}
.custom-cluster.cluster-medium {
    border-color: #ff7f00;
    box-shadow: 0 0 12px rgba(255, 127, 0, 0.7);
}
/* 50件以上の時：枠線を赤の太線にし、ゆっくり点滅させる */
.custom-cluster.cluster-large {
    border-color: #ff004f;
    border-width: 3px;
    animation: pulse-border 2s infinite;
}
@keyframes pulse-border {
    0% { box-shadow: 0 0 10px rgba(255, 0, 79, 0.6); }
    50% { box-shadow: 0 0 20px rgba(255, 0, 79, 1); }
    100% { box-shadow: 0 0 10px rgba(255, 0, 79, 0.6); }
}

/* 
  1. 外枠：ネオンレッドのボーダー
.search-container {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #ff004f;  ネオンレッド 
    box-shadow: 0 0 10px rgba(255, 0, 79, 0.3);
    padding: 5px;
    font-family: 'Roboto Mono', monospace;
    overflow: hidden;  枠外にはみ出る文字を隠す 
    box-sizing: border-box;
}

  2. 入力欄：透明化とスクロール制御
#intel-search {
    position: relative;
    z-index: 2;
    width: 100%;
    background: transparent;
    border: none;
    color: transparent;  生の文字は隠す 
    caret-color: transparent;  デフォルトカーソル消去 
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.2;
    padding: 0;  親のpaddingがあるため0 
    margin: 0;
    white-space: nowrap;  1行に固定 
}

  3. 表示レイヤー：inputと全く同じ位置に配置
.cui-display {
    position: absolute;
    top: 5px;  親のpaddingと同じ値 
    left: 5px;  親のpaddingと同じ値 
    right: 5px;
    z-index: 1;
    pointer-events: none; /* 入力操作を邪魔しない 
    display: flex;
    overflow: hidden; /* はみ出し防止 
    white-space: pre;
}

 4. 表示文字色：オレンジ 
#cui-text {
    color: #ff7f00; /* オレンジ 
    text-shadow: 0 0 5px rgba(255, 127, 0, 0.5);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.2;
    /* 文字が長くなった時に左へ流すための設定 
    display: inline-block;
    flex-shrink: 0;
    white-space: pre;
}

 5. ブロックカーソル：オレンジ 
.cui-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background-color: #ff7f00;
    vertical-align: middle;
    margin-left: 2px;
    flex-shrink: 0;
    animation: blink-cursor 0.8s steps(2, start) infinite;
    box-shadow: 0 0 8px rgba(255, 127, 0, 0.8);
}

 点滅アニメーション 
@keyframes blink-cursor {
    to { visibility: hidden; }
} */


/* --- 検索窓：CUIレイヤー統合デザイン --- */

.search-container {
    position: relative;
    width: 100%;
    /* height: 40px; */
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #ff004f;
    box-shadow: 0 0 10px rgba(255, 0, 79, 0.3);
    padding: 8px; /* 少し広げて視認性向上 */
    font-family: 'Roboto Mono', monospace;
    overflow: hidden;
}

#intel-search {
    position: relative;
    z-index: 2;
    width: 100%;
    background: transparent;
    border: none;
    color: transparent; /* 生の文字を透明化 */
    caret-color: transparent; /* デフォルトカーソル非表示 */
    outline: none;
    font-size: 1rem;
    line-height: 1.2;
    padding: 0;
    margin: 0;
}

.cui-display {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 1;
    pointer-events: none;
    display: block; /* 文脈維持のためblock */
  white-space: nowrap;    /* 絶対に改行させない */
  overflow: hidden;
    /* white-space: pre-wrap;
    word-break: break-all; */
    font-family: inherit;
  line-height: 1.2;
}

#cui-text {
    color: #ff7f00;
    text-shadow: 0 0 5px rgba(255, 127, 0, 0.5);
    font-size: 1rem;
    line-height: 1.2;
}

/* 究極のブロックカーソル */
.cui-cursor {
    display: inline-block;
    width: 0.6em; /* 文字幅に合わせる */
    height: 1.1em;
    background-color: #ff7f00;
    vertical-align: text-bottom;
    margin-right: -0.6em; /* 背後の文字と重ねる（ターミナル風） */
    animation: blink-cursor 0.8s steps(2, start) infinite;
    will-change: opacity;
    box-shadow: 0 0 8px rgba(255, 127, 0, 0.8);
}

/* 範囲選択（ネガポジ反転） */
.cui-selected {
    background-color: #ff7f00;
    color: #000 !important;
    box-shadow: 0 0 5px #ff7f00;
}

@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* プレースホルダーの設定 */
/* プレースホルダーを点滅させる設定 */
#intel-search::placeholder {
    color: rgba(255, 0, 79, 0.6); /* ネオンレッド */
    font-size: 0.9rem;
    /* カーソルと同じ点滅アニメーションを適用 */
    animation: blink-cursor 1.2s steps(2, start) infinite;
}

/* 入力中（フォーカス時）は点滅を止める、または薄くしたい場合 */
#intel-search:focus::placeholder {
    animation: none;
    opacity: 0.3;
}


/* マーカーをゆっくり光らせるアニメーション */
.pulsing-marker {
    /* filterを使ってネオンのような光彩（ドロップシャドウ）を出す */
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
    animation: marker-glow 4s ease-in-out infinite;
    /* 中心を軸にアニメーションさせる設定 */
    transform-origin: center;
}

@keyframes marker-glow {
    0% {
        stroke-width: 1;
        stroke-opacity: 0.6;
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
    }
    50% {
        stroke-width: 4;     /* 外枠を太くして光を広げる */
        stroke-opacity: 1;
        /* 色付きの光を出す（マーカーの色に合わせたい場合は白が安定） */
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 1));
    }
    100% {
        stroke-width: 1;
        stroke-opacity: 0.6;
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
    }
}

.stats-info {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: #ff004f; /* ネオンレッド */
    text-shadow: 0 0 5px rgba(255, 0, 79, 0.5);
    margin-top: 5px;
    padding: 2px 10px;
    letter-spacing: 1px;
    border-top: 1px solid rgba(255, 0, 79, 0.3);
    text-transform: uppercase;
}
/* .pagination-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
 */
/* .cui-counter {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #ff7f00;
    text-shadow: 0 0 5px rgba(255, 127, 0, 0.5);
    letter-spacing: 1px;
    font-weight: bold;
} */