/**
 * 全局定位追踪器样式
 */

/* 手动位置选择器样式 */
.manual-location-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.location-selector-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.location-selector-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.location-selector-content p {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 14px;
}

/* 保存的地址 */
.saved-locations {
    margin-bottom: 20px;
}

.saved-locations h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

#saved-locations-list {
    max-height: 150px;
    overflow-y: auto;
}

.saved-location-item {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-location-item:hover {
    background: #fff8e1;
    border-color: #d4af37;
    transform: translateX(5px);
}

.saved-location-item i {
    color: #d4af37;
}

/* 位置搜索 */
.location-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.location-search-wrapper {
    flex: 1;
    position: relative;
}

.location-search input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #ffffff;
    color: #333333;
    box-sizing: border-box;
}

.location-search input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.location-search button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #d4af37 0%, #f4e5c3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.location-search button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* 自动补全下拉框 */
.location-autocomplete {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #d4af37;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #fff8e1;
}

.autocomplete-item i {
    color: #d4af37;
    margin-top: 3px;
    flex-shrink: 0;
}

.autocomplete-text {
    flex: 1;
    min-width: 0;
}

.autocomplete-main {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.autocomplete-detail {
    display: block;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 自动补全加载状态 */
.autocomplete-loading {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

.autocomplete-loading i {
    margin-right: 8px;
    color: #d4af37;
}

/* 搜索结果 */
#location-search-results {
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.search-result-item:hover {
    background: #f5f5f5;
    border-color: #d4af37;
    transform: translateX(5px);
}

.search-result-item i {
    color: #d4af37;
    font-size: 16px;
}

/* 地图选择器 */
.location-map-picker {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: visible;
    border: 2px solid #e0e0e0;
    min-height: 300px;
    background: #ffffff;
}

#manual-location-map {
    width: 100%;
    height: 300px;
    min-height: 300px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

/* 地图占位符 */
.map-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f4f8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.map-placeholder i {
    font-size: 56px;
    color: #d4af37;
    margin-bottom: 15px;
    opacity: 0.8;
}

.map-placeholder p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.map-placeholder .map-placeholder-note {
    color: #999;
    font-size: 12px;
}

/* Leaflet 地图容器 */
#leaflet-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

#leaflet-map .leaflet-control-attribution {
    font-size: 10px;
}

/* 已选择的位置 */
.selected-location {
    padding: 15px;
    background: linear-gradient(135deg, #fff8e1 0%, #fffef9 100%);
    border: 2px solid #d4af37;
    border-radius: 8px;
    margin-bottom: 20px;
}

.selected-location strong {
    color: #333;
    font-weight: 600;
}

#selected-location-text {
    color: #666;
    font-size: 14px;
}

/* 操作按钮 */
.location-selector-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.location-selector-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-confirm {
    background: linear-gradient(135deg, #d4af37 0%, #f4e5c3 100%);
    color: white;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.btn-skip {
    background: #f0f0f0;
    color: #666;
}

.btn-skip:hover {
    background: #e0e0e0;
}

/* 位置权限提示条 */
.location-permission-prompt {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    padding: 20px 25px;
    z-index: 9999;
    min-width: 400px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -50px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.prompt-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.prompt-content i {
    color: #d4af37;
    font-size: 24px;
}

.prompt-content span {
    flex: 1;
    color: #333;
    font-size: 14px;
}

.btn-enable {
    padding: 10px 20px;
    background: linear-gradient(135deg, #d4af37 0%, #f4e5c3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-enable:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.btn-dismiss {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-dismiss:hover {
    background: #f0f0f0;
    color: #666;
}

/* 位置状态显示 */
.location-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.location-status.tracking {
    background: #e8f5e9;
    color: #2e7d32;
}

.location-status.detecting {
    background: #e3f2fd;
    color: #1565c0;
}

.location-status.detecting i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.location-status.error {
    background: #ffebee;
    color: #c62828;
}

.location-status.manual {
    background: #fff3e0;
    color: #e65100;
}

.location-status.stopped {
    background: #f5f5f5;
    color: #757575;
}

.location-status i {
    font-size: 12px;
}

/* 动画效果 */
.animate-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 当前位置显示 */
.current-location-display {
    padding: 10px 15px;
    background: linear-gradient(135deg, #fff8e1 0%, #fffef9 100%);
    border: 1px solid #d4af37;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

/* 距离显示 */
.distance-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.distance-display i {
    font-size: 10px;
}

/* 按摩师卡片距离徽章 */
.therapist-card .distance-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #d4af37 0%, #f4e5c3 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .location-permission-prompt {
        width: 90%;
        min-width: auto;
        top: 20px;
    }
    
    .prompt-content {
        flex-wrap: wrap;
    }
    
    .location-selector-content {
        padding: 20px;
    }
    
    .location-selector-content h3 {
        font-size: 20px;
    }
    
    .location-search {
        flex-direction: column;
    }
    
    .location-selector-actions {
        flex-direction: column;
    }
    
    .location-selector-actions button {
        width: 100%;
    }
}

/* 实时位置指示器 */
.live-location-indicator {
    position: relative;
    width: 20px;
    height: 20px;
}

.live-location-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(76, 175, 80, 0.4);
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* 位置精度指示器 */
.accuracy-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #999;
}

.accuracy-indicator .accuracy-level {
    display: flex;
    gap: 2px;
}

.accuracy-indicator .accuracy-bar {
    width: 4px;
    height: 12px;
    background: #ddd;
    border-radius: 2px;
}

.accuracy-indicator.high .accuracy-bar {
    background: #4CAF50;
}

.accuracy-indicator.medium .accuracy-bar:nth-child(-n+2) {
    background: #FFC107;
}

.accuracy-indicator.low .accuracy-bar:first-child {
    background: #FF5722;
}
