/* Analytics Dashboard Styles */

.filter-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.filter-section label {
    font-weight: 600;
    margin-right: 10px;
    color: #333;
}

.metrics-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.metrics-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.metric-icon {
    font-size: 24px;
}

.metric-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.metric-label {
    font-size: 12px;
    opacity: 0.9;
    margin-left: auto;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.metric-details {
    font-size: 12px;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.error-list-section {
    margin-top: 20px;
}

.error-list-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.error-list {
    max-height: 400px;
    overflow-y: auto;
}

.error-item {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.error-item.error {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.error-item.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.error-item.info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
}

.error-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.error-type {
    font-weight: 700;
    color: #dc3545;
    font-size: 14px;
}

.error-time {
    font-size: 12px;
    color: #666;
}

.error-message {
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.error-module {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.error-url {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    word-break: break-all;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #007bff;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Phase 2: Business Intelligence, Cost Analytics, ROI Dashboard Styles */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    height: 300px;
}

.correlation-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
}

.insights-container {
    margin-top: 20px;
}

.insight-item {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.insight-item.positive {
    border-left-color: #28a745;
    background: #d4edda;
}

.insight-item.warning {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.insight-item.negative {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.insight-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.insight-message {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.insight-recommendation {
    color: #007bff;
    font-size: 13px;
    font-style: italic;
}

.cost-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.cost-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.cost-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 600;
}

.cost-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.cost-label {
    font-size: 12px;
    opacity: 0.8;
}

.breakdown-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    font-weight: 600;
    color: #333;
}

.breakdown-value {
    color: #007bff;
    font-weight: 600;
}

.roi-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.roi-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
}

.roi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.roi-card.highlight {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border-color: transparent;
}

.roi-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.roi-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
}

.roi-label {
    font-size: 12px;
    opacity: 0.8;
}

.recommendations-container {
    margin-top: 20px;
}

.recommendation-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.recommendation-item.high {
    border-left-color: #dc3545;
}

.recommendation-item.medium {
    border-left-color: #ffc107;
}

.recommendation-item.low {
    border-left-color: #28a745;
}

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

.recommendation-title {
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.recommendation-priority {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.recommendation-priority.high {
    background: #dc3545;
    color: white;
}

.recommendation-priority.medium {
    background: #ffc107;
    color: #333;
}

.recommendation-priority.low {
    background: #28a745;
    color: white;
}

.recommendation-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.recommendation-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* Alert/Notification System */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.alert {
    background: #fff;
    border-left: 4px solid #007bff;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.success {
    border-left-color: #28a745;
    background: #d4edda;
}

.alert.warning {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.alert.error {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.alert.info {
    border-left-color: #17a2b8;
    background: #d1ecf1;
}

.alert-icon {
    font-size: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 3px;
    color: #333;
}

.alert-message {
    font-size: 13px;
    color: #666;
}

.alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close:hover {
    color: #333;
}

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

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

.alert.removing {
    animation: slideOut 0.3s ease-out;
}

/* Real-time indicator */
.realtime-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    margin-left: 5px;
    animation: pulse 2s infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .cost-summary-grid,
    .roi-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
    
    .alert-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

