/* OpenMapTiles 地図表示ページのスタイル */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

#map-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#header h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.control-group select,
.control-group input[type="range"] {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 5px;
    background: white;
    color: #333;
    font-size: 0.9rem;
}

.control-group button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.control-group button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

#zoom-value {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

#map {
    flex: 1;
    position: relative;
}

#info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 80vh;
    overflow: hidden;
    user-select: none;
    transition: all 0.3s ease;
}

#info-panel.collapsed {
    height: 50px;
}

#info-panel.dragging {
    transition: none;
    cursor: move;
}

#info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    cursor: move;
}

#info-panel-header h3 {
    margin: 0;
    font-size: 1rem;
    color: white;
    border: none;
    padding: 0;
}

#info-panel-controls {
    display: flex;
    gap: 0.5rem;
}

#info-panel-controls button {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#info-panel-controls button:hover {
    background: rgba(255,255,255,0.3);
}

#info-panel-content {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

#info-panel-content h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.3rem;
}

#info-panel-content p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

#info-panel-content strong {
    color: #555;
}

#info-panel-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #e83e8c;
    word-break: break-all;
}

#tile-url {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 0.3rem;
    border-radius: 3px;
    word-break: break-all;
    display: block;
    margin-top: 0.3rem;
}

#endpoint-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    #controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }

    #info-panel {
        position: relative;
        width: 100%;
        top: 0;
        right: 0;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid #ddd;
        max-height: none;
    }

    #info-panel-header {
        border-radius: 0;
    }

    #map-container {
        flex-direction: column;
    }

    #map {
        height: 60vh;
    }
}

/* ローディングアニメーション */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
}

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

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

/* カスタムスクロールバー */
#info-panel-content::-webkit-scrollbar {
    width: 6px;
}

#info-panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#info-panel-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

#info-panel-content::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}
