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

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

/* メインコンテナ */
.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* マップコンテナ */
.map-container {
    position: relative;
    transition: all 0.3s ease;
    width: calc(100% - 350px);
    height: 100vh;
    margin-left: 350px;
}

.container.panel-collapsed .map-container {
    width: 100%;
    margin-left: 0;
}

#map {
    width: 100%;
    height: 100%;
}

/* Leaflet地図のカスタムスタイル */
.leaflet-container {
    background: #f5f5f5;
}

.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.8);
    font-size: 11px;
}

/* 地図フィルター適用用のクラス */
.map-filtered {
    transition: filter 0.3s ease;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100% !important;
        height: auto;
        max-height: 50vh;
        overflow-y: auto;
        position: relative !important;
    }
    
    .map-container {
        height: 50vh;
        margin-left: 0 !important;
    }
    
    .panel-toggle {
        display: none;
    }
}

/* ローディング表示 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* エラー表示 */
.error {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ff4444;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 成功メッセージ */
.success {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

/* PNG書き出し中の表示 */
.exporting {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    z-index: 2000;
    text-align: center;
}

.exporting .progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 10px 0;
    overflow: hidden;
}

.exporting .progress-fill {
    height: 100%;
    background: #3498db;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ツールチップ */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* アニメーション効果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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