body {
    font-family: sans-serif;
    margin: 20px;
    padding: 0;
    background-color: #f5f5f5;
}

h1 {
    color: #333;
    font-size: 1.5rem;
}

.controls {
    margin-bottom: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.control-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #555;
}

.control-group input, .control-group select {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1rem; /* スマホでのズーム防止 */
}

/* メインコンテンツのレイアウト設定（縦積み） */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 地図の高さを指定 */
#map {
    position: relative;
    height: 600px;
    width: 100%;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #e5e3df;
    z-index: 1;
}

/* 勾配色の凡例スタイル */
.route-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 1000;
    font-size: 0.85rem;
    color: #333;
}

.route-legend div {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.route-legend div:last-child {
    margin-bottom: 0;
}

.route-legend span {
    display: inline-block;
    width: 20px;
    height: 4px;
    margin-right: 8px;
    border-radius: 2px;
}

/* 天気リストコンテナのスタイル */
#weatherListContainer {
    width: 100%;
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* タイムライン表のラッパー（横スクロール対応） */
.weather-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

/* タイムライン表のスタイル */
.weather-table {
    border-collapse: collapse;
    width: max-content;
    text-align: center;
    font-size: 0.95rem;
}

.weather-table th, .weather-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 15px;
    white-space: nowrap;
}

.weather-table th {
    position: sticky;
    left: 0;
    background-color: #f2f6f9;
    z-index: 2;
    font-weight: normal;
    color: #333;
    border-right: 2px solid #ccc;
}

.weather-table #row-date td {
    text-align: left;
    background-color: #f9f9f9;
    font-weight: bold;
}

.weather-table #row-weather td {
    background-color: #e8f4f8; /* 軽い背景色でアイコンを目立たせる */
}

.unit-text {
    font-size: 0.75rem;
    color: #777;
    margin-left: 2px;
}

/* クリック可能な地点セルのスタイル */
.clickable-point {
    cursor: pointer;
    color: #3388ff;
    text-decoration: underline;
    transition: background-color 0.2s;
    font-weight: bold;
}

.clickable-point:hover {
    background-color: #e6f2ff !important;
}

/* マップ上のカスタム情報ボックスのスタイル */
.custom-pin-wrapper {
    background: transparent;
    border: none;
}

.custom-info-box {
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid #3388ff;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}

.custom-info-number {
    font-size: 18px;
    font-weight: 900;
}

.custom-info-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.custom-info-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.wind-arrow {
    color: #3498db;
    font-size: 16px;
    display: inline-block;
    line-height: 1;
}

/* 透過背景マーカー（風向・風速、矢印のみ）のスタイル */
.transparent-marker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    /* 白フチで地図上での視認性を高める */
    filter: drop-shadow(0px 1px 2px rgba(255,255,255,0.8));
}

.transparent-marker-number {
    font-size: 14px;
    font-weight: 900;
    color: #333;
    margin-bottom: -2px;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
    z-index: 2;
}

.transparent-arrow-icon {
    color: #3498db;
    font-size: 32px;
    font-weight: 900;
    display: inline-block;
    line-height: 1;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}

.arrow-overlap-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 矢印に重ねて表示する風速テキスト */
.overlap-wind-speed {
    position: absolute;
    font-size: 13px;
    font-weight: 900;
    color: #e74c3c;
    z-index: 3;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}

/* =======================================================
   スマートフォン向けレスポンシブ対応
   ======================================================= */
@media screen and (max-width: 768px) {
    body {
        margin: 10px;
    }
    
    .controls {
        flex-direction: column;
        gap: 10px;
    }

    .control-group {
        min-width: 100%;
    }

    .main-content {
        flex-direction: column;
        display: block; /* Flexboxの影響をリセット */
    }

    #map {
        width: 100%;
        min-width: 0;
        height: 450px;
        flex: none;
        margin-bottom: 20px;
    }

    #weatherListContainer {
        width: 100%;
        min-width: 0;
        height: auto;
        flex: none;
    }

    .route-legend {
        font-size: 0.75rem;
        bottom: 10px;
        left: 10px;
        padding: 8px;
    }
    
    .weather-table th, .weather-table td {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}