/* 增强版端口池管理系统样式 */

/* 环境状态卡片 */
.env-status-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.env-status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.env-status-card.contest {
    border-left-color: #0d6efd;
}

.env-status-card.practice {
    border-left-color: #198754;
}

.env-status-card.target {
    border-left-color: #ffc107;
}

/* 端口信息显示 */
.port-info-badge {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.port-details {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.port-details code {
    background: #e9ecef;
    color: #495057;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* 环境类型徽章 */
.env-badge {
    font-size: 0.75em;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.env-badge.contest {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
}

.env-badge.practice {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
}

.env-badge.target {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

/* 进度条样式 */
.usage-progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
}

.usage-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    position: relative;
}

.usage-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.running::before {
    background: #198754;
}

.status-indicator.starting::before {
    background: #0dcaf0;
}

.status-indicator.stopping::before {
    background: #ffc107;
}

.status-indicator.stopped::before {
    background: #6c757d;
}

.status-indicator.error::before {
    background: #dc3545;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 控制按钮组 */
.env-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.env-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.env-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 环境信息面板 */
.env-info-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.env-info-panel h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

/* 实时监控表格 */
.realtime-table {
    font-size: 0.875rem;
}

.realtime-table th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.realtime-table td {
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

/* 用户头像 */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
}

/* 统计卡片 */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.stats-card:hover::before {
    transform: translateX(100%);
}

.stats-card .card-body {
    position: relative;
    z-index: 1;
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-card h5 {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .env-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .env-controls .btn {
        justify-content: center;
    }
    
    .env-info-panel {
        padding: 0.75rem;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip-custom {
    position: relative;
    cursor: help;
}

.tooltip-custom::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip-custom:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 成功/错误消息样式 */
.alert-enhanced {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.alert-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.alert-enhanced.alert-success::before {
    background: #198754;
}

.alert-enhanced.alert-danger::before {
    background: #dc3545;
}

.alert-enhanced.alert-warning::before {
    background: #ffc107;
}

.alert-enhanced.alert-info::before {
    background: #0dcaf0;
}

/* 代码块样式 */
.code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #495057;
    overflow-x: auto;
}

.code-block.highlight {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
} 

/* 平滑式状态切换动画 */
.status-transition {
    transition: all 0.3s ease-in-out;
}

.status-badge {
    position: relative;
    overflow: hidden;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    transition: left 0.5s ease;
}

.status-badge.animate::before {
    left: 100%;
}

/* 启动中动画 */
.status-badge.starting {
    animation: pulse-starting 2s infinite;
}

@keyframes pulse-starting {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 停止中动画 */
.status-badge.stopping {
    animation: pulse-stopping 2s infinite;
}

@keyframes pulse-stopping {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 按钮状态切换动画 */
.btn-state-transition {
    transition: all 0.3s ease;
}

.btn-state-transition:disabled {
    opacity: 0.7;
    transform: scale(0.98);
}

/* 环境信息面板动画 */
.env-info-panel {
    transition: all 0.3s ease;
}

.env-info-panel.show {
    animation: slideIn 0.3s ease;
}

.env-info-panel.hide {
    animation: slideOut 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* 消息提示动画 */
.alert-message {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载动画 */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
} 