/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ヘッダー */
header {
    background-color: #003366;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin-bottom: 0.5rem;
}

.current-time {
    font-size: 1rem;
    opacity: 0.8;
}

/* メインコンテンツ */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    main {
        grid-template-columns: 1fr 1fr;
    }
}

/* 地図コンテナ */
.map-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#map {
    width: 100%;
    height: 500px;
    background: #e8e8e8;
}

.map-controls {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auto-refresh {
    display: flex;
    align-items: center;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.auto-refresh-toggle input {
    margin-right: 0.5rem;
}

.auto-refresh-text {
    font-size: 0.9rem;
}

.last-update {
    font-size: 0.85rem;
    color: #666;
    margin-left: 1rem;
}

.updated {
    animation: highlight 1s ease-in-out;
}

@keyframes highlight {
    0% { color: #666; }
    50% { color: #009900; font-weight: bold; }
    100% { color: #666; }
}

button {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

button:hover {
    background-color: #0055aa;
}

select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* 地震リスト */
.earthquake-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.earthquake-list h2 {
    padding: 1rem;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.filter-controls {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid #eee;
}

.list-container {
    max-height: 400px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f8f8;
    font-weight: 600;
}

tr:hover {
    background-color: #f9f9f9;
}

#loading {
    padding: 2rem;
    text-align: center;
    display: none;
}

.error-message {
    padding: 1rem;
    color: #cc0000;
    text-align: center;
    display: none;
}

/* マグニチュードに応じた色付け */
.magnitude-1, .magnitude-2 {
    background-color: #a3f7bf;
}

.magnitude-3 {
    background-color: #fff7a3;
}

.magnitude-4 {
    background-color: #ffcf7a;
}

.magnitude-5 {
    background-color: #ffaa7a;
}

.magnitude-6-plus {
    background-color: #ff7a7a;
}

/* 震度表示のスタイル */
td:nth-child(3) {
    font-weight: bold;
    text-align: center;
}

/* 震度に応じた色付け */
.shindo-0, .shindo-1 {
    color: #008800;
}

.shindo-2, .shindo-3 {
    color: #aaaa00;
}

.shindo-4, .shindo-5w {
    color: #ff8800;
}

.shindo-5s, .shindo-6w {
    color: #ff0000;
}

.shindo-6s, .shindo-7 {
    color: #cc0000;
    font-size: 1.1em;
}

/* フッター */
footer {
    background-color: #f0f0f0;
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid #ddd;
}

footer p {
    margin-bottom: 0.5rem;
}

/* 地図のマーカーポップアップ */
.leaflet-popup-content {
    font-size: 0.9rem;
}

.popup-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.popup-info {
    margin-bottom: 0.3rem;
}
