/* Contrast Security Dashboard - Shared CSS Template */
/* Enhanced MCP Dashboard Styling - Consistent across all dashboards */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Timestamp and Info Badges */
.timestamp {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 20px;
    display: inline-block;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

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

/* Color Classes */
.critical { color: #dc2626; }
.high { color: #ea580c; }
.medium { color: #d97706; }
.low { color: #65a30d; }
.note { color: #0891b2; }
.positive { color: #16a34a; }
.negative { color: #dc2626; }
.warning { color: #d97706; }
.info { color: #2563eb; }
.total { color: #6366f1; }
.monitoring { color: #f59e0b; }
.blocking { color: #10b981; }
.off { color: #ef4444; }

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Chart Container */
.chart-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    height: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Section Styling */
.app-section, .section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-header, .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.app-name, .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.app-stats, .section-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #64748b;
}

/* Item Cards */
.vuln-item, .rule-card, .cost-item, .item-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s ease;
}

.vuln-item:hover, .rule-card:hover, .cost-item:hover, .item-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    transform: translateX(5px);
}

.vuln-item.critical, .rule-card.critical, .item-card.critical { border-left-color: #dc2626; }
.vuln-item.high, .rule-card.high, .item-card.high { border-left-color: #ea580c; }
.vuln-item.medium, .rule-card.medium, .item-card.medium { border-left-color: #d97706; }
.vuln-item.monitoring, .rule-card.monitoring, .item-card.monitoring { border-left-color: #f59e0b; }
.vuln-item.blocking, .rule-card.blocking, .item-card.blocking { border-left-color: #10b981; }
.vuln-item.off, .rule-card.off, .item-card.off { border-left-color: #ef4444; }

.vuln-header, .rule-header, .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.vuln-title, .rule-name, .item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

/* Badges */
.severity-badge, .status-badge, .badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical, .badge.critical {
    background: #fef2f2;
    color: #dc2626;
}

.severity-badge.high, .badge.high {
    background: #fff7ed;
    color: #ea580c;
}

.severity-badge.medium, .badge.medium {
    background: #fefbf2;
    color: #d97706;
}

.status-badge.monitoring, .badge.monitoring {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.blocking, .badge.blocking {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.off, .badge.off {
    background: #fee2e2;
    color: #dc2626;
}

.status-reported {
    background: #fef2f2;
    color: #dc2626;
}

.status-remediated {
    background: #f0fdf4;
    color: #16a34a;
}

/* Description and Details */
.vuln-description, .rule-description, .item-description {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}

.vuln-details, .rule-details, .item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.detail-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    color: #1e293b;
}

.effort-hours {
    color: #7c3aed;
    font-weight: 700;
}

/* Summary Cards */
.summary-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    font-size: 0.9rem;
    color: #64748b;
}

.metric-value {
    font-weight: 600;
    color: #1e293b;
}

/* Timeline Styles */
.timeline-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid #2563eb;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.timeline-item.critical { border-left-color: #dc2626; }
.timeline-item.blocked { border-left-color: #16a34a; }
.timeline-item.exploited { border-left-color: #d97706; }

.timeline-date {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 4px;
}

.timeline-event {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 6px;
    font-weight: 500;
}

.timeline-impact {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* ROI Specific Styles */
.roi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.roi-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.roi-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.roi-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.roi-label {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 8px;
}

.roi-description {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.4;
}

/* Cost Breakdown */
.cost-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.cost-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.cost-label {
    font-size: 1rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 12px;
}

.cost-details {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* Environment Badges */
.rule-environments, .env-status-grid {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.env-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.env-status.monitoring {
    background: #fef3c7;
    color: #92400e;
}

.env-status.blocking {
    background: #dcfce7;
    color: #166534;
}

.env-status.off {
    background: #fee2e2;
    color: #991b1b;
}

/* Footer */
.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 40px;
    font-size: 0.9rem;
}

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

@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .header h1 {
        font-size: 2.5rem;
    }
    
    .app-header, .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .vuln-details, .rule-details, .item-details {
        grid-template-columns: 1fr;
    }

    .stats-grid, .roi-grid {
        grid-template-columns: 1fr;
    }

    .cost-breakdown {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease forwards;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

/* Scrollbar Styling */
.scrollable {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.3) transparent;
}

.scrollable::-webkit-scrollbar {
    width: 6px;
}

.scrollable::-webkit-scrollbar-track {
    background: rgba(100, 116, 139, 0.1);
    border-radius: 3px;
}

.scrollable::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 3px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}