/* Universal Entity Detail Comprehensive Styling - Original Plugin Visual Design */

/* Main Container */
.entity-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2em 1em;
    font-family: 'Quicksand', 'Segoe UI', Arial, sans-serif;
}

/* Glass Card for Entity Detail - Legacy Support */
.entity-glass-card {
    background: rgba(255,255,255,0.82);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(124,77,255,0.13), 0 1.5px 8px rgba(57,73,171,0.07);
    padding: 0;
    font-family: 'Quicksand', 'Inter', 'Segoe UI', Arial, sans-serif;
    border: 1.5px solid #e5e7eb;
    color: #222;
    backdrop-filter: blur(7px) saturate(1.2);
    -webkit-backdrop-filter: blur(7px) saturate(1.2);
    transition: box-shadow 0.25s;
    animation: fadeInUp 0.7s cubic-bezier(.4,0,.2,1);
    max-width: 900px;
    margin: 2.5em auto;
}

/* Modern Glass Cards */
.glass-card {
    background: rgba(255,255,255,0.85);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(124,77,255,0.12), 0 2px 16px rgba(57,73,171,0.06);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    border: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 1.5em;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    animation: slideInUp 0.6s cubic-bezier(.4,0,.2,1);
}

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

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(124,77,255,0.16), 0 4px 20px rgba(57,73,171,0.08);
    transform: translateY(-2px);
}

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

.entity-glass-card:hover {
    box-shadow: 0 12px 40px rgba(124,77,255,0.18), 0 2px 12px rgba(57,73,171,0.10);
}

/* Entity Header System */
.entity-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 2.5em 2em;
    border-radius: 16px;
    margin-bottom: 2em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(102,126,234,0.3);
    animation: headerSlide 0.8s cubic-bezier(.4,0,.2,1);
}

@keyframes headerSlide {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.entity-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.entity-header-content {
    position: relative;
    z-index: 2;
}

/* Entity-specific header gradients */
.entity-header-group {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    box-shadow: 0 8px 32px rgba(67,160,71,0.3);
}

.entity-header-tool {
    background: linear-gradient(135deg, #8e24aa 0%, #ab47bc 100%);
    box-shadow: 0 8px 32px rgba(142,36,170,0.3);
}

.entity-header-mitigation {
    background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
    box-shadow: 0 8px 32px rgba(25,118,210,0.3);
}

.entity-header-campaign {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
    box-shadow: 0 8px 32px rgba(211,47,47,0.3);
}

.entity-header-asset {
    background: linear-gradient(135deg, #f57c00 0%, #ff9800 100%);
    box-shadow: 0 8px 32px rgba(245,124,0,0.3);
}

.entity-header-graph {
    background: linear-gradient(135deg, #5e35b1 0%, #7e57c2 100%);
    box-shadow: 0 8px 32px rgba(94,53,177,0.3);
}

.entity-header-data-source {
    background: linear-gradient(135deg, #00796b 0%, #26a69a 100%);
    box-shadow: 0 8px 32px rgba(0,121,107,0.3);
}

/* Legacy Gradient Headers - Different colors for different entities */
.entity-gradient-header {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 28px;
    position: relative;
    border-radius: 18px 18px 0 0;
    margin-bottom: 2.2em;
    box-shadow: 0 4px 18px rgba(124,77,255,0.10);
    width: 100%;
    padding: 2em 2em 1.5em 2em;
    animation: cardPop 0.7s cubic-bezier(.4,0,.2,1);
}

@keyframes cardPop {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

/* Entity-specific legacy header colors */
.malware-header {
    background: linear-gradient(135deg,#d32f2f 0%,#f44336 100%);
}

.group-header {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
}

.tool-header {
    background: linear-gradient(135deg, #8e24aa 0%, #ab47bc 100%);
}

.mitigation-header {
    background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
}

.campaign-header {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
}

.asset-header {
    background: linear-gradient(135deg, #f57c00 0%, #ff9800 100%);
}

/* Card Headers and Content */
.card-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0fe 100%);
    padding: 1.2em 1.5em;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid rgba(124,77,255,0.08);
    margin: -1px -1px 0 -1px;
}

.card-header h2 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.card-header h2 i {
    color: #667eea;
    font-size: 1.1em;
}

.card-content {
    padding: 1.5em;
}

.entity-content {
    display: grid;
    gap: 1.5em;
}

/* Entity Title and Badges */
.entity-title {
    font-size: 2.2em;
    font-weight: 800;
    margin: 0.3em 0 0.2em 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.entity-id {
    font-size: 1.1em;
    font-weight: 600;
    opacity: 0.9;
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    background: rgba(255,255,255,0.2);
    padding: 0.3em 0.8em;
    border-radius: 6px;
    display: inline-block;
    margin-top: 0.5em;
}

.entity-badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1em;
}

.entity-type-badge {
    padding: 0.4em 1em;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    background: rgba(255,255,255,0.25);
}

.domain-badge, .platform-badge {
    padding: 0.3em 0.8em;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8em;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Description and Text */
.description-text {
    font-size: 1.05em;
    line-height: 1.7;
    color: #2c3e50;
    margin-bottom: 1.5em;
}

.description-text p {
    margin-bottom: 1em;
}

/* Metadata Grid */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin-top: 1.5em;
}

.metadata-item {
    background: rgba(124,77,255,0.05);
    padding: 1em;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.metadata-label {
    display: block;
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #667eea;
    margin-bottom: 0.3em;
}

.metadata-value {
    font-size: 1em;
    color: #2c3e50;
    font-weight: 500;
}

/* Accordion System - Comprehensive */
.entity-accordion, .accordion-section {
    margin-bottom: 1.5em;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(124,77,255,0.08);
    border: 1px solid rgba(124,77,255,0.1);
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
}

.entity-accordion-header, .accordion-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0fe 100%);
    padding: 1.2em 1.5em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #2c3e50;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    border-bottom: 1px solid rgba(124,77,255,0.1);
}

.entity-accordion-header:hover, .accordion-header:hover {
    background: linear-gradient(135deg, #e8f0fe 0%, #d0e1ff 100%);
    transform: translateY(-1px);
}

.entity-accordion-arrow, .accordion-arrow {
    font-size: 1.2em;
    color: #667eea;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.entity-accordion-panel, .accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(.4,0,.2,1);
    background: rgba(255,255,255,0.8);
}

.entity-accordion-panel-open, .accordion-content-open {
    max-height: 1000px;
    padding: 1.5em;
}

/* Raw Data Display */
.entity-raw-data, .raw-data {
    background: #1e1e2e;
    color: #a6e3a1;
    padding: 1.5em;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.85em;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #313244;
}

/* Lists and Items */
.entity-list, .data-list {
    display: grid;
    gap: 0.8em;
}

.entity-list-item, .data-item {
    background: rgba(124,77,255,0.04);
    padding: 1em;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    transition: all 0.2s ease;
}

.entity-list-item:hover, .data-item:hover {
    background: rgba(124,77,255,0.08);
    transform: translateX(3px);
}

.entity-list-description, .data-description {
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 0.3em;
    line-height: 1.5;
}

/* References */
.entity-references, .reference-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-top: 0.8em;
}

.entity-reference-link, .reference-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.4em 0.8em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.entity-reference-link:hover, .reference-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

/* Additional Entity-Specific Styling */

/* Version and Spec Version Badges */
.version-badge, .spec-version {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin: 0.2rem 0;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

/* External ID Badges */
.external-id-badge {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
    display: inline-block;
}

/* Status Alerts */
.status-alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.status-alert.status-deprecated {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(200, 35, 51, 0.1));
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #721c24;
}

/* Detection Text Styling */
.detection-text {
    background: rgba(40, 167, 69, 0.05);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Citation Text Styling */
.citation-text {
    background: rgba(124, 77, 255, 0.05);
    border-left: 4px solid #7c4dff;
    padding: 1rem;
    margin: 0.5rem 0;
    font-style: italic;
    line-height: 1.6;
}

/* Graph-specific badges */
.graph-type-badge {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.2rem;
}

.node-count-badge {
    background: linear-gradient(135deg, #009688, #00796b);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.2rem;
}

/* Data Source specific badges */
.data-component-badge {
    background: linear-gradient(135deg, #795548, #5d4037);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.2rem;
}

.collection-layer-badge {
    background: linear-gradient(135deg, #607d8b, #455a64);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.2rem;
}

/* Asset specific badges */
.sector-badge {
    background: linear-gradient(135deg, #3f51b5, #303f9f);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.2rem;
}

.related-asset-badge {
    background: linear-gradient(135deg, #ff5722, #e64a19);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.2rem;
}

/* Campaign specific elements */
.alias-badge {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.2rem;
}

/* Enhanced accordion animations */
.accordion-section.active .accordion-header {
    background: rgba(124, 77, 255, 0.1);
    border-radius: 12px 12px 0 0;
}

.accordion-section.active .accordion-content {
    border-top: 1px solid rgba(124, 77, 255, 0.2);
}

/* Improved badge containers */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

/* Enhanced reference items */
.reference-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.reference-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
    .metadata-grid {
        grid-template-columns: 1fr;
    }
    
    .badge-container {
        justify-content: center;
    }
    
    .entity-header {
        padding: 1.5rem 1rem;
        text-align: center;
    }
    
    .entity-title {
        font-size: 1.8rem;
    }
    
    .accordion-header h2 {
        font-size: 1.2rem;
    }
}
