/**
 * IP Reputation Aggregator Styles
 * 
 * Custom styling for the IP reputation analysis tool
 * Provides modern, professional interface for threat intelligence visualization
 */

/* Threat Score Circle */
.threat-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: conic-gradient(#28a745 0deg, #e9ecef 0deg);
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.threat-score-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 50%;
    z-index: 1;
}

.threat-score-circle .score {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    z-index: 2;
    position: relative;
}

.threat-score-circle .label {
    font-size: 12px;
    color: #666;
    z-index: 2;
    position: relative;
    margin-top: -2px;
}

/* Threat Category Cards */
.threat-category-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.threat-category-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Progress Bars */
.progress {
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Threat Score Bar */
.threat-score-bar .progress {
    height: 20px;
    border-radius: 10px;
}

.threat-score-bar .progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* Consensus and Confidence Meters */
.consensus-meter,
.confidence-meter {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

/* Feed Status Cards */
.feed-status-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.feed-status-card:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

/* Results Container */
.results-container {
    animation: fadeIn 0.5s ease-in;
}

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

/* Advanced Options */
.advanced-options {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

/* Badge Enhancements */
.badge {
    font-size: 0.75em;
    padding: 0.375em 0.75em;
    border-radius: 0.375rem;
}

.badge-danger { background-color: #dc3545; }
.badge-warning { background-color: #fd7e14; }
.badge-info { background-color: #17a2b8; }
.badge-success { background-color: #28a745; }
.badge-secondary { background-color: #6c757d; }

/* Card Enhancements */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.125);
    border-radius: 8px 8px 0 0 !important;
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-danger { border-left-color: #dc3545; }
.alert-warning { border-left-color: #fd7e14; }
.alert-info { border-left-color: #17a2b8; }
.alert-success { border-left-color: #28a745; }

/* Table Enhancements */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.table td {
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

/* Button Enhancements */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
}

.btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Form Enhancements */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.input-group-append .btn {
    border-radius: 0 6px 6px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .threat-score-circle {
        width: 100px;
        height: 100px;
    }
    
    .threat-score-circle::before {
        width: 75px;
        height: 75px;
    }
    
    .threat-score-circle .score {
        font-size: 20px;
    }
    
    .threat-category-card {
        margin-bottom: 15px;
    }
    
    .feed-status-card {
        margin-bottom: 10px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .threat-score-circle {
        width: 80px;
        height: 80px;
    }
    
    .threat-score-circle::before {
        width: 60px;
        height: 60px;
    }
    
    .threat-score-circle .score {
        font-size: 16px;
    }
    
    .threat-score-circle .label {
        font-size: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .advanced-options {
        padding: 15px;
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Tooltip Enhancements */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: #333;
    border-radius: 4px;
    padding: 8px 12px;
}

/* Icon Enhancements */
.fas, .far {
    transition: all 0.3s ease;
}

.card-header .fas {
    opacity: 0.8;
}

/* Risk Level Colors */
.text-critical { color: #dc3545 !important; }
.text-high { color: #fd7e14 !important; }
.text-medium { color: #17a2b8 !important; }
.text-low { color: #28a745 !important; }
.text-minimal { color: #6c757d !important; }

.bg-critical { background-color: #dc3545 !important; }
.bg-high { background-color: #fd7e14 !important; }
.bg-medium { background-color: #17a2b8 !important; }
.bg-low { background-color: #28a745 !important; }
.bg-minimal { background-color: #6c757d !important; }

/* Print Styles */
@media print {
    .btn, .modal, .advanced-options {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .threat-score-circle {
        background: none !important;
        border: 2px solid #333;
    }
    
    .progress-bar {
        background: #333 !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .threat-category-card,
    .consensus-meter,
    .confidence-meter,
    .feed-status-card,
    .advanced-options {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .threat-score-circle::before {
        background: #2d3748;
    }
    
    .threat-score-circle .score,
    .threat-score-circle .label {
        color: #e2e8f0;
    }
    
    .table th {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .table-striped tbody tr:nth-of-type(odd) {
        background-color: rgba(255,255,255,0.05);
    }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Focus Indicators */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid;
    }
    
    .progress {
        border: 1px solid #000;
    }
    
    .threat-score-circle {
        border: 2px solid #000;
    }
} 