/* 组件样式文件 */

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    border-color: #0099ff;
    box-shadow: 0 0 20px rgba(0, 153, 255, 0.4);
}

.btn-primary:hover {
    background: rgba(0, 153, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 153, 255, 0.7);
    transform: translateY(-2px);
}

.btn-danger {
    border-color: #ff0066;
    box-shadow: 0 0 20px rgba(255, 0, 102, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 0, 102, 0.2);
    box-shadow: 0 0 30px rgba(255, 0, 102, 0.6);
    transform: translateY(-2px);
}

.btn-info {
    border-color: #00ccff;
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.4);
}

.btn-info:hover {
    background: rgba(0, 204, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 204, 255, 0.7);
    transform: translateY(-2px);
}

.btn-warning {
    border-color: #ffaa00;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.3);
}

.btn-warning:hover {
    background: rgba(255, 170, 0, 0.2);
    box-shadow: 0 0 30px rgba(255, 170, 0, 0.6);
    transform: translateY(-2px);
}

.btn-success {
    border-color: #00cc66;
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.4);
}

.btn-success:hover {
    background: rgba(0, 204, 102, 0.3);
    box-shadow: 0 0 30px rgba(0, 204, 102, 0.7);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 10px;
    margin-left: 5px;
}

/* 状态指示器 */
.status {
    text-align: center;
    padding: 8px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
}

.status.connected {
    background: rgba(0, 200, 100, 0.2);
    color: #00ff88;
    border: 1px solid rgba(0, 200, 100, 0.5);
    box-shadow: 0 0 20px rgba(0, 200, 100, 0.3);
}

.status.disconnected {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6666;
    border: 1px solid rgba(255, 100, 100, 0.5);
    box-shadow: 0 0 20px rgba(255, 100, 100, 0.3);
}

/* 端口选择器 */
.port-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.port-selector > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.port-selector label {
    color: #00aaff;
    font-size: 12px;
    font-weight: bold;
    min-width: 40px;
}

.port-selector select {
    flex: 1;
    padding: 6px 10px;
    border: 2px solid rgba(0, 150, 255, 0.4);
    border-radius: 6px;
    font-size: 11px;
    background: rgba(0, 20, 40, 0.95);
    color: #e0e8ff;
}

.port-selector button {
    padding: 8px 15px;
    font-size: 11px;
    margin-bottom: 5px;
}

/* 地图类型按钮 */
.map-type-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-type-btn:hover {
    background: #f0f8ff;
    border-color: #4CAF50;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.map-type-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    box-shadow: 0 3px 6px rgba(76, 175, 80, 0.3);
}

.map-type-btn.active:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* 图例 */
.legend {
    display: flex;
    gap: 15px;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ccc;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.drone-dot { background-color: #ff4444; }
.operator-dot { background-color: #4444ff; }

/* 连接模式选择器 */
.connection-mode-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 30, 60, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(0, 150, 255, 0.3);
}

.connection-mode-selector h3 {
    margin: 0 0 12px 0;
    color: #00aaff;
    font-size: 14px;
    text-align: center;
}

.mode-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mode-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 11px;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.mode-btn.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.5);
}

/* 模式切换按钮 */
.mode-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.mode-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 16px;
    font-size: 12px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.mode-btn.active {
    opacity: 1;
    background: rgba(0, 153, 255, 0.3);
    border-color: #0099ff;
    box-shadow: 0 0 20px rgba(0, 153, 255, 0.5);
}

/* 连接面板 */
.connection-panel {
    display: none;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(0, 153, 255, 0.3);
}

.connection-panel.active {
    display: block;
}

/* HTTP数据源样式 */
.http-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    color: #00ccff;
    font-weight: bold;
    font-size: 12px;
}

.input-group input {
    padding: 8px 12px;
    border: 2px solid rgba(0, 204, 255, 0.3);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 12px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #00ccff;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group .btn {
    flex: 1;
    min-width: 100px;
}

/* 状态网格 */
.status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border: 1px solid rgba(0, 153, 255, 0.2);
}

.status-item label {
    color: #00ccff;
    font-size: 11px;
    font-weight: bold;
}

.status-indicator {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-indicator.connected {
    background: rgba(0, 204, 102, 0.3);
    color: #00cc66;
    border: 1px solid #00cc66;
}

.status-indicator.disconnected {
    background: rgba(255, 0, 102, 0.3);
    color: #ff0066;
    border: 1px solid #ff0066;
}

.status-indicator.active {
    background: rgba(0, 153, 255, 0.3);
    color: #0099ff;
    border: 1px solid #0099ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mode-buttons {
        flex-direction: column;
    }
    
    .mode-btn {
        min-width: auto;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
}

/* 统一尺寸按钮 */
.uniform-btn {
    width: 140px;
    height: 36px;
    padding: 0 12px;
    line-height: 36px;
}

/* 两行两列按钮网格 */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 10px;
    align-items: stretch;
}
.buttons-grid .btn {
    width: 100%;
}

.whitelist-panel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.whitelist-panel h4 {
    color: #e0e8ff;
    font-size: 14px;
    margin: 0 0 8px 0;
}
.whitelist-panel input[type="text"] {
    background: rgba(0, 20, 40, 0.85);
    border: 2px solid rgba(0, 150, 255, 0.35);
    color: #e0e8ff;
    padding: 8px 10px;
    border-radius: 8px;
    outline: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.whitelist-panel input[type="text"]:focus {
    border-color: #00aaff;
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.15);
}
.whitelist-panel label {
    color: #b7c6dd;
    font-size: 12px;
}
#whitelistList li {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#whitelistList li:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.12);
}
#whitelistList .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 12px;
}
/* 标签页按钮与内容 */
.tab-buttons { display:flex; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.tab-btn.active { background: rgba(0, 153, 255, 0.3); border-color:#0099ff; box-shadow: 0 0 20px rgba(0,153,255,0.5); }
.tab-pane { display:none; margin-top:8px; }
.tab-pane.active { display:block; }
