/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* コンテンツラッパー */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
}

/* 地図セクション */
.map-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.map-container {
    width: 100%;
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.map-instructions {
    margin-top: 15px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 8px;
    text-align: center;
    color: #1976d2;
    font-weight: 500;
}

.map-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.instruction-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* 予報セクション */
.forecast-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-height: 680px;
    overflow-y: auto;
}

/* ウェルカムメッセージ */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.welcome-message h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.welcome-message p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.info-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.info-box h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 8px 0;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

.info-box li:last-child {
    border-bottom: none;
}

.info-box li:before {
    content: "✓ ";
    color: #667eea;
    font-weight: bold;
    margin-right: 8px;
}

/* ローディング */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: #666;
    font-size: 1.1rem;
}

/* エラーメッセージ */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

/* ユーティリティ */
.hidden {
    display: none !important;
}

/* 予報コンテナ */
.forecast-container {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.forecast-header {
    border-bottom: 2px solid #667eea;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.forecast-header h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.location-coords {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 5px;
}

.data-time {
    font-size: 0.85rem;
    color: #999;
}

.forecast-controls {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.forecast-controls label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

.forecast-controls select {
    padding: 8px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
}

.action-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    background: #667eea;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.secondary-btn {
    background: #607d8b;
}

.action-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.forecast-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.summary-overview {
    grid-column: 1 / -1;
    background: linear-gradient(120deg, #f0f7ff 0%, #eef3ff 100%);
    border: 1px solid #d8e5ff;
    border-radius: 10px;
    padding: 14px 16px;
}

.summary-headline {
    font-size: 1.1rem;
    font-weight: 700;
    color: #334e68;
}

.summary-period {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #607d8b;
}

.summary-description {
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334e68;
}

.summary-card {
    background: #f4f7ff;
    border: 1px solid #dce5ff;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-label {
    font-size: 0.8rem;
    color: #607d8b;
}

.summary-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #334e68;
}

/* チャートセクション */
.charts-section {
    margin-top: 30px;
    border-top: 2px solid #e0e0e0;
    padding-top: 30px;
}

.charts-section h3 {
    color: #667eea;
    margin-bottom: 25px;
    text-align: center;
}

.chart-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.chart-container h4 {
    color: #555;
    margin-bottom: 15px;
    text-align: center;
}

.chart-container canvas {
    max-height: 250px;
}

/* フッター */
.footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.9rem;
}

.footer a {
    color: white;
    text-decoration: underline;
}

.footer p {
    margin: 5px 0;
}

/* Leafletマーカーのカスタマイズ */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 5px;
}

.leaflet-popup-content {
    margin: 10px;
    font-size: 0.9rem;
}

/* スクロールバーのスタイリング */
.forecast-section::-webkit-scrollbar {
    width: 8px;
}

.forecast-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.forecast-section::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.forecast-section::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

@media (max-width: 640px) {
    .map-container {
        height: 420px;
    }

    .forecast-controls {
        align-items: flex-start;
    }
}
