/* ============================================
   高尾山クマ出没トラッカー - メインスタイル
   ============================================ */

/* --- ステータスバー --- */
.tbt-status-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tbt-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tbt-status-icon { font-size: 24px; }

.tbt-status-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.tbt-status-updated {
    font-size: 12px;
    color: #6b7280;
    margin-left: auto;
}

.tbt-status-scope {
    font-size: 13px;
    line-height: 1.65;
    color: #4b5563;
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tbt-status-scope strong {
    color: #374151;
}

/* リスクゲージ */
.tbt-risk-gauge {
    margin: 16px 0;
    padding: 16px;
    border-radius: 8px;
}

.tbt-risk-gauge.tbt-risk-low { background: #f0fdf4; border: 1px solid #86efac; }
.tbt-risk-gauge.tbt-risk-medium { background: #fffbeb; border: 1px solid #fcd34d; }
.tbt-risk-gauge.tbt-risk-high { background: #fef2f2; border: 1px solid #fca5a5; }

.tbt-risk-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.tbt-risk-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.tbt-risk-low .tbt-risk-fill { width: 15%; background: #22c55e; }
.tbt-risk-medium .tbt-risk-fill { width: 50%; background: #eab308; }
.tbt-risk-high .tbt-risk-fill { width: 85%; background: #ef4444; }

.tbt-risk-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tbt-risk-level {
    font-size: 24px;
    font-weight: 800;
}

.tbt-risk-low .tbt-risk-level { color: #16a34a; }
.tbt-risk-medium .tbt-risk-level { color: #ca8a04; }
.tbt-risk-high .tbt-risk-level { color: #dc2626; }

.tbt-risk-text {
    font-size: 14px;
    color: #4b5563;
}

.tbt-risk-message {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0;
}

/* 統計カード */
.tbt-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 16px 0;
}

@media (max-width: 600px) {
    .tbt-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.tbt-stat-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.tbt-stat-number {
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.2;
}

.tbt-stat-number.tbt-stat-date { font-size: 16px; }
.tbt-stat-number.tbt-stat-alert { color: #dc2626; }
.tbt-stat-number.tbt-stat-warn { color: #ca8a04; }
.tbt-stat-unit { font-size: 14px; font-weight: 400; margin-left: 2px; }

.tbt-stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* アラートバナー */
.tbt-alert-banner {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
}

.tbt-alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.tbt-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.tbt-alert-safe { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }

/* --- 地図 --- */
.tbt-map-wrapper {
    margin: 24px 0;
}

.tbt-map-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.tbt-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tbt-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    transition: all 0.15s;
}

.tbt-btn:hover { background: #f3f4f6; }

.tbt-btn.active {
    background: #1f2937;
    color: #fff;
    border-color: #1f2937;
}

.tbt-map-legend {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
    flex-wrap: wrap;
}

.tbt-legend-item { display: flex; align-items: center; gap: 4px; }

.tbt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.tbt-dot-red { background: #ef4444; }
.tbt-dot-orange { background: #f97316; }
.tbt-dot-blue { background: #3b82f6; }
.tbt-dot-gray { background: #94a3b8; }

#tbt-map {
    border: 1px solid #e5e7eb;
}

.tbt-map-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.tbt-map-hint {
    font-size: 12px;
    color: #6b7280;
}

.tbt-map-count {
    font-size: 12px;
    color: #9ca3af;
    margin-left: auto;
}

/* --- チャート --- */
.tbt-chart-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.tbt-chart-wrapper .tbt-chart-note {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 16px;
    line-height: 1.5;
}

.tbt-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
}

/* --- テーブル --- */
.tbt-list-wrapper {
    margin: 24px 0;
}

.tbt-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tbt-sighting-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.tbt-sighting-table th {
    background: #f9fafb;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.tbt-sighting-table th:nth-child(1) { width: 70px; }
.tbt-sighting-table th:nth-child(2) { width: 30%; }
.tbt-sighting-table th:nth-child(3) { width: 52px; }
.tbt-sighting-table th:nth-child(5) { width: 80px; }

.tbt-sighting-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
    vertical-align: top;
    word-break: break-word;
}

.tbt-sighting-table tbody tr:hover { background: #f9fafb; }

.tbt-td-date {
    white-space: nowrap;
    font-weight: 600;
}

.tbt-td-category {
    text-align: center;
}

.tbt-detail-placeholder {
    color: #9ca3af;
    font-size: 13px;
}

.tbt-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}

.tbt-category-目撃 {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.tbt-category-撮影 {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.tbt-category-痕跡 {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.tbt-course-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    background: #dbeafe;
    color: #1e40af;
}

.tbt-data-note {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

.tbt-no-data {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 14px;
}

/* 年別グループ */
.tbt-list-summary {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px;
}

.tbt-year-group {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.tbt-year-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f9fafb;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.tbt-year-header:hover {
    background: #f3f4f6;
}

.tbt-year-toggle {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.2s;
}

.tbt-year-closed .tbt-year-toggle {
    transform: rotate(-90deg);
}

.tbt-year-label {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.tbt-year-count {
    font-size: 13px;
    color: #6b7280;
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 10px;
}

.tbt-year-body {
    transition: max-height 0.3s ease;
}

.tbt-year-closed .tbt-year-body {
    display: none;
}

/* --- コース別リスク --- */
.tbt-course-wrapper {
    margin: 24px 0;
}

.tbt-course-note {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.tbt-course-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tbt-course-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tbt-course-risk-low { border-left: 4px solid #22c55e; }
.tbt-course-risk-medium { border-left: 4px solid #eab308; }
.tbt-course-risk-high { border-left: 4px solid #ef4444; }

.tbt-course-risk-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.tbt-course-risk-low .tbt-course-risk-badge { background: #f0fdf4; color: #16a34a; }
.tbt-course-risk-medium .tbt-course-risk-badge { background: #fffbeb; color: #ca8a04; }
.tbt-course-risk-high .tbt-course-risk-badge { background: #fef2f2; color: #dc2626; }

.tbt-course-info strong { font-size: 14px; color: #1f2937; }
.tbt-course-count { font-size: 12px; color: #6b7280; margin-left: 4px; }
.tbt-course-desc { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* --- 安全装備 --- */
.tbt-gear-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.tbt-gear-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.tbt-gear-icon { font-size: 32px; }

.tbt-gear-header strong {
    font-size: 16px;
    color: #1f2937;
}

.tbt-gear-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0;
}

.tbt-gear-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .tbt-gear-grid { grid-template-columns: 1fr; }
}

.tbt-gear-card {
    display: block;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
    color: inherit;
}

.tbt-gear-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59,130,246,0.1);
    text-decoration: none;
    color: inherit;
}

.tbt-gear-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.tbt-gear-desc {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.tbt-gear-price {
    font-size: 13px;
    color: #2563eb;
    font-weight: 600;
}

.tbt-affiliate-note {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 12px;
    text-align: center;
}

/* ピンアイコン（divIcon のデフォルト border/background をリセット） */
.tbt-pin-icon {
    background: transparent !important;
    border: none !important;
}

/* Leaflet ポップアップのカスタム */
.tbt-popup-date {
    font-weight: 700;
    color: #1f2937;
    font-size: 14px;
}

.tbt-popup-location {
    color: #374151;
    margin: 4px 0;
}

.tbt-popup-desc {
    font-size: 12px;
    color: #6b7280;
}

.tbt-popup-source {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}
