/* 船舶動態雷達地圖專用樣式 */

.ferry-map-wrapper {
    position: relative;
    width: 100%;
    height: 620px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.2);
    background-color: #0f172a;
}

@media (max-width: 768px) {
    .ferry-map-wrapper {
        height: 520px;
        border-radius: 14px;
    }
}

#ferryMap {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 地圖浮動控制工具列 */
.map-control-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-btn {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
}

.map-control-btn:hover {
    background: #ffffff;
    color: var(--primary-sky-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

.map-control-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* 右上角即時狀態與刷新倒數指示器 */
.map-status-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 0.85rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-pulse-dot {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.7);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* 船舶標記自訂圖標 */
.ship-marker-container {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ship-marker-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    border: 2px solid #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ship-marker-icon i {
    font-size: 16px;
    color: #0284c7;
}

.ship-marker-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    pointer-events: none;
}

.ship-marker-container.ship-moored .ship-marker-icon {
    border-style: dashed;
    border-width: 2px;
    background-color: #f8fafc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.ship-marker-container:hover .ship-marker-icon {
    transform: scale(1.2);
    border-color: #f59e0b;
}

/* 港口標記 */
.port-marker-icon {
    background: #0284c7;
    color: #ffffff;
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.port-marker-icon:hover {
    transform: scale(1.1);
    z-index: 999;
}

.port-marker-icon.liuqiou {
    background: #d97706;
}

.port-marker-icon.yanpu {
    background: #0891b2;
}

.port-marker-icon.minor-port {
    background: #475569;
    font-size: 10px;
    padding: 2px 6px;
    opacity: 0.9;
}

/* 船舶詳情抽屜/浮動卡片 (Detail Bottom Sheet) */
.ship-detail-card {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(14, 165, 233, 0.3);
    z-index: 1000;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ship-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.ship-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ship-stat-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.ship-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 2px;
}

.ship-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

/* 航線清單面板 */
.routes-legend-box {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.company-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
