/* hakyujiko-stats/style.css */

.main-header {
    position: static;
    margin-bottom: 24px;
    background-color: #01894d; /* シン・電気保安統計カラー */
    border-bottom: 2px solid #f39800; /* オレンジボーダー */
}

.main-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px; /* リファレンスに合わせる */
    margin: 0 auto;
    padding: 0.75rem 1rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.title-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.brand-logo {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap; /* 改行を防止 */
}

.header-nav {
    display: flex;
    gap: 10px;
}

.header-link {
    padding: 6px 16px;
    border-radius: 20px; /* ピル型 */
    text-decoration: none;
    font-size: 13.6px;
    font-weight: 600;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.15);
    border: 0.67px solid rgba(255, 255, 255, 0.4);
    color: #ffffff !important;
}

.header-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.container {
    margin-top: 0;
}

.map-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

#map {
    width: 100%;
    height: 600px;
    background: #dbeafe; /* 海の色（淡い水色） */
    border-radius: var(--radius);
    margin-top: 15px;
    border: 1px solid var(--border-color);
}

.map-legend {
    background: rgba(255, 255, 255, 0.98);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    line-height: 1.6;
    font-size: 0.85rem;
    font-weight: 700;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px; /* 四角形に */
    border: 1px solid rgba(0,0,0,0.1);
}

.color-today { background-color: #ff4d4d; }
.color-yesterday { background-color: #ffcc00; }
.color-other { background-color: #3498db; }

.leaflet-container {
    background: #dbeafe !important;
}

.bubble-label {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 900;
    font-size: 1.25rem;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(0,0,0,1), 0 0 3px rgba(0,0,0,1), 0 1px 2px rgba(0,0,0,1);
}

.choropleth-label span {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pref-name-label {
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 900;
    text-align: center;
    pointer-events: none;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    text-shadow: 0 0 4px rgba(255,255,255,1), 0 0 4px rgba(255,255,255,1), 0 0 4px rgba(255,255,255,1);
}

.choropleth-pref-label {
    margin-top: 4px;
}

.external-link {
    color: var(--brand-green);
    text-decoration: none;
    font-weight: 600;
}

.external-link:hover {
    text-decoration: underline;
}

/* Sidebar Info */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-orange);
}

.details-panel {
    flex-grow: 1;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
}

.outage-item {
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--bg-color);
    margin-bottom: 1rem;
    border-left: 4px solid var(--brand-orange);
    box-shadow: var(--shadow-sm);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Table Section */
.table-section {
    margin-top: 2rem;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.outage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    background: white;
}

.outage-table th {
    background-color: #f8fafb;
    color: var(--text-muted);
    font-weight: 700;
    padding: 12px 15px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.outage-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.outage-table tr:hover {
    background-color: var(--accent-color);
}

.row-today {
    background-color: rgba(255, 77, 77, 0.1) !important;
}
.row-today .time-cell {
    color: #ff4d4d;
    font-weight: 700;
}

.row-yesterday {
    background-color: rgba(255, 204, 0, 0.1) !important;
}
.row-yesterday .time-cell {
    color: #b38f00;
    font-weight: 600;
}

.row-other {
    background-color: rgba(52, 152, 219, 0.08) !important;
}
.row-other .time-cell {
    color: #3498db;
    font-weight: 600;
}

.outage-table .time-cell {
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.outage-table .place-cell {
    min-width: 250px;
    line-height: 1.4;
}

.outage-table .scale-cell {
    white-space: nowrap;
    font-weight: 600;
    color: var(--brand-orange);
}

@media (max-width: 640px) {
    .outage-table {
        font-size: 0.8rem;
    }
    .outage-table th, .outage-table td {
        padding: 10px;
    }
}

.refresh-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    color: var(--text-muted);
}

.refresh-btn.active {
    background: #01894d;
    color: white;
    border-color: #01894d;
    box-shadow: 0 2px 4px rgba(1, 137, 77, 0.2);
}

.refresh-btn:hover {
    filter: brightness(0.95);
}

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