/* ===================================
   Overview Charts Component Styles
   Стили для графиков и компонентов главной страницы
   =================================== */

/* Plan Status Card */
.plan-status-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Анимации для критических статусов */
.plan-status-card.status-warning {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.plan-status-card.status-critical {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    animation: pulse-border 2s infinite;
}

.plan-status-card.status-blocked {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, transparent 100%);
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.05);
    }
}

/* Индикатор статуса */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.status-indicator.status-ok {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-indicator.status-warning {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
    animation: pulse-status 2s infinite;
}

.status-indicator.status-critical {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
    animation: pulse-status 1s infinite;
}

.status-indicator.status-blocked {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

.status-indicator.status-on_demand {
    background: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

@keyframes pulse-status {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Сообщение о статусе */
.plan-status-message {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: 1.4;
    margin-bottom: var(--space-3);
}

.plan-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.plan-badge {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.plan-usage {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.plan-actions {
    margin-bottom: var(--space-4);
}

#upgrade-plan-btn {
    width: 100%;
}

.progress-bar-wrapper {
    position: relative;
}

.progress-bar {
    height: 12px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill[data-status="warning"] {
    background: linear-gradient(90deg, #f59e0b 0%, #eab308 100%);
}

.progress-fill[data-status="danger"] {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.progress-text {
    position: absolute;
    top: 50%;
    right: var(--space-3);
    transform: translateY(-50%);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
}

/* Quick Stats Grid */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

/* Chart Card */
.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.chart-header h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: var(--space-2);
}

.toggle-btn {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.toggle-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.chart-container {
    min-height: 280px;
    position: relative;
}

.chart-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-color);
}

.chart-insight {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.chart-insight::before {
    content: "💡";
    font-size: var(--font-size-md);
}

/* Recent Activity Card */
.recent-activity-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.recent-activity-header {
    margin-bottom: var(--space-4);
}

.recent-activity-header h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.activity-item {
    padding: var(--space-3);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--color-bg-tertiary);
}

.activity-info {
    flex: 1;
}

.activity-model {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-1);
}

.activity-time {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.activity-stats {
    display: flex;
    gap: var(--space-4);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.activity-loading {
    text-align: center;
    padding: var(--space-6);
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
}

.view-all-link {
    display: block;
    text-align: center;
    margin-top: var(--space-4);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: opacity 0.2s;
}

.view-all-link:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quick-stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .chart-controls {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
    }

    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .activity-stats {
        width: 100%;
        justify-content: space-between;
    }
}

/* Loading State */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
}

.chart-loading::before {
    content: "📊";
    font-size: var(--font-size-2xl);
    margin-right: var(--space-2);
    animation: pulse 2s infinite;
}

/* Empty State */
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
    text-align: center;
    padding: var(--space-6);
}

.chart-empty::before {
    content: "📈";
    font-size: 48px;
    margin-bottom: var(--space-3);
    opacity: 0.3;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

