/* Email Header Analyzer Custom Styles */

/* Hero Section */
.email-hero {
    background: linear-gradient(135deg, #4a6baf 0%, #2c3e50 100%);
    padding: 3rem 0;
    color: #fff;
    margin-bottom: 2rem;
}

.email-hero h1 {
    font-weight: 700;
    font-size: 2.25rem;
}

.email-hero .lead {
    font-size: 1.15rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Container Styles */
.email-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Form Styles */
.options-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#emailHeaders {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

/* Button Styles */
.btn-primary {
    background-color: #4a6baf;
    border-color: #4a6baf;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #3a5a9f;
    border-color: #3a5a9f;
}

.btn-outline-secondary {
    color: #4a6baf;
    border-color: #4a6baf;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: #4a6baf;
    border-color: #4a6baf;
    color: #fff;
}

/* Loading & Progress Styles */
.email-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    text-align: center;
}

.progress-container {
    margin: 1.5rem 0;
}

.analysis-progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.analysis-progress-bar {
    height: 100%;
    background-color: #4a6baf;
    transition: width 0.3s ease;
}

/* Error Message */
.email-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Results Container */
.results-container {
    margin-top: 2rem;
}

/* Risk Score Styles */
.risk-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.risk-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.low-risk {
    background-color: #28a745;
}

.medium-risk {
    background-color: #ffc107;
    color: #212529;
}

.high-risk {
    background-color: #dc3545;
}

/* Analysis Tabs */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    padding: 0.75rem 1rem;
    font-weight: 600;
    position: relative;
}

.nav-tabs .nav-link.active {
    color: #4a6baf;
    background-color: transparent;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #4a6baf;
}

/* Analysis Section */
.analysis-section {
    margin-bottom: 2rem;
}

.analysis-section h5 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    color: #4a6baf;
}

/* Metadata Items */
.metadata-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.metadata-label {
    font-weight: 600;
    color: #495057;
}

.metadata-value {
    color: #6c757d;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

/* Authentication Results */
.auth-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.auth-protocol {
    font-weight: 700;
    width: 80px;
}

.auth-status {
    flex-grow: 1;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    margin: 0 0.75rem;
}

.auth-status.pass {
    background-color: #d4edda;
    color: #155724;
}

.auth-status.fail {
    background-color: #f8d7da;
    color: #721c24;
}

.auth-status.unknown, .auth-status.none {
    background-color: #e2e3e5;
    color: #383d41;
}

.auth-icon {
    width: 24px;
    text-align: center;
}

.auth-icon .fa-check-circle {
    color: #28a745;
}

.auth-icon .fa-times-circle {
    color: #dc3545;
}

.auth-icon .fa-question-circle {
    color: #6c757d;
}

/* Threat Indicators */
.threat-indicator {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.threat-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.threat-high {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

.threat-medium {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.threat-low {
    background-color: #d1ecf1;
    border-left: 4px solid #17a2b8;
}

/* Routing Path */
.routing-path {
    margin: 1rem 0;
}

.routing-hop {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.first-hop {
    border-left: 4px solid #28a745;
}

.last-hop {
    border-left: 4px solid #4a6baf;
}

.hop-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #4a6baf;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
}

.hop-details {
    flex-grow: 1;
}

.hop-server {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hop-ip {
    color: #6c757d;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.hop-time {
    color: #6c757d;
    font-size: 0.85rem;
}

.routing-connector {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
    color: #6c757d;
}

/* Recommendations */
.recommendations-list {
    padding-left: 1.5rem;
}

.recommendation-item {
    margin-bottom: 0.75rem;
    position: relative;
}

.recommendation-item.high::before {
    content: '!';
    position: absolute;
    left: -1.5rem;
    width: 18px;
    height: 18px;
    background-color: #dc3545;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.recommendation-item.medium::before {
    content: '!';
    position: absolute;
    left: -1.5rem;
    width: 18px;
    height: 18px;
    background-color: #ffc107;
    color: #212529;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.recommendation-item.low::before {
    content: 'i';
    position: absolute;
    left: -1.5rem;
    width: 18px;
    height: 18px;
    background-color: #17a2b8;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-style: italic;
    font-size: 0.75rem;
}

/* FAQ Section */
.accordion-item {
    border: none;
    margin-bottom: 1rem;
}

.accordion-header {
    margin: 0;
}

.accordion-button {
    font-weight: 600;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px !important;
}

.accordion-button:not(.collapsed) {
    color: #4a6baf;
    background-color: #e7f1ff;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: #e9ecef;
}

.accordion-body {
    padding: 1rem;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
}

/* Related Tools Cards */
.related-tools .card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.related-tools .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.related-tools h3 {
    color: #4a6baf;
}

/* Dark Mode Support */
[data-theme="dark"] .email-container {
    background-color: #1a1f2e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .options-card {
    background-color: #252b3d;
}

[data-theme="dark"] .risk-score-container {
    background-color: #252b3d;
}

[data-theme="dark"] .nav-tabs {
    border-bottom-color: #334155;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #e2e8f0;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    color: #3b82f6;
}

[data-theme="dark"] .nav-tabs .nav-link.active::after {
    background-color: #3b82f6;
}

[data-theme="dark"] .analysis-section h5 {
    border-bottom-color: #334155;
    color: #3b82f6;
}

[data-theme="dark"] .metadata-item {
    border-bottom-color: #334155;
}

[data-theme="dark"] .metadata-label {
    color: #e2e8f0;
}

[data-theme="dark"] .metadata-value {
    color: #cbd5e1;
}

[data-theme="dark"] .auth-item,
[data-theme="dark"] .routing-hop {
    background-color: #252b3d;
}

[data-theme="dark"] .accordion-button {
    background-color: #252b3d;
    color: #e2e8f0;
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #334155;
    color: #3b82f6;
}

[data-theme="dark"] .accordion-body {
    background-color: #1a1f2e;
    color: #e2e8f0;
}

/* IP Geolocation Styles */
.ip-details-list {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.ip-detail-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
}

.ip-address {
    font-weight: bold;
    font-family: monospace;
    margin-bottom: 5px;
}

.ip-info {
    color: #555;
    margin-bottom: 3px;
}

.ip-org {
    color: #777;
    font-size: 0.9em;
}

/* URL Threat Analysis Styles */
.url-threats-section {
    margin-top: 20px;
}

.url-threats-container {
    margin-top: 10px;
}

.url-threat-item {
    margin-bottom: 15px;
}

.url-item {
    font-family: monospace;
    word-break: break-all;
}

.url-threat-stats {
    margin: 10px 0;
}

/* Hop Count and Delay Analysis */
.hop-count {
    font-size: 1.2em;
    font-weight: bold;
    color: #495057;
}

.delivery-time {
    font-size: 1.1em;
    color: #6c757d;
}

/* Export Buttons */
.export-buttons {
    margin: 15px 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .email-hero {
        padding: 2rem 0;
    }
    
    .email-hero h1 {
        font-size: 1.75rem;
    }
    
    .risk-score-circle {
        width: 100px;
        height: 100px;
        font-size: 2rem;
    }
    
    .metadata-item {
        flex-direction: column;
    }
    
    .metadata-value {
        text-align: left;
        max-width: 100%;
        margin-top: 0.25rem;
    }
    
    .auth-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .auth-status {
        margin: 0.5rem 0;
        width: 100%;
    }
    
    .auth-icon {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .email-header-analyzer {
        background-color: #1a1a1a;
        color: #f0f0f0;
    }
    
    .card, .accordion-item {
        background-color: #2a2a2a;
        border-color: #444;
    }
    
    .card-header, .accordion-button {
        background-color: #333;
        color: #f0f0f0;
    }
    
    .text-muted {
        color: #aaa !important;
    }
    
    .form-control, .form-select {
        background-color: #333;
        border-color: #555;
        color: #f0f0f0;
    }
    
    .form-check-input {
        background-color: #444;
        border-color: #666;
    }
    
    .btn-outline-secondary {
        color: #ccc;
        border-color: #666;
    }
    
    .btn-outline-secondary:hover {
        background-color: #444;
        color: #fff;
    }
    
    .upload-area {
        background-color: #333;
        border-color: #555;
    }
    
    .upload-area:hover, .upload-area.dragover {
        background-color: #444;
    }
    
    .nav-tabs .nav-link {
        color: #ccc;
    }
    
    .nav-tabs .nav-link.active {
        background-color: #2a2a2a;
        color: #fff;
        border-color: #444 #444 #2a2a2a;
    }
    
    .analysis-section {
        border-color: #444;
    }
    
    .metadata-label {
        color: #bbb;
    }
    
    .auth-item {
        background-color: #333;
    }
    
    .routing-hop {
        background-color: #333;
    }
    
    .routing-connector {
        color: #888;
    }
    
    .threat-indicator {
        background-color: #333;
    }
    
    .ip-detail-item {
        background-color: #333;
        border-color: #555;
    }
    
    .ip-info {
        color: #bbb;
    }
    
    .ip-org {
        color: #999;
    }
}
