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

/* Global */
/* Global Reset: 画面が見切れる問題の多くを解決します */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Roboto Mono', monospace; /* NERV-like font */
    margin: 0;
    padding: 0;
    /* 変更/追加 */
    background-image: url('stripe-min.png');
    background-repeat: repeat; /* 画像を繰り返して埋める */
    /* ここから下は既存のプロパティ */
    background-color: #0d1117; /* Very dark NERV background */
    color: #00ff41; /* Neon green text */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
/*
.hidden {
    display: none !important;
}*/

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.0rem;
    flex: 1;
    display: flex;
    width: 100%;
}

/* Header */
.main-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.75rem;
    background-image: url('stripe-min3.png');
    background-repeat: repeat; /* 画像を繰り返して埋める */
    background-color: #1a1a2e; /* Darker NERV header background */
    border-bottom: 2px solid #ff004f; /* Neon red accent */
    box-shadow: 0 2px 10px rgba(0, 255, 65, 0.2); /* Green glow */
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff004f; /* Neon red for logo */
    display: flex;
    align-items: center;
    text-shadow:
      0 0 5px rgba(255, 0, 79, 0.8); /* Red glow */
}
.update-button {
    background-color: transparent;
    color: #00ff41; /* Neon green text */
    border: 1px solid #00ff41; /* Neon green border */
    padding: 0.6rem 1.2rem;
    border-radius: 4px; /* Sharper corners */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.5); /* Green glow */
}
.update-button:hover {
    background-color: rgba(0, 255, 65, 0.1); /* Subtle green hover */
    color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.8);
}

/* Main Layout: Map on top, List below */
.sidebar-map-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.0rem;
    width: 100%;
    height: 100%;
    flex: 1;
}

.map-section {
    display: flex;
    flex-direction: column;
    order: 1;
    flex: 1;
    min-height: 400px;
}

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

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

/* Section Headings */
.stats-section h2,
.legend-section h2,
.list-section h2,
.map-section h2 {
    margin-top: 0;
    color: #00ff41; /* Neon green headings */
    border-left: 4px solid #ff004f; /* Neon red accent */
    padding-left: 12px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5); /* Green glow */
}
.map-section h2 {
    display: none; /* Hide for map section, map takes up all space */
}

/* Stats */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.7rem;
    margin-top: 0.7rem;
}
.stat-card {
    background: #0d1117; /* Even darker card background */
    color: #e0e0e0;
    padding: 0.8rem 0.4rem;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2); /* Green glow */
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 255, 65, 0.5);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.8);
}
.stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 0.2rem;
    color: #e0e0e0;
}
.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff004f; /* Neon red for stats */
    text-shadow: 0 0 5px rgba(255, 0, 79, 0.7);
    /* digit */
    font-family: 'Digital Numbers', 'Roboto Mono', monospace;
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e0e0e0; /* Light text for legend items */
}
.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    border: 0.7px solid #edffff;
}

/* Earthquake List */
.list-header-with-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.list-section h2 {
    margin-bottom: 0;
}

.list-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.earthquake-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 0.5rem;
}
/* Custom scrollbar for NERV theme */
.earthquake-list::-webkit-scrollbar {
    width: 8px;
}
.earthquake-list::-webkit-scrollbar-thumb {
    background-color: #ff004f; /* Neon red scrollbar */
    border-radius: 4px;
}
.earthquake-list::-webkit-scrollbar-track {
    background-color: #1a1a2e; /* Darker track */
    border-radius: 4px;
}

.earthquake-card {
    background: #0d1117; /* Dark card background */
    
    background-image:
      linear-gradient(rgba(255, 125, 59, 0.01), rgba(255, 235, 100, 0.07)),
      url('stripe-min4.png');
      opacity: 0.9;
    background-repeat: repeat;
    
    color: #e0e0e0;
    border-radius: 4px;
    padding: 0.6rem;
    border-left: 4px solid #00ff41; /* Default neon green border */
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.3); /* Green glow */
}
.earthquake-card:hover {
    transform: translateY(-3px);
    background: #1a1a2e; /* Slightly lighter dark on hover */
  
    background-image:
      linear-gradient(rgba(255, 125, 59, 0.08), rgba(255, 235, 100, 0.1)),
      url('stripe-min4.png');
      opacity: 0.8;
    background-repeat: repeat;
    
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.8); /* Stronger green glow */
}

/* List Item Color Coding - NERV style */
.earthquake-card.red { border-left-color: #ff004f; } /* today - Neon Red */
.earthquake-card.orange { border-left-color: #ff7f00; } /* yesterday - Neon Orange */
.earthquake-card.darkgreen { border-left-color: #00ff41; } /* day-before - Neon Green */
.earthquake-card.green { border-left-color: #00ff41; } /* week - Neon Green */
.earthquake-card.purple { border-left-color: #9b59b6; } /* two-weeks - Purple (can be adjusted) */
.earthquake-card.blue, .earthquake-card.gray { border-left-color: #00fff2; } /* older/unknown - Cyan */

.eq-title {
    font-weight: bold;
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
    color: #ff0537; /* #ff004f; #e0e0e0; */
}
/* Earthquake List Location - 青白く光るエフェクトを追加 */
.eq-location {
    font-size: 0.65rem;
    /* 元の色から青白に変更 */
    /*  color: #b0b0b0; */
    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.4),/* ぼかした弱い光 */
        0 0 10px rgba(255, 255, 255, 0.3);
    /* ------------------------------------------- */
}
.eq-mag {
    color: #ff7f00; /* Neon orange for magnitude */
    font-weight: bold;
    font-size: 1.0rem;
    text-shadow: 0 0 5px rgba(255, 127, 0, 0.7);
    /* digit */
    font-family: 'Digital Numbers', 'Roboto Mono', monospace;
}
.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.7); 
    padding: 5px 4px; /* 見栄えを良くするためのパディング */
    display: inline-block; /* パディングと背景色がテキスト幅に合わせるように */
}

/* Map Section */
.map-container {
    flex: 1;
    height: auto;
    
    background-image:
      linear-gradient(rgba(255, 125, 59, 0.1), rgba(255, 235, 100, 0.2)),
      url('stripe-min4.png');
      /* opacity: 0.9; */
    background-repeat: repeat; /* 画像を繰り返して埋める */
    min-height: 500px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3); /* Green glow */
    border: 1px solid #00ff41;
}
#map {
    background-image:
      url('stripe-min.png');
      /* opacity: 0.3; */
    
    background-repeat: repeat; /* 画像を繰り返して埋める */
    /* height: 100%; */
    height: 85vh !important;
    width: 100%;
    z-index: 1;
}

/* Loading/Spinner */
.animate-spin-slow {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Leaflet Custom Icons --- */

.quake-icon {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.store-icon {
    /* 背景色: 薄い黄色 (ほぼ白) - 輝きの本体 */
    background-color: #ffee99; /* 現在の #fffdc9 よりも少し白っぽい黄色 */
    
    /* 境界線: 非常に薄い黄色で細く (輝きに溶け込ませる) */
    border: 0.9px solid #fffff0; 
    
    border-radius: 50%;
    color: #fffdc9; /* アイコン内の文字色を暗くして、薄い背景色に合うように調整 */
    
    /* ★★★ 輝きの調整 ★★★ */
    box-shadow: 
        0 0 5px rgba(255, 255, 200, 0.6), /* 中心に近い輝き (薄い黄色、60%不透明) */
        0 0 10px rgba(255, 255, 255, 0.3); /* 外側のうっすらとした拡散 (白、30%不透明) */
    /* ★★★ ---------------- ★★★ */
    
    width: 10px !important;
    height: 10px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
    /* 不透明度: 70% を維持して「うっすら」感を出す */
    opacity: 0.7; 
}

/* ホバー時の設定 (任意: 触れたら強く光る) */
.store-icon:hover {
    box-shadow: 
        0 0 8px rgba(255, 255, 200, 0.9), 
        0 0 15px rgba(255, 255, 255, 0.6);
    opacity: 1.0;
}
/* .store-icon {
    background-color: #fffdc9;
    border: 0.9px solid #edffff;
    border-radius: 50%;
    color: white;
    box-shadow: 0 0 7px rgba(240,250,240,0.4);
    width: 10px !important;
    height: 10px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0.7;
}
*/

/* Responsive - Map always on top */
@media (min-width: 1024px) {
    .sidebar-map-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1023px) {
    .sidebar-map-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-header { 
        flex-direction: column;
        padding: 0.75rem 1rem;
    }
    .header-controls {
        margin-top: 0.5rem;
    }
    .logo { font-size: 1.5rem; }
    .stats-cards { grid-template-columns: 1fr 1fr; }
    .earthquake-list { grid-template-columns: 1fr; }
    .map-container { height: 400px; }
}
/* NERV Theme Enhancement: CRT Scanlines */
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), /* Darker line */
            rgba(0, 0, 0, 0.2) 0.6px, /* More pronounced dark line */
            transparent 2px, 
            transparent 4px
        );
    z-index: 9999; /* Ensure it's on top */
    opacity: 0.4; /* Subtle visibility */
}
/* --- 主要拠点 (Store) ポップアップのカスタムスタイル --- */

/* ポップアップのコンテナをターゲットにし、背景色を変更 */
/* 地震情報と区別するため、特定のマーカークラスのポップアップのみをターゲットにしたいが、 */
/* Leafletではマーカーの種類ごとにポップアップのクラスを自動で分ける機能がないため、 */
/* 以下のセレクタは全てのポップアップに影響を与えます。 */
/* ただし、もし全てのストアデータに特定のクラスを付与できるなら、そのクラスを親要素として使用できます。*/
/* ここでは、全てのポップアップに適用される前提で記述します。 */
/* --- Leaflet 標準スタイルを上書きするための高優先度 CSS --- */
/* --- Leaflet 標準スタイルを上書きするための高優先度 CSS --- */
/* --- Leaflet 標準スタイルを上書きするための高優先度 CSS --- */

.leaflet-popup-content-wrapper {
    /* 1. 背景色を透明にして、グラデーションの透過レイヤーを活かす */
    background-color: transparent !important; 
    
    /* 2. backgroundプロパティで、複数のレイヤーを定義 */
    background: 
        /* 第1レイヤー: 半透明の黄色 (opacity: 0.8) を全体に重ねる */
        linear-gradient(rgba(255, 125, 59, 0.1), rgba(255, 235, 59, 0.25)) !important;
        /* 第2レイヤー: ストライプ画像を読み込み、リピート */
        url('stripe-min4.png');
        
    /* 3. 画像の繰り返し設定 */
    background-repeat: repeat !important;
    /* background-size: auto !important; */

    /* その他は維持 */
    color: #ffeb3b !important;      
    border-radius: 6px;
    /* border: 1px solid #ff004f !important;// neon red */
    border: 1px solid rgba(0, 255, 255, 0.6) !important;
    box-shadow: 0 3px 14px rgba(0,0,0,0.8); 
}

/* 先端の三角形は背景色を維持 */
.leaflet-popup-tip {
    background: #e74c3c !important; 
}

/* ポップアップ内の見出しのスタイル調整 */
.leaflet-popup-content h4 {
    /* 警告色として、見出しは強めのオレンジ/赤系を維持 */
    color: #fffdc9  !important; /* #e74c3c */ 
    border-bottom: 2px solid #FF073A !important; 
}

/* --- マグニチュード・レベルメーター（プログレスサークル式）のスタイル --- */

.eq-mag {
    position: relative;
    display: inline-flex; /* 数字とメーターを横並びにする */
    align-items: center;
    gap: 10px; /* 数字とメーターの間隔 */
    /* 既存のスタイルを維持 (color, font-size, text-shadowなど) */
}

/* プログレスサークル全体のコンテナ */
.mag-progress-circle {
    position: relative;
    width: 30px; /* 円の幅 */
    height: 30px; /* 円の高さ */
    border-radius: 50%;
    /* ベースとなるリング（空の部分）: */
    background: rgba(0, 255, 65, 0.1); 
    
    /* JavaScriptでconic-gradientがインラインで適用されます */
    /* 満たされた部分のシャドウはグリーン系に変更 */
    box-shadow: 0 0 4px rgba(0, 255, 65, 0.6);
    /* ★★★ 重要な変更: ドーナツの穴を作るための設定 ★★★ */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* ベースとなるリング（空の部分） 
    background: rgba(255, 127, 0, 0.1); 
    /* JavaScriptでconic-gradientがインラインで適用されます 
    box-shadow: 0 0 3px rgba(255, 127, 0, 0.7); /* 弱いネオン光 */
}

/* ドーナツの穴 (::after) */
.mag-progress-circle::after {
    content: '';
    position: absolute;
  
    width: 20px; /* 穴のサイズ (円のサイズに応じて調整) */
    height: 20px;
    border-radius: 50%;
    /* 背景色（穴の色）はコンテナ（黒背景）と合わせる */
    background: #1a1a2e; /* 仮の背景色。リストの背景色に合わせてください */
    z-index: 2;
}
/* 
/* --- マグニチュード・レベルメーター（本数式）のスタイル --- 

.eq-mag {
    position: relative;
    display: inline-flex; /* 数字とメーターを横並びにする 
    align-items: center;
    gap: 8px; /* 数字とメーターの間隔 
    /* 既存のスタイルを維持 
}

/* レベルメーター全体のコンテナ 
.mag-level-meter {
    display: flex;
    align-items: flex-end; /* 棒が下揃えになるように 
    height: 12px; /* メーター全体の高さ 
    width: auto; /* 棒の数に応じて幅が変わる 
    gap: 1px; /* 各セグメント間のスペース 
    padding: 1px 0;
}

/* 個々のセグメント（棒）のスタイル 
.mag-segment {
    /* 棒のベースサイズ 
    width: 3px;
    background-color: rgba(255, 127, 0, 0.2); /* 空のセグメントの背景色 
    border-radius: 1px;
    transition: background-color 0.5s ease;
}

/* 棒の高さの段階的な設定 
.mag-segment:nth-child(1) { height: 4px; }
.mag-segment:nth-child(2) { height: 5px; }
.mag-segment:nth-child(3) { height: 6px; }
.mag-segment:nth-child(4) { height: 7px; }
.mag-segment:nth-child(5) { height: 8px; }
.mag-segment:nth-child(6) { height: 9px; }
.mag-segment:nth-child(7) { height: 10px; }
.mag-segment:nth-child(8) { height: 12px; } /* 最大レベル 


/* 満たされたセグメントのスタイル 
.mag-segment.filled {
    background-color: #ff7f00; /* Neon Orangeで満たす 
    box-shadow: 0 0 3px rgba(255, 127, 0, 0.7); /* 弱いネオン光 
}
 */