/* --- 共通: 基本設定 (Yorozulデザイン継承) --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Header */
.site-header {
    width: 100%;
    background-color: #ffffff;
    padding: 15px 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}
.site-header h1 {
    margin: 0;
    font-size: 1.6em;
    color: #1abc9c;
}
.site-header .subtitle {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.85em;
}

/* Container */
.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    width: 90%;
    max-width: 1200px;
    margin: 0 auto 40px auto;
    box-sizing: border-box;
}

/* Breadcrumbs */
.breadcrumbs {
    width: 100%;
    padding: 0 0 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eeeeee;
}
.breadcrumbs-content {
    font-size: 0.85em; 
    color: #555555;
}
.breadcrumbs a {
    color: #555555;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumbs a:hover {
    color: #1abc9c;
}
.current-page {
    color: #95a5a6; 
}

/* Intro */
.app-wrapper h2 {
    font-size: 1.4em;
    color: #34495e;
    border-left: 5px solid #16a085;
    padding-left: 12px;
    margin-bottom: 15px;
}
.description-text {
    font-size: 0.9em;
    color: #555555;
    margin-bottom: 30px;
}

/* --- Map Specific Styles --- */
.map-section-wrapper {
    margin-bottom: 40px;
}

#map {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    border: 1px solid #dddddd;
    z-index: 1;
}

.map-instruction {
    text-align: center;
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 10px;
}

/* --- Results Area --- */
.result-area {
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 選択地点の情報パネル */
.selected-point-panel {
    background-color: #e8f8f5;
    border: 1px solid #1abc9c;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}
.panel-title {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #16a085;
    border-bottom: 1px dashed #a3e4d7;
    padding-bottom: 10px;
}
.point-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.info-item {
    display: flex;
    flex-direction: column;
}
.info-item .label {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-bottom: 4px;
}
.info-item .value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1em;
}
.info-item .value.highlight {
    color: #e74c3c;
}
.calc-note {
    font-size: 0.75em;
    color: #95a5a6;
    margin-top: 15px;
    line-height: 1.4;
}

.result-header {
    margin-bottom: 15px;
    border-left: 5px solid #34495e;
    padding-left: 12px;
}
.result-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    margin-bottom: 30px;
}

.settings-card {
    background-color: #f8f9fa;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #eeeeee;
    overflow: hidden;
}

/* Table Style - Responsive optimization */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* 横スクロール回避の設定 */
.table-responsive.no-scroll-mobile {
    overflow-x: visible; /* 横スクロール無効化 */
}

.distance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    background-color: white;
    /* min-width削除: 画面幅に合わせて縮むようにする */
}

.distance-table th,
.distance-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
}

.distance-table th {
    background-color: #34495e;
    color: white;
    /* ヘッダーは改行させない */
    white-space: nowrap; 
    font-weight: bold;
}

.distance-table tr:hover {
    background-color: #f1fcf9;
}

.distance-cell {
    font-weight: bold;
    color: #2c3e50;
}

/* --- Usage Caution & Footer --- */
.divider {
    border: 0;
    border-top: 1px dashed #dddddd;
    margin: 40px 0 20px 0;
}
.usage-caution-title {
    font-size: 1.1em;
    color: #7f8c8d;
    margin-bottom: 15px;
}
.usage-caution-list {
    font-size: 0.85em;
    color: #555555;
    padding-left: 20px;
    line-height: 1.6;
}
.usage-caution-list li {
    margin-bottom: 8px;
}

.page-footer {
    width: 100%;
    background-color: #2c3e50;
    color: #ffffff;
    padding: 50px 0 20px 0;
    margin-top: auto;
}
.footer-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto; 
}
.footer-row {
    display: flex;
    gap: 100px; 
    margin-bottom: 50px;
}
.section-title {
    color: #1abc9c;
    font-weight: bold;
    margin-bottom: 18px;
}
.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-section li {
    margin-bottom: 12px;
}
.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-section a:hover {
    color: #1abc9c;
}
.copyright {
    text-align: center;
    font-size: 0.85rem;
    color: #95a5a6;
    border-top: 1px solid #34495e;
    padding-top: 25px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 600px) {
    .container, .header-content, .footer-content {
        width: 95%;
        padding: 20px 10px; /* パディング縮小 */
    }
    .footer-row {
        flex-direction: column;
        gap: 30px;
    }
    #map {
        height: 350px;
    }
    .point-info-grid {
        grid-template-columns: 1fr 1fr; /* スマホでも2列表示を試みる */
        gap: 10px;
    }

    /* テーブルのスマホ最適化 */
    .distance-table {
        font-size: 0.85em; /* 文字サイズを少し小さく */
        table-layout: fixed; /* 幅固定レイアウトにして崩れ防止 */
    }
    
    .distance-table th, 
    .distance-table td {
        padding: 8px 5px; /* パディングを限界まで詰める */
        vertical-align: middle;
    }

    /* 列ごとのスタイル調整 */
    .distance-table td:nth-child(1) {
        /* 都市名: 改行許可 */
        white-space: normal;
        word-break: break-all;
    }
    .distance-table td:nth-child(2),
    .distance-table td:nth-child(3) {
        /* 距離と時間: 改行させない */
        white-space: nowrap;
        text-align: right; /* 数字は見やすく右寄せ */
    }
    .distance-table th:nth-child(2),
    .distance-table th:nth-child(3) {
        text-align: right;
    }
}