/* static/css/pages/drill-analytics.css */
.analytics-page {
    padding: var(--space-xl) 0;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

.time-filters {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    border: 1px solid var(--border);
}

.time-filter.active {
    background: var(--primary-blue);
    color: white;
}

.export-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Loading States */
.analytics-loading {
    text-align: center;
    padding: var(--space-4xl) 0;
}

.loading-chart {
    max-width: 400px;
    margin: 0 auto var(--space-xl);
}

.chart-skeleton {
    height: 200px;
    background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-lg);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Metrics Grid */
.metrics-section {
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-dark);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.metric-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: var(--space-xs);
}

.metric-label {
    color: var(--text-soft);
    font-size: 0.875rem;
}

.metric-icon {
    font-size: 2rem;
    color: var(--primary-blue-light);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.chart-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.chart-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.chart-actions {
    display: flex;
    gap: var(--space-sm);
}

.chart-action-btn {
    background: none;
    border: none;
    color: var(--text-soft);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.chart-action-btn:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.chart-container {
    padding: var(--space-lg);
    height: 300px;
    position: relative;
}

/* Participants Table */
.participants-section {
    margin-bottom: var(--space-2xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.search-input {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-dark);
    min-width: 250px;
}

.participants-table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.participants-table {
    width: 100%;
    border-collapse: collapse;
}

.participants-table th {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    padding: var(--space-lg);
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.participants-table td {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.participants-table tr:last-child td {
    border-bottom: none;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.participant-name {
    font-weight: 500;
    color: var(--text-dark);
}

.participant-email {
    font-size: 0.875rem;
    color: var(--text-soft);
}

/* Status badges */
.status-badge {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-completed {
    background: var(--success);
    color: white;
}

.status-in_progress {
    background: var(--warning);
    color: var(--text-dark);
}

.status-unknown {
    background: var(--border);
    color: var(--text-soft);
}

/* Rank badges */
.rank-badge {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.rank-1 {
    background: gold;
    color: var(--text-dark);
}

.rank-2 {
    background: silver;
    color: var(--text-dark);
}

.rank-3 {
    background: #cd7f32; /* bronze */
    color: white;
}

/* Dio change indicators */
.dio-positive {
    color: var(--success);
    font-weight: 600;
}

.dio-negative {
    color: var(--error);
    font-weight: 600;
}

.dio-neutral {
    color: var(--text-soft);
}

/* Progress bars */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: var(--space-xs);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    transition: width var(--transition-normal);
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.insight-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
}

.insight-icon {
    font-size: 1.5rem;
    padding: var(--space-md);
    border-radius: var(--radius-md);
}

.insight-icon.success {
    background: var(--success);
    color: white;
}

.insight-icon.warning {
    background: var(--warning);
    color: var(--text-dark);
}

.insight-icon.info {
    background: var(--primary-blue);
    color: white;
}

.insight-icon.error {
    background: var(--error);
    color: white;
}

.insight-content h4 {
    margin: 0 0 var(--space-sm) 0;
    font-weight: 600;
    color: var(--text-dark);
}

.insight-content p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.5;
}

/* Error States */
.analytics-error {
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
}

.analytics-error .error-icon {
    font-size: 4rem;
    color: var(--warning);
    margin-bottom: var(--space-xl);
}

.analytics-error h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--text-dark);
}

.analytics-error p {
    color: var(--text-soft);
    margin-bottom: var(--space-xl);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* No data messages */
.no-data-message {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-soft);
}

.no-data-message i {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

/* Toast notifications */
.analytics-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-info {
    border-left: 4px solid var(--primary-blue);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-soft);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
}

.toast-close:hover {
    background: var(--border);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .analytics-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: space-between;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .participants-table {
        font-size: 0.875rem;
    }
    
    .participants-table th,
    .participants-table td {
        padding: var(--space-md);
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .metric-card {
        padding: var(--space-lg);
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
}
/* In drill-analytics.css - Update participant avatar styles */
.participant-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.participant-name {
    font-weight: 500;
    color: var(--text-dark);
}

.participant-email {
    font-size: 0.875rem;
    color: var(--text-soft);
}