/* WordPress固定ページ用のスタイル調整 */
/* エラー表示 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 20px;
    border: 1px solid #f5c6cb;
}

/* 成功表示 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin: 20px;
    border: 1px solid #c3e6cb;
}

/* ズームコントロールボタン */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    overflow: hidden;
    z-index: 1000;
}

.zoom-scale-display {
    padding: 8px 12px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    min-width: 40px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s ease;
}

.zoom-btn:hover {
    background-color: #f5f5f5;
}

.zoom-btn:active {
    background-color: #e0e0e0;
}

.zoom-btn:first-of-type {
    border-bottom: 1px solid #e0e0e0;
}

/* ラベル表示関連のスタイル */
.label-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.label-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-size-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-size-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.label-size-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-size-btn:hover {
    background-color: #f0f0f0;
}

.label-size-display {
    min-width: 35px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
}

.label-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.label-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.label-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.label-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .label-slider {
    background-color: #2a5298;
}

input:checked + .label-slider:before {
    transform: translateX(20px);
}

/* 地図ラベル */
.map-label {
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: middle;
    font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
    font-weight: bold;
    fill: #333;
    stroke: white;
    stroke-width: 2px;
    paint-order: stroke fill;
    opacity: 0.9;
}
.map-page-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

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

#popup {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.map-container path:hover {
    stroke-width: 1.5px;
    stroke: #007cba;
}

/* WordPressテーマとの競合を避けるためのリセット */
#map-application * {
    box-sizing: border-box;
}

#map-application h1,
#map-application h2,
#map-application h3,
#map-application h4,
#map-application p {
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.main-content {
    display: flex;
    min-height: 600px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0; /* 元の margin-bottom を無効化 */
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.controls select {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.controls select:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.map-container {
    flex: 1;
    position: relative;
    padding: 20px;
    min-width: 0;
}

#map {
    width: 100%;
    height: 500px;
    display: block;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
}

.info-panel {
    width: 350px;
    padding: 30px;
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    overflow-y: auto;
}

.info-panel h3 {
    margin-top: 0;
    color: #2a5298;
    font-size: 1.5em;
    margin-bottom: 20px;
}

#table-info {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

#table-info th {
    background: #2a5298;
    color: white;
    font-weight: 600;
    width: 40%;
}

#table-info tr:last-child td, #table-info tr:last-child th {
    border-bottom: none;
}

.visit-status {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.visit-status h4 {
    margin-top: 0;
    color: #2a5298;
    margin-bottom: 15px;
}

.visit-buttons {
    display: flex;
    gap: 10px;
}

.visit-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.visit-btn.visited {
    background: #dc3545;
    color: white;
}

.visit-btn.not-visited {
    background: #28a745;
    color: white;
}

.visit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.download-links {
    margin-top: 20px;
    text-align: center;
}

.download-links a {
    display: inline-block;
    margin: 5px 10px;
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.download-links a:hover {
    background: #5a6268;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

.legend {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);

    /* 横並び */
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap; /* 小さい画面で折り返す */
}

.legend h4 {
    margin: 0;
    color: #2a5298;
    white-space: nowrap; /* 折り返さない */
}

.legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #ccc;
}

/* 認証インジケーター */
.hidden-auth {
    position: relative;
}

#auth-indicator {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

#auth-indicator:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* SVGパスのホバー効果 */
#map path {
    cursor: pointer;
    transition: all 0.2s ease;
}

#map path:hover {
    stroke-width: 2;
    stroke: #007bff;
}

/* レスポンシブデザイン */
@media (max-width: 1200px) {
    .main-content {
       flex-direction: column;
    }
    
    .controls, .info-panel {
        width: 100%;
    }
    
    .info-panel {
        border-left: none;
        border-top: 1px solid #dee2e6;
    }
    
    #map {
        height: 400px;
	/* width: 80%; */
    }
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
        margin: 0;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .control-group {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 25px; /* 元の余白を復活 */
    }

    .info-panel {
        padding: 20px;
    }
    
    .map-container {
        padding: 10px;
    }
    
    #map {
        height: 300px;
    }
    
    .visit-buttons {
        flex-direction: column;
    }
    
    .legend-item {
        font-size: 14px;
    }
}

/* WordPressとの競合を避けるための特定性を高めた指定 */
.map-page-container #map-application .container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* WordPressテーマのボタンスタイルをオーバーライド */
.map-page-container .visit-btn {
    background: #dc3545 !important;
    border: none !important;
    padding: 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.map-page-container .visit-btn.not-visited {
    background: #28a745 !important;
}

/* WordPressテーマのテーブルスタイルをオーバーライド */
.map-page-container #table-info {
    border: none !important;
    margin: 0 !important;
}

.map-page-container #table-info th,
.map-page-container #table-info td {
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
}

/* ローディング表示 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #6c757d;
}

.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2a5298;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* エラー表示 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 20px;
    border: 1px solid #f5c6cb;
}

/* 成功表示 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin: 20px;
    border: 1px solid #c3e6cb;
}
