/* VideoMania AI Statistics Dashboard Styles */
/* Интеграция красивого дашборда с Blazor темной темой */

/* ===== БАЗОВЫЕ СТИЛИ ДАШБОРДА ===== */

.ai-dashboard-container {
    background: #121212;
    color: #ffffff;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 80px;
    width: calc(100vw - 80px);
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 1;
    box-sizing: border-box;
}

/* Полная ширина только для фоновых элементов */
.ai-dashboard-container > .ai-bg-animation,
.ai-dashboard-container > .ai-particles {
    width: 100%;
}

/* Центрированный контейнер дашборда с равными отступами */
.ai-dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Адаптивные отступы для разных экранов */
@media (max-width: 1200px) {
    .ai-dashboard-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .ai-dashboard-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .ai-dashboard-content {
        padding: 0.75rem;
    }
}

/* Анимированный фон */
.ai-bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #121212, #1a1a1a, #1e1e1e, #181818);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating particles */
.ai-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ai-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.1; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.3; }
}

/* ===== ЗАГОЛОВОК ДАШБОРДА ===== */

.ai-header {
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.ai-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, #ff6b35, #f7931e, #ff6b35);
    border-radius: 1px;
}

.ai-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ff6b35, #f7931e, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: brightness(1); }
    to { filter: brightness(1.2); }
}

.ai-header p {
    font-size: 1.2rem;
    color: #cccccc;
    margin-top: 1rem;
    font-weight: 300;
}

/* ===== КАРТОЧКИ СТАТИСТИКИ ===== */

.ai-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.ai-stat-card {
    background: rgba(18, 18, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.ai-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
    transition: left 0.6s ease;
}

.ai-stat-card:hover::before {
    left: 100%;
}

.ai-stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: 0 25px 50px rgba(255, 107, 53, 0.15);
}

.ai-stat-icon {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #ff6b35;
    filter: drop-shadow(0 0 15px rgba(255, 107, 53, 0.4));
    animation: iconFloat 3s ease-in-out infinite;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(247, 147, 30, 0.1));
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.ai-stat-number {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    margin-top: 2rem;
    background: linear-gradient(135deg, #ffffff, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}

.ai-stat-label {
    font-size: 1rem;
    color: #cccccc;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.ai-stat-trend {
    font-size: 0.9rem;
    padding: 5px 15px;
    border-radius: 15px;
    display: inline-block;
    font-weight: 600;
}

.ai-stat-trend.up {
    background: rgba(0, 255, 127, 0.1);
    color: #00ff7f;
    border: 1px solid rgba(0, 255, 127, 0.2);
}

.ai-stat-trend.down {
    background: rgba(255, 69, 58, 0.1);
    color: #ff453a;
    border: 1px solid rgba(255, 69, 58, 0.2);
}

/* ===== СЕКЦИЯ ГРАФИКОВ ===== */

.ai-charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .ai-charts-section {
        grid-template-columns: 1fr;
    }
}

.ai-chart-container {
    background: rgba(18, 18, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.ai-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #f7931e, #ff6b35);
    background-size: 200% 100%;
    animation: borderFlow 3s ease infinite;
}

@keyframes borderFlow {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 200% 0%; }
}

.ai-chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chart-title i {
    color: #ff6b35;
}

/* ===== PIE CHART ===== */

.ai-pie-chart-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .ai-pie-chart-container {
        width: 250px;
        height: 250px;
    }
}

.ai-pie-chart {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    animation: pieRotate 3s ease-out;
}

@keyframes pieRotate {
    from { transform: rotate(-90deg); }
    to { transform: rotate(270deg); }
}

.ai-pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: rgba(18, 18, 18, 0.95);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid rgba(255, 107, 53, 0.3);
}

.ai-pie-total {
    font-size: 2rem;
    font-weight: 800;
    color: #ff6b35;
    margin-bottom: 0.3rem;
}

.ai-pie-label {
    font-size: 0.9rem;
    color: #cccccc;
    font-weight: 500;
}

/* ===== СПИСОК МОДЕЛЕЙ ===== */

.ai-models-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ai-model-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ai-model-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--model-color);
    border-radius: 0 2px 2px 0;
}

.ai-model-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(10px);
}

.ai-model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-model-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.ai-model-type {
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-model-percentage {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--model-color);
}

.ai-model-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.ai-model-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--model-color), rgba(255, 255, 255, 0.8));
    border-radius: 3px;
    transition: width 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.ai-model-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== LIVE МЕТРИКИ ===== */

.ai-live-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.8rem;
    margin-bottom: 3rem;
}

.ai-live-card {
    background: rgba(18, 18, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1.8rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ai-live-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff6b35, transparent);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.ai-live-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ff6b35;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.ai-live-label {
    font-size: 0.9rem;
    color: #aaa;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-live-change {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* ===== ЛЕГЕНДА ===== */

.ai-chart-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.ai-legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    color: #ccc;
}

.ai-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ===== LOADING АНИМАЦИИ ===== */

.ai-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.ai-fade-in:nth-child(1) { animation-delay: 0.1s; }
.ai-fade-in:nth-child(2) { animation-delay: 0.2s; }
.ai-fade-in:nth-child(3) { animation-delay: 0.3s; }
.ai-fade-in:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== ЗАГРУЗКА И ОШИБКИ ===== */

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #cccccc;
}

.ai-loading h3,
.ai-loading p {
    animation: none;
    transform: none;
}

.ai-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 107, 53, 0.2);
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-error {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.3);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    color: #ff453a;
    margin: 2rem 0;
}

.ai-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* ===== NO DATA СОСТОЯНИЕ ===== */

.ai-no-data {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.ai-no-data i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: #444;
}

.ai-no-data h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #888;
}

.ai-no-data p {
    font-size: 1rem;
    line-height: 1.6;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .ai-header h1 {
        font-size: 2.5rem;
    }
    
    .ai-stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .ai-chart-container {
        padding: 1.8rem;
    }
    
    .ai-live-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ai-live-metrics {
        grid-template-columns: 1fr;
    }
    
    .ai-chart-legend {
        grid-template-columns: 1fr;
    }
}
