/**
 * ActProof.ai - Enhanced Dashboard Styles
 * UI/UX Expert Design: Critical-first, action-oriented
 */

/* ============================================
   CRITICAL ALERTS SECTION
   ============================================ */

.critical-alerts {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .critical-alerts {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.03));
    border-color: rgba(239, 68, 68, 0.2);
}

.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.alerts-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #ef4444;
}

[data-theme="light"] .alerts-header h3 {
    color: #dc2626;
}

.alerts-header svg {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.alerts-count {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

[data-theme="light"] .alerts-count {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Alert Item */
.alert-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

[data-theme="light"] .alert-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

.alert-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #ef4444;
}

.alert-item.alert-critical {
    border-left: 4px solid #ef4444;
}

.alert-item.alert-high {
    border-left: 4px solid #f97316;
}

.alert-item.alert-medium {
    border-left: 4px solid #eab308;
}

.alert-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.alert-description {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.alert-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.alert-file,
.alert-article {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
}

[data-theme="light"] .alert-file,
[data-theme="light"] .alert-article {
    background: rgba(0, 0, 0, 0.05);
}

.alert-file svg,
.alert-article svg {
    width: 14px;
    height: 14px;
}

.alert-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.alert-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.alert-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .alert-details {
    border-color: rgba(0, 0, 0, 0.1);
}

.alert-action {
    margin-bottom: 16px;
}

.alert-action h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
}

.alert-action p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.alert-code {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    position: relative;
}

[data-theme="light"] .alert-code {
    background: rgba(0, 0, 0, 0.05);
}

.alert-code h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.alert-code pre {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    color: #e5e7eb;
}

[data-theme="light"] .alert-code pre {
    color: #1f2937;
}

.alert-code button {
    margin-top: 12px;
}

/* ============================================
   ACTIONABLE INSIGHTS SECTION
   ============================================ */

.actionable-insights {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
}

[data-theme="light"] .actionable-insights {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    border-color: rgba(59, 130, 246, 0.2);
}

.actionable-insights h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px 0;
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
}

[data-theme="light"] .actionable-insights h3 {
    color: #2563eb;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insight-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    transition: all 0.3s ease;
}

[data-theme="light"] .insight-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

.insight-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.insight-item.insight-high {
    border-left: 4px solid #ef4444;
}

.insight-item.insight-medium {
    border-left: 4px solid #f59e0b;
}

.insight-item.insight-low {
    border-left: 4px solid #10b981;
}

.insight-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.insight-content p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.insight-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.insight-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 40px;
}

.insights-actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    justify-content: center;
}

[data-theme="light"] .insights-actions {
    border-color: rgba(0, 0, 0, 0.1);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-sm.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-sm.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .btn-sm.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.btn-sm.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

[data-theme="light"] .btn-sm.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

.alert-item,
.insight-item {
    animation: slideIn 0.3s ease forwards;
}

.alert-item:nth-child(1) { animation-delay: 0.05s; }
.alert-item:nth-child(2) { animation-delay: 0.1s; }
.alert-item:nth-child(3) { animation-delay: 0.15s; }
.alert-item:nth-child(4) { animation-delay: 0.2s; }
.alert-item:nth-child(5) { animation-delay: 0.25s; }

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

@media (max-width: 768px) {
    .critical-alerts,
    .actionable-insights {
        padding: 20px;
    }

    .alerts-header,
    .actionable-insights h3 {
        font-size: 20px;
    }

    .alert-item,
    .insight-item {
        padding: 16px;
    }

    .insight-actions {
        flex-direction: column;
    }

    .btn-sm {
        width: 100%;
        justify-content: center;
    }
}
