/* EmailBuddy Custom Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #fd7e14;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', '微软雅黑', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', '黑体', 'Noto Sans CJK SC', 'Source Han Sans SC', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
}

/* Ensure proper sticky footer layout */
body.d-flex {
    min-height: 100vh;
}

main.flex-grow-1 {
    flex: 1 0 auto;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

/* Cards and Content */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 10px;
    overflow: hidden;
}

.card-header {
    background-color: var(--light-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Email content styling */
.email-content {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    /* Removed background-color to allow HTML emails to display with their intended colors */
}

/* Ensure tab content has minimum height when active */
.tab-pane.active {
    min-height: 100px;
}

#richContent.email-content, #plainContent.email-content-text {
    min-height: 200px;
}

.email-headers {
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', 'Noto Sans Mono CJK SC', 'Source Han Sans HW SC', '等距更纱黑体 SC', 'Sarasa Mono SC', monospace;
    font-size: 0.875rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.email-plain-text {
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Courier New', 'Noto Sans Mono CJK SC', 'Source Han Sans HW SC', '等距更纱黑体 SC', 'Sarasa Mono SC', monospace;
    font-size: 0.875rem;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.email-raw-content {
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Monaco', 'Courier New', 'Noto Sans Mono CJK SC', 'Source Han Sans HW SC', '等距更纱黑体 SC', 'Sarasa Mono SC', monospace;
    font-size: 12px;
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #444;
    border-radius: 0.375rem;
    padding: 15px;
    line-height: 1.4;
    tab-size: 4;
}

.email-content-text {
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    font-family: 'Consolas', 'Courier New', 'Noto Sans Mono CJK SC', 'Source Han Sans HW SC', '等距更纱黑体 SC', 'Sarasa Mono SC', monospace;
    font-size: 0.875rem;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    line-height: 1.4;
}

.email-html-content iframe {
    width: 100%;
    min-height: 400px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

/* Load Area */
.load-area {
    border: 3px dashed #dee2e6;
    border-radius: 10px;
    padding: 3rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.load-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.load-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
    transform: scale(1.02);
}

/* Links and attachments now use Bootstrap card components */

/* Header table styling */
.table th {
    background-color: var(--light-bg);
    border-top: none;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.table td {
    font-family: 'Consolas', 'Courier New', 'Noto Sans Mono CJK SC', 'Source Han Sans HW SC', '等距更纱黑体 SC', 'Sarasa Mono SC', monospace;
    font-size: 0.8rem;
    word-break: break-word;
    vertical-align: top;
}

/* Security and status indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-clean {
    background-color: var(--success-color);
}

.status-threat {
    background-color: var(--danger-color);
}

.status-pending {
    background-color: var(--warning-color);
}

.status-unknown {
    background-color: var(--secondary-color);
}

/* Authentication status in sidebar */
.auth-status-badge {
    font-size: 0.9rem !important;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.auth-status-badge .bi {
    font-size: 1rem;
}


/* Ensure sidebar cards stack properly */
.col-lg-4 .card {
    margin-bottom: 1rem;
}

.col-lg-4 .card:last-child {
    margin-bottom: 0;
}

/* Force proper grid behavior and override any conflicts */
#emailResults {
    display: flex !important;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

#emailResults .col-lg-8 {
    flex: 0 0 66.666667% !important;
    max-width: 66.666667% !important;
    padding-left: 15px;
    padding-right: 15px;
    position: relative;
    width: 100%;
}

#emailResults .col-lg-4 {
    flex: 0 0 33.333333% !important;
    max-width: 33.333333% !important;
    padding-left: 15px;
    padding-right: 15px;
    position: relative;
    width: 100%;
}

/* Responsive behavior for smaller screens */
@media (max-width: 991.98px) {
    #emailResults .col-lg-8,
    #emailResults .col-lg-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Improved visual hierarchy */
.summary-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

/* Scrollbar styling for webkit browsers */
.email-content::-webkit-scrollbar,
.email-headers::-webkit-scrollbar,
.email-plain-text::-webkit-scrollbar,
.email-content-text::-webkit-scrollbar,
.email-raw-content::-webkit-scrollbar {
    width: 8px;
}

.email-content::-webkit-scrollbar-track,
.email-headers::-webkit-scrollbar-track,
.email-plain-text::-webkit-scrollbar-track,
.email-content-text::-webkit-scrollbar-track,
.email-raw-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.email-content::-webkit-scrollbar-thumb,
.email-headers::-webkit-scrollbar-thumb,
.email-plain-text::-webkit-scrollbar-thumb,
.email-content-text::-webkit-scrollbar-thumb,
.email-raw-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.email-content::-webkit-scrollbar-thumb:hover,
.email-headers::-webkit-scrollbar-thumb:hover,
.email-plain-text::-webkit-scrollbar-thumb:hover,
.email-content-text::-webkit-scrollbar-thumb:hover,
.email-raw-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Small alerts for API key messages */
.alert-sm {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Tab content styling */
.nav-tabs .nav-link {
    border-bottom: 1px solid transparent;
    color: var(--secondary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef var(--primary-color);
    color: var(--primary-color);
}

/* Ensure consistent spacing for content areas */
.tab-content {
    margin-top: 1rem;
}

/* Better spacing for empty state messages */
.text-center.text-muted.py-4 {
    padding: 3rem 1.5rem !important;
}

.text-center.text-muted.py-4 i {
    opacity: 0.5;
}

/* Improve button styling in attachments and links */
.btn-group-vertical .btn {
    margin-bottom: 0.25rem;
}

.btn-group-vertical .btn:last-child {
    margin-bottom: 0;
}

/* Email View Styles */
.summary-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

/* Summary Section Styling */
.summary-section {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.summary-section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.summary-section-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
    margin: 0;
}

.summary-section-content {
    padding: 1rem;
}

.summary-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.summary-label .badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.summary-value {
    color: #212529;
    line-height: 1.4;
    word-break: break-word;
}

/* Recipient Table Styling */
.recipient-table {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
    margin-top: 0.25rem;
}

.recipient-row {
    background-color: #fff;
    transition: background-color 0.15s ease-in-out;
    padding: 0.5rem 0.75rem;
}

.recipient-row:hover {
    background-color: #f8f9fa;
}

.recipient-row:last-child {
    border-bottom: none !important;
}

.recipient-info .recipient-name {
    line-height: 1.2;
    margin-bottom: 3px;
    font-size: 0.875rem;
    font-weight: 500;
}

.recipient-info .recipient-email {
    line-height: 1.1;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #6c757d;
}

.domain-security .badge {
    font-size: 0.65rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.domain-security .badge i {
    font-size: 0.7rem;
}

/* Authentication Grid Styling */
.auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.auth-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
}

.auth-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.auth-status {
    display: flex;
    justify-content: center;
}

.auth-status .badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.6rem;
}

/* Statistics Cards */
.stat-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.auth-status-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Link and attachment items now use card styling - old styles removed */
.link-url {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    text-decoration: none;
}

.link-url:hover {
    text-decoration: underline;
}

/* VirusTotal result styles */
.vt-result {
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 1px solid #dee2e6;
}

.vt-result.vt-clean {
    background-color: #d1eddd;
    border-color: #badbcc;
    color: #0f5132;
}

.vt-result.vt-threat {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.vt-result.vt-pending {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

/* Content Display */
.pre-scrollable {
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.875rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 1rem;
}

#htmlContentDisplay {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 1rem;
    background-color: white;
}

/* Email headers styling */
.email-header-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.email-header-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.email-header-label {
    font-weight: 600;
    color: var(--dark-color);
    display: inline-block;
    min-width: 80px;
}

.email-header-value {
    color: #6c757d;
    word-break: break-all;
}

/* Attachments and Links now use Bootstrap card styling */

/* Virus scan results */
.scan-result {
    border-radius: 5px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.scan-result.clean {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.scan-result.malicious {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.scan-result.suspicious {
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid var(--warning-color);
    color: #856404;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .load-zone {
        padding: 2rem;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .attachment-item,
    .link-item,
    .security-item {
        padding: 0.5rem;
    }
}

/* Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Footer Styles */
footer {
    background-color: var(--light-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    text-decoration: underline !important;
    transform: translateY(-1px);
}

footer .text-primary:hover {
    color: #0a58ca !important;
}

footer .text-secondary:hover {
    color: #495057 !important;
}

footer .bi {
    transition: transform 0.3s ease;
}

footer a:hover .bi {
    transform: scale(1.1);
}

/* Feature Categories Styling */
.feature-category {
    transition: transform 0.2s ease-in-out;
}

.feature-category:hover {
    transform: translateY(-2px);
}

.feature-category h6 {
    font-weight: 600;
    margin-bottom: 0.75rem !important;
}

.feature-category .list-unstyled {
    border-left: 2px solid rgba(13, 110, 253, 0.1);
    padding-left: 1rem !important;
}

.feature-category .list-unstyled li {
    transition: color 0.2s ease-in-out;
    font-size: 0.9rem;
}

.feature-category .list-unstyled li:hover {
    color: var(--primary-color);
}

.feature-category .bi-check-circle {
    font-size: 0.9rem;
}

/* Delivery Path Tab Styles */
.delivery-analysis-container {
    max-width: 100%;
}

.delivery-path-timeline {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.timeline-container {
    background-color: white;
    border-radius: 0.375rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

/* Timeline Visualization */
.delivery-timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 1rem;
    z-index: 2;
}

.timeline-marker i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hop-number {
    background-color: #6c757d;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.timeline-content {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    min-height: 80px;
}

.timeline-content-detailed {
    flex: 1;
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.timeline-content-detailed:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.timeline-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hop-time {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.hop-location {
    font-size: 0.85rem;
    color: #6c757d;
    margin-left: auto;
}

.hop-details {
    font-size: 0.9rem;
    line-height: 1.4;
}

.hop-details > div {
    margin-bottom: 0.25rem;
}

.hop-details code {
    font-size: 0.8rem;
    background-color: rgba(0,0,0,0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
}

.timeline-connector {
    position: absolute;
    left: 19px;
    top: 64px;
    bottom: -16px;
    width: 2px;
    background: linear-gradient(to bottom, #dee2e6 0%, #dee2e6 100%);
    z-index: 1;
}

/* Timeline item status colors */
.timeline-item-safe .timeline-marker i {
    background-color: #28a745;
    color: white;
}

.timeline-item-danger .timeline-marker i {
    background-color: #dc3545;
    color: white;
}

.timeline-item-warning .timeline-marker i {
    background-color: #ffc107;
    color: #212529;
}

.timeline-item-external .timeline-marker i {
    background-color: #17a2b8;
    color: white;
}

.timeline-item-internal .timeline-marker i {
    background-color: #6c757d;
    color: white;
}

/* Integrated Timeline Detailed Content */
.timeline-detailed-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.timeline-detailed-header h6 {
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
}

.timeline-time-location {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
}

.info-section {
    margin-bottom: 0.5rem;
}

.info-section strong {
    color: #495057;
    font-size: 0.9rem;
}

.detail-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.timeline-server-info,
.timeline-network-info {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border-left: 4px solid #17a2b8;
}

.timeline-security-info {
    margin-bottom: 0.75rem;
}

.section-title {
    color: #17a2b8;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.ip-badge-container {
    display: inline-block;
}

.security-detail {
    margin-bottom: 0.75rem;
}

.security-detail:last-child {
    margin-bottom: 0;
}

/* Enhanced alert styling */
.delivery-analysis-container .alert {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.delivery-analysis-container .alert-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.delivery-analysis-container .alert-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hop-location {
        margin-left: 0;
    }
    
    .timeline-content,
    .timeline-content-detailed {
        font-size: 0.85rem;
        padding: 1rem;
    }
    
    .timeline-time-location .row,
    .timeline-server-info .row,
    .timeline-network-info .row {
        margin: 0;
    }
    
    .timeline-time-location .col-lg-6,
    .timeline-server-info .col-lg-6,
    .timeline-network-info .col-lg-6 {
        padding: 0 0 0.5rem 0;
    }
    
    .delivery-analysis-container {
        padding: 0.5rem;
    }
    
    .timeline-marker {
        margin-right: 0.75rem;
    }
    
    .timeline-connector {
        left: 14px;
    }
    
.info-section {
    margin-bottom: 0.5rem;
}
    
    .section-title {
        font-size: 0.9rem;
    }
}

/* Enhanced DoH Security Report Styles */
.security-report .provider-section {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.security-report .provider-result {
    transition: background-color 0.15s ease;
}

.security-report .provider-result:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Enhanced Links/URLs Security Analysis - Improved Inline Version */
.domain-security-display {
    background-color: #f8f9fa !important;
    padding: 0.75rem !important;
    border-radius: 0.375rem !important;
    border: 1px solid #e9ecef !important;
    transition: background-color 0.15s ease;
}

.domain-security-display:hover {
    background-color: #e9ecef;
}

.domain-code {
    background-color: #ffffff !important;
    color: #495057 !important;
    padding: 0.375rem 0.75rem !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.security-badges {
    min-height: 2rem;
    align-items: center;
}

.security-badges .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.15s ease;
}

.security-badges .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.security-badges .badge i {
    margin-right: 0.25rem;
}

/* Enhanced badge styles for different security states */
.security-badges .badge.bg-success {
    background-color: #28a745 !important;
    color: white;
}

.security-badges .badge.bg-danger {
    background-color: #dc3545 !important;
    color: white;
}

.security-badges .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

.security-badges .badge.bg-info {
    background-color: #17a2b8 !important;
    color: white;
}

.security-badges .badge.bg-secondary {
    background-color: #6c757d !important;
    color: white;
}



/* Responsive adjustments */
@media (max-width: 768px) {
    .domain-security-display {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .domain-code {
        margin-right: 0;
        margin-bottom: 0.5rem;
        word-break: break-all;
    }
    
    .security-badges {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    footer .col-md-6 {
        text-align: center !important;
    }
    
    footer .text-md-end {
        text-align: center !important;
        margin-top: 0.5rem !important;
    }
}

/* Chinese character support and text formatting */
.email-content,
.email-content-text,
.email-plain-text,
.email-raw-content,
.email-headers,
.table td {
    /* Proper line breaking for Chinese characters */
    line-break: anywhere;
    word-break: break-word;
    overflow-wrap: break-word;
    
    /* Better text rendering for Chinese characters */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure proper spacing for mixed Latin/Chinese text */
.email-content,
.email-content-text,
.email-plain-text {
    letter-spacing: 0;
    word-spacing: normal;
}

/* Improve readability for Chinese text in dark theme (raw content) */
.email-raw-content {
    color: #e8e8e8;
    background-color: #1a1a1a;
}

/* Consistent Domain and IP Intelligence Display */
.domain-intelligence-consistent,
.ip-intelligence-consistent {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.domain-name,
.ip-name {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.service-check {
    padding: 0.25rem 0;
}

.service-name {
    min-width: 100px;
    font-weight: 500;
}

.ip-line {
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.ip-line:last-child {
    border-bottom: none;
}

/* Security Providers Single Line Display */
.security-providers-line {
    padding: 0.5rem 0;
    border-top: 1px solid #e9ecef;
    margin-top: 0.5rem;
}

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

.security-providers-line .badge {
    font-size: 0.75rem;
}

.security-providers-line .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Delivery Path Intelligence Placeholders */
.delivery-intelligence-placeholder {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.5rem;
    min-height: 40px;
}

.internal-ip-display {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

/* Enhanced Timeline Content */
.timeline-network-info {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

.timeline-network-info strong {
    color: #495057;
    font-weight: 600;
}

/* Compact Timeline Styles */
.timeline-content-compact {
    flex: 1;
    background-color: #ffffff;
    border-radius: 0.375rem;
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.timeline-content-compact:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.hop-info-compact {
    font-size: 0.85rem;
}

.hop-info-compact .row {
    margin: 0;
}

.hop-info-compact .col-sm-6,
.hop-info-compact .col-12 {
    padding: 0 0.25rem 0 0;
}

.hop-info-compact .mb-2 {
    margin-bottom: 0.5rem !important;
}

.hop-info-compact .mb-1 {
    margin-bottom: 0.25rem !important;
}

.hop-info-compact .mt-1 {
    margin-top: 0.25rem !important;
}

.hop-info-compact code.small {
    font-size: 0.75rem;
    background-color: rgba(0,0,0,0.05);
    padding: 0.1rem 0.25rem;
    border-radius: 0.2rem;
}

.hop-info-compact .badge-sm {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
}

.hop-info-compact .alert {
    margin-bottom: 0;
    padding: 0.25rem 0.5rem;
}

.hop-info-compact .alert small {
    line-height: 1.3;
}

/* Compact timeline item spacing */
.delivery-timeline .timeline-item {
    margin-bottom: 1rem;
}

/* Compact intelligence placeholders */
.delivery-intelligence-placeholder-compact {
    padding: 0.2rem 0.4rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}