/**
 * 访问统计样式文件 - 管理后台版本
 * 提供美观的统计数据显示界面
 */

/* 管理后台统计面板 */
.analytics-dashboard {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

/* 统计概览卡片容器 */
.analytics-dashboard .stats-overview {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap !important;
    justify-content: space-between;
}

.analytics-dashboard .stats-overview .stat-card {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
    max-width: calc(50% - 10px);
}

/* 统计卡片 */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 统计图标 */
.stat-icon {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
}

/* 统计内容 */
.stat-content {
    flex: 1;
}

/* 统计标签 */
.stat-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 统计数值 */
.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
    line-height: 1;
}

/* 控制按钮容器 */
.analytics-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 详细信息区域 */
.analytics-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* 详情部分 */
.detail-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.detail-section h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* 详情信息 */
.detail-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    color: #2c3e50;
    font-weight: 600;
}

/* 访客记录列表 */
.visitor-list {
    max-height: 400px;
    overflow-y: auto;
}

.visitor-date-group {
    margin-bottom: 20px;
}

.date-header {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.visitor-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.visitor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #28a745;
    transition: all 0.2s ease;
}

.visitor-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.visitor-id {
    font-family: 'Courier New', monospace;
    color: #6c757d;
    font-size: 12px;
}

.visitor-time {
    color: #6c757d;
    font-size: 12px;
}

.no-visitors {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .analytics-dashboard .stats-overview {
        flex-wrap: wrap !important;
        gap: 15px;
    }
    
    .analytics-dashboard .stats-overview .stat-card {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        max-width: calc(50% - 8px);
    }
    
    .stat-card {
        padding: 20px 15px;
        gap: 15px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }
    
    .stat-value {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .analytics-dashboard {
        padding: 15px;
    }
    
    .analytics-dashboard .stats-overview {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 12px;
    }
    
    .analytics-dashboard .stats-overview .stat-card {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
        max-width: calc(50% - 6px);
    }
    
    .analytics-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-card {
        padding: 15px 10px;
        gap: 10px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .analytics-controls {
        flex-direction: column;
    }
    
    .analytics-controls .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .analytics-dashboard {
        padding: 10px;
    }
    
    .analytics-dashboard .stats-overview {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px;
    }
    
    .analytics-dashboard .stats-overview .stat-card {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        max-width: calc(50% - 4px);
    }
    
    .stat-card {
        padding: 10px 5px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .stat-icon {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .detail-section {
        padding: 15px;
    }
}

/* 加载动画 */
.stat-value {
    animation: countUp 0.8s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 按钮悬停效果 */
.analytics-controls .btn {
    transition: all 0.3s ease;
}

.analytics-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 滚动条样式 */
.visitor-list::-webkit-scrollbar {
    width: 6px;
}

.visitor-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.visitor-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.visitor-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
