/* PREDICT Framework Custom Styles */

:root {
    --predict-primary: #007bff;
    --predict-secondary: #6c757d;
    --predict-success: #28a745;
    --predict-danger: #dc3545;
    --predict-warning: #ffc107;
    --predict-info: #17a2b8;
    --predict-light: #f8f9fa;
    --predict-dark: #343a40;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
}

/* Navigation Enhancements */
.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

/* Card Enhancements */
.card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none !important;
}

.card-header.bg-transparent {
    background: transparent !important;
    color: inherit;
}

/* Metric Cards */
.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.metric-card .card-body {
    padding: 2rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Risk Level Indicators */
.risk-critical {
    background-color: var(--predict-danger) !important;
    color: white !important;
}

.risk-high {
    background-color: #fd7e14 !important;
    color: white !important;
}

.risk-medium {
    background-color: var(--predict-warning) !important;
    color: #212529 !important;
}

.risk-low {
    background-color: var(--predict-success) !important;
    color: white !important;
}

/* Technique Badges */
.technique-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    margin: 0.125rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.technique-badge:hover {
    transform: scale(1.05);
    text-decoration: none;
}

.technique-hosting { background-color: #e74c3c; color: white; }
.technique-networking { background-color: #3498db; color: white; }
.technique-resolution { background-color: #2ecc71; color: white; }
.technique-timing { background-color: #f39c12; color: white; }
.technique-reuse { background-color: #9b59b6; color: white; }

/* Infrastructure Tables */
.infrastructure-table {
    font-size: 0.9rem;
}

.infrastructure-table th {
    background-color: var(--predict-light);
    font-weight: 600;
    border-top: none;
}

.infrastructure-table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.infrastructure-identifier {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Progress Bars */
.progress {
    height: 1rem;
    border-radius: 6px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* Prediction Cards */
.prediction-card {
    border-left: 4px solid var(--predict-primary);
    transition: all 0.3s ease;
}

.prediction-card:hover {
    border-left-color: var(--predict-info);
}

.prediction-score {
    font-size: 1.5rem;
    font-weight: 700;
}

.prediction-confidence {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0,123,255,0.25);
    border-radius: 50%;
    border-top: 2px solid #007bff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search and Filter Styles */
.search-container {
    position: relative;
}

.search-container .form-control {
    padding-left: 2.5rem;
    border-radius: 25px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-container .form-control:focus {
    border-color: var(--predict-primary);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Matrix Specific Styles */
.matrix-container {
    overflow-x: auto;
    max-height: 70vh;
}

.matrix-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.matrix-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.matrix-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .metric-value {
        font-size: 2rem;
    }

    .card-body {
        padding: 1rem;
    }

    .matrix-container {
        font-size: 0.8rem;
    }

    .technique-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Custom Alerts */
.alert-predict {
    border-left: 4px solid var(--predict-primary);
    background-color: rgba(0,123,255,0.1);
    border-color: rgba(0,123,255,0.2);
}

.alert-predict .alert-heading {
    color: var(--predict-primary);
}

/* Tooltip Enhancements */
.tooltip {
    font-size: 0.8rem;
}

.tooltip-inner {
    background-color: rgba(0,0,0,0.9);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Status Indicators */
.status-online {
    color: var(--predict-success);
}

.status-offline {
    color: var(--predict-danger);
}

.status-warning {
    color: var(--predict-warning);
}

/* Infrastructure Type Icons */
.infra-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.infra-icon.ip {
    background-color: rgba(116, 75, 162, 0.2);
    color: #764ba2;
}

.infra-icon.asn {
    background-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.infra-icon.domain {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.infra-icon.nameserver {
    background-color: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

/* Footer Styles */
footer {
    margin-top: auto;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .card-header {
        display: none !important;
    }

    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }

    body {
        background: white !important;
    }

    #vanta-canvas {
            width: 100vw;
            height: 100vh;
    }
}

/* Vanta Canvas Background - Only behind header section */
#vanta-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 250px;
    z-index: 0;
    pointer-events: none;
}

/* Ensure content is above Vanta canvas */
main.container-fluid {
    position: relative;
}

/* Header section with Vanta background */
.container-fluid > .row:first-child {
    position: relative;
    z-index: 1;
}

nav.navbar {
    position: relative;
    z-index: 2;
}

footer {
    position: relative;
    z-index: 1;
}

/* Page Headers - White text for all page titles and descriptions */
.container-fluid .row .col-12 h1,
.container-fluid .row .col-12 .h3 {
    color: white !important;
}

.container-fluid .row .col-12 .text-muted {
    color: rgba(44, 44, 44, 0.8) !important;
}