/**
 * Analysis Page Styles
 * Main stylesheet for the extension analysis interface
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Monaco Editor Styling - Better Spacing and Layout */
.monaco-editor .margin {
    background-color: #f8f9fa !important;
    border-right: 1px solid #e5e7eb !important;
}

.monaco-editor .line-numbers {
    color: #6b7280 !important;
    padding-right: 20px !important; /* More space between line numbers and code */
    font-weight: 500 !important;
}

.monaco-editor .view-lines {
    padding-left: 16px !important; /* Extra space after line numbers */
}

.monaco-editor .current-line {
    background-color: #f8f9fa !important;
}

.monaco-editor .selected-text {
    background-color: #b3d9ff !important;
}

/* Header - Same as home page */
.header {
    background: rgb(52 46 124);
    width: 100%;
    display: flex;
    align-items: center;
    padding-top: 0.7rem;
    padding-bottom: 0.3rem;
    padding-left: 3rem;
    padding-right: 3rem;
    color: rgb(255 255 255);
    font-size: 1.2rem;
    line-height: 1.5rem;
    position: fixed;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    gap: 1rem;
}

.header h1 {
    font-size: 1.4rem;
    line-height: 1.7rem;
    font-weight: 500;
    color: rgb(255 255 255);
    margin: 0;
    text-decoration: none;
}

.header h1 a {
    color: rgb(255 255 255);
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* IOC Badge Styles for better color visibility */
.extension-badge {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-width: 2px !important;
    border-style: solid !important;
}

.extension-badge.selected {
    border-width: 2px !important;
    border-style: solid !important;
    position: relative;
    z-index: 2;
}

.extension-badge.dimmed {
    opacity: 0.6 !important;
}

.extension-badge:not(.selected):not(.dimmed):hover {
    z-index: 1;
}

.extension-list-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.extension-list-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    text-decoration: none;
}

/* User Authentication Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
}

.user-email {
    color: white;
    font-weight: 500;
}

.logout-btn {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    text-decoration: none;
}

.powered-by {
    height: 3.5rem;
    margin-top: -0.25rem;
}

/* Main Content */
.main-container {
    flex: 1;
    padding-top: 1rem;
    margin-top: 60px;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    background: #f5f5f5; /* FIX: Ensure container has same background as body */
    display: flex;
    flex-direction: column;
}

/* Extension Header */
.extension-header {
    background: #f5f5f5; /* FIX: Solid background to prevent dark content showing through */
    padding: 1rem 2rem; /* FIX: Normal padding */
    margin-bottom: 0; /* FIX: No gap between header and tabs */
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 50; /* FIX: Ensure header stays above tab content */
}

.extension-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.extension-info h1 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

/* Extension name span - ensure solid color */
#extensionName {
    color: #333 !important;
    opacity: 1 !important;
}

.extension-meta {
    display: flex;
    gap: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.extension-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rating {
    color: #f59e0b;
    font-weight: 600;
}

/* Extension Property Badges */
.extension-badges {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.extension-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.extension-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.extension-badge:hover::before {
    left: 100%;
}

.extension-badge:hover {
    transform: translateY(-2px) scale(1.02);
}

.badge-chromium {
    color: #1a73e8;
    border-color: #1a73e8;
    background: transparent;
}

.badge-chromium:hover {
    background: #1a73e8;
    color: white;
}

.badge-manifest-v3 {
    color: #137333;
    border-color: #137333;
    background: transparent;
}

.badge-manifest-v3:hover {
    background: #137333;
    color: white;
}

.badge-obfuscated {
    color: #d93025;
    border-color: #d93025;
    background: transparent;
}

.badge-obfuscated:hover {
    background: #d93025;
    color: white;
}

.badge-popup {
    color: #7c3aed;
    border-color: #7c3aed;
    background: transparent;
}

.badge-popup:hover {
    background: #7c3aed;
    color: white;
}

.badge-emoji {
    font-size: 1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* IOC Badge shimmer effect */
.extension-badge[class*="ioc-badge-"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.extension-badge[class*="ioc-badge-"]:hover::before {
    left: 100%;
}

/* Tab Navigation */
.tab-navigation {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 0; /* FIX: No spacing - joined with header */
    overflow: hidden;
    position: relative;
    z-index: 10; /* FIX: Proper stacking below header */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.tab-button {
    flex: 1;
    padding: 0.8rem 0.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-button:hover {
    background-color: #f9fafb;
    color: #342e7c;
}

.tab-button.active {
    color: #342e7c;
    background-color: #f8fafc;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #342e7c;
}

/* Tab Content */
.tab-content {
    padding: 1rem 2rem;
    min-height: 500px;
    background: white; /* FIX: Ensure solid background */
    /* overflow: hidden;  */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Remove all padding/margin for dynamic analysis tab */
.tab-content #dynamic-analysis {
    padding: 0 !important; /* FIX: Remove padding for full-width design */
    margin: 0 -2rem !important; /* FIX: Negative margin to expand full width beyond tab-content padding */
    position: relative;
    z-index: 1; /* FIX: Ensure content stays below header */
    width: calc(100% + 4rem) !important; /* FIX: Compensate for negative margin to reach edges */
}

.tab-content #agentic-analysis {
    padding: 0 !important; /* FIX: Remove padding for full-width design */
    margin: 0 -2rem !important; /* FIX: Negative margin to expand full width beyond tab-content padding */
    position: relative;
    z-index: 1; /* FIX: Ensure content stays below header */
    width: calc(100% + 4rem) !important; /* FIX: Compensate for negative margin to reach edges */
}

/* Remove ALL extra padding for Code Explorer tab - COMPLETE REMOVAL */
.tab-content #file-viewer {
    padding: 0 !important;
    margin: -1rem -2rem -1rem -2rem !important;
}

/* Restore proper padding ONLY for file list container */
#file-viewer #viewerFilesList {
    padding-left: 1rem !important;
    padding-right: 0.5rem !important;
}

/* Ensure sub-tabs are flush with main tabs */
#dynamic-analysis > div:first-child {
    margin-top: 0 !important;
}

#agentic-analysis > div:first-child {
    margin-top: 0 !important;
}

.tab-pane {
    display: none;
    min-height: 500px; /* Consistent minimum height */
    height: 100%;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    animation: fadeIn 0.3s ease-in;
}

/* File viewer height control */
.tab-pane#file-viewer {
    min-height: 600px;
    max-height: 600px;
    overflow: hidden;
}

/* Large screens: Full viewport height */
@media (min-width: 1200px) {
    .tab-pane#file-viewer {
        min-height: calc(100vh - 180px) !important;
        max-height: none !important;
    }
}

/* Allow code-analysis and dynamic-analysis to expand beyond 600px */
.tab-pane#code-analysis {
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.tab-pane#dynamic-analysis {
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.tab-pane#agentic-analysis {
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

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

/* Overview Tab - Attack Vault Style */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 0.5rem;
    align-items: start;
}

.info-card-wrapper {
    position: relative;
    width: 100%;
    min-height: 120px;
    cursor: pointer;
}

.card-shadow {
    position: absolute;
    inset: 0;
    transform: translate(4px, 4px);
    border-radius: 0.5rem;
    background: white;
}

.info-card {
    position: relative;
    background: white;
    border: 1px solid rgb(200, 200, 200);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: transform 0.2s ease;
    transform: translate(0, 0);
    width: 100%;
    height: 100%;
}

.info-card-wrapper:hover .info-card {
}

.info-card h3 {
    color: #342e7c;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #374151;
}

.info-value {
    color: #6b7280;
    text-align: left;
}

/* Permissions Grid - Attack Vault Style */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.permission-item-wrapper {
    position: relative;
    width: 200px;
    min-height: 60px;
    cursor: pointer;
}

.permission-shadow {
    position: absolute;
    inset: 0;
    transform: translate(4px, 4px);
    border-radius: 0.5rem;
    background: white;
}

.permission-item {
    position: relative;
    background: white;
    border: 1px solid rgb(200, 200, 200);
    border-radius: 0.5rem;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: transform 0.2s ease;
    transform: translate(0, 0);
    width: 100%;
    height: 100%;
    min-height: 60px;
}

.permission-item-wrapper:hover .permission-item {
}

.permission-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.permission-icon.high { }
.permission-icon.medium { }
.permission-icon.low { }

/* Vulnerabilities Tab - Side by side layout */
.vuln-tab-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.vuln-summary-wrapper {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
}

.vuln-summary {
    position: relative;
    background: linear-gradient(135deg, #fef2f2, #fee2e2, #fecaca);
    border: 3px solid #f87171;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(248, 113, 113, 0.2);
    padding: 15px;
}

.vuln-count {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 0.1rem;
    color: #dc2626;
    text-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
    line-height: 1;
}

.vuln-summary h2 {
    font-size: 0.65rem;
    color: #991b1b;
    margin-bottom: 0.1rem;
    font-weight: 600;
    line-height: 1;
    padding: 0 10px;
}

.vuln-summary p {
    font-size: 0.6rem;
    color: #7f1d1d;
    margin: 0;
    max-width: 110px;
    line-height: 1;
    padding: 0 5px;
}

.vuln-summary #uniqueFilesCount {
    font-size: 0.65rem !important;
    color: #b91c1c !important;
    margin-top: 0.2rem !important;
    font-weight: 700 !important;
    max-width: 100px;
    line-height: 1 !important;
    padding: 0 5px;
}

.vuln-list-wrapper {
    position: relative;
    flex: 1;
}

/* Permission Analysis Badges */
.permission-badge {
    display: inline-block;
    transition: all 0.2s ease;
    position: relative;
}

.permission-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Permission Tooltips */
.permission-tooltip {
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .permission-tooltip {
        width: 175px!important
    }

    #manifestInfo > div:last-child > div > div {
        justify-content: center;
    }
}

.permission-tooltip::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    transform: translateX(-50%) rotate(45deg);
}

.vuln-list-shadow {
    position: absolute;
    inset: 0;
    transform: translate(4px, 4px);
    border-radius: 0.5rem;
    background: white;
}

.vuln-list {
    position: relative;
    background: white;
    border: 1px solid rgb(200, 200, 200);
    border-radius: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.vuln-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vuln-item:last-child {
    border-bottom: none;
}

.vuln-severity {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.vuln-severity.high {
    background: #fee2e2;
    color: #dc2626;
}

.vuln-severity.medium {
    background: #fef3c7;
    color: #d97706;
}

.vuln-severity.low {
    background: #dcfce7;
    color: #16a34a;
}

/* Code Analysis Tab - Attack Vault Style */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem;
    margin-bottom: 2rem;
    max-width: 100%;
}

.metric-card-wrapper {
    position: relative;
    width: 100%;
    min-height: 70px;
    cursor: pointer;
}

.metric-shadow {
    position: absolute;
    inset: 0;
    transform: translate(4px, 4px);
    border-radius: 0.5rem;
    background: white;
}

.metric-card {
    position: relative;
    background: white;
    border: 1px solid rgb(200, 200, 200);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease;
    transform: translate(0, 0);
    width: 100%;
    height: 100%;
    min-height: 70px;
}

.metric-card-wrapper:hover .metric-card {
}

.metric-number {
    font-size: 1.6rem;
    font-weight: bold;
    color: #342e7c;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.metric-label {
    color: #6b7280;
    font-size: 0.8rem;
}

.files-list-wrapper {
    position: relative;
    width: 100%;
}

.files-list {
    position: relative;
    background: white;
    border: 1px solid rgb(200, 200, 200);
    border-radius: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    font-family: 'Monaco', 'Consolas', monospace;
    color: #374151;
}

.file-stats {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
}

.file-stats.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-stats.clickable:hover {
    color: #342e7c;
    font-weight: 500;
}

/* Risk Assessment Enhanced Styles */
.risk-level-enhanced .risk-level-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.risk-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-badge.critical {
    background: #dc2626;
    color: white;
}

.risk-badge.high {
    background: #ea580c;
    color: white;
}

.risk-badge.medium {
    background: #d97706;
    color: white;
}

.risk-badge.low {
    background: #16a34a;
    color: white;
}

.risk-count {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Host Permissions Section */
.host-permissions-section {
    margin-top: 0.5rem;
}

.host-permissions-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.host-permission-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 0.9rem;
}

.host-permission-item.critical {
    background: #fef2f2;
    border-left-color: #dc2626;
}

.host-permission-item.medium {
    background: #fef3c7;
    border-left-color: #d97706;
}

.host-permission-item.safe {
    background: #f0fdf4;
    border-left-color: #16a34a;
}

.permission-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.permission-warning {
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

.permission-explanation {
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Risk Factors Section */
.risk-factors-section {
    margin-top: 1rem;
}

.risk-factors-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.risk-factor-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-left: 4px solid #dc2626;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.risk-factor-item:hover {
    transform: translateX(2px);
}

.risk-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.risk-text {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.4;
}

/* File Info Structure */
.file-info {
    display: flex;
    align-items: flex-start;
    width: 40%;
    flex-shrink: 0;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 250px;
}

.obfuscated-badge {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    align-self: flex-start;
    flex-shrink: 0;
}

.obfuscated-badge:hover {
    color: #dc2626 !important;
}

.obfuscated-spacer {
    width: 80px;
    margin-left: 0.5rem;
}

/* File Click Functionality */
.file-item.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-item.clickable:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.file-hover-hint {
    opacity: 0;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    transition: opacity 0.3s ease;
    margin-top: 0.5rem;
}

.file-item.clickable:hover .file-hover-hint {
    opacity: 1;
}

.file-item.clickable:hover .file-name {
    color: #666;
    font-weight: 600;
}

.file-stats i {
    margin-right: 0.25rem;
    color: #342e7c;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-container {
    background: white;
    border-radius: 16px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #342e7c 0%, #4c46a0 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-header i {
    margin-right: 0.75rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* File Details Grid */
.file-details-grid {
    display: grid;
    gap: 2rem;
}

.detail-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.detail-section h4 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.detail-section h4 i {
    margin-right: 0.5rem;
    color: #342e7c;
}

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

.metric-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #342e7c;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

/* Security Issues - Improved Grid Layout */
.security-issues {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.security-issue {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.security-issue:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.issue-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.issue-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
    line-height: 1.3;
    flex: 1;
}

.issue-severity {
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.issue-severity.critical {
    background: #dc2626;
    color: white;
}

.issue-severity.high {
    background: #ea580c;
    color: white;
}

.issue-severity.medium {
    background: #ca8a04;
    color: white;
}

.issue-severity.low {
    background: #6b7280;
    color: white;
}

.issue-description {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.issue-line {
    font-family: 'Monaco', 'Consolas', monospace;
    color: #342e7c;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f8fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

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

/* Code Items Container */
.code-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.code-item {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: default;
}

.function-item {
    color: #7c3aed;
    border-color: #c4b5fd;
    background: #f3f4f6;
}

.function-item:hover {
    background: #ede9fe;
    border-color: #7c3aed;
}

.api-item {
    color: #059669;
    border-color: #a7f3d0;
    background: #f0fdf4;
}

.api-item:hover {
    background: #dcfce7;
    border-color: #059669;
}

.variable-item {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fef2f2;
}

.variable-item:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

/* Gitleaks Styles */
.gitleaks-summary {
    text-align: center;
    padding: 1.5rem;
    background: #fef2f2;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #fca5a5;
}

.gitleaks-count {
    font-size: 2.5rem;
    font-weight: bold;
    color: #dc2626;
    margin-bottom: 0.5rem;
}

.gitleaks-label {
    font-size: 1.1rem;
    color: #991b1b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gitleaks-description {
    color: #7f1d1d;
    font-size: 0.9rem;
}

.gitleaks-list {
    overflow-y: auto;
}

.gitleaks-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    align-items: flex-start;
}

.gitleaks-item:last-child {
    border-bottom: none;
}

.gitleaks-severity {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.gitleaks-severity.high {
    background: #fee2e2;
    color: #dc2626;
}

.gitleaks-severity.medium {
    background: #fef3c7;
    color: #d97706;
}

.gitleaks-severity.low {
    background: #dcfce7;
    color: #16a34a;
}

.gitleaks-details {
    flex: 1;
}

.gitleaks-file {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gitleaks-file i {
    color: #6b7280;
}

.gitleaks-line {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #6b7280;
    margin-left: auto;
}

.gitleaks-type {
    color: #374151;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.gitleaks-preview {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0.25rem;
}

/* Obfuscation Warning Styles */
.obfuscation-warning {
    background: #fef2f2;
    border: 2px solid #dc2626;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.obfuscation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.obfuscation-header i {
    color: #dc2626;
    font-size: 1.5rem;
}

.obfuscation-header h3 {
    margin: 0;
    color: #dc2626;
    font-size: 1.3rem;
    flex: 1;
}

.obfuscation-badge {
    background: #dc2626;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.obfuscation-warning > p {
    color: #7f1d1d;
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.obfuscation-details {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.obfuscation-metric {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.obfuscation-metric .metric-label {
    font-weight: 600;
    color: #991b1b;
}

.obfuscation-metric .metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc2626;
}

.obfuscation-technique {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fca5a5;
}

.technique-label {
    font-weight: 600;
    color: #991b1b;
    display: block;
    margin-bottom: 0.5rem;
}

.technique-name {
    font-family: 'Monaco', 'Consolas', monospace;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.technique-description {
    color: #7f1d1d;
    font-size: 0.85rem;
    font-style: italic;
}

/* Dynamic Analysis Tab Specific */
.sim-tab-btn:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #342e7c;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .modal-container {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        padding: 1rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .code-items-container {
        max-height: 200px;
    }

    .metric-number {
        font-size: 1.4rem;
    }

    .metric-label {
        font-size: 0.75rem;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    
    .extension-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .vuln-tab-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vuln-summary-wrapper {
        align-self: center;
    }

    .risk-level-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .host-permission-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .permission-warning {
        margin-left: 0;
    }
    
    .risk-factor-item {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ======= RISK SCORES RESPONSIVE STYLES ======= */
/* Risk Scores Container */
.risk-scores-container {
    display: none;
    margin: 1rem 0.5rem;
    overflow: visible;
}

.risk-scores-header {
    margin-bottom: 1rem;
}

.risk-scores-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

/* Risk Score Cards Grid - Responsive */
.risk-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 100%;
    align-items: center;
}

/* Fix for internal extensions - show 3 cards (Advanced Risk Score, Static, Dynamic) */
.risk-scores-grid.internal-extension {
    grid-template-columns: repeat(3, minmax(160px, 200px));
    justify-content: flex-start;
}

.risk-score-card {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    position: relative;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    min-width: 120px;
    height: 85px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Advanced Risk Score Card - physically bigger */
#overall-score-card {
    padding: 1.4rem 1.2rem !important;
    transform: scale(1.08) !important;
    margin: 0.1rem !important;
    height: 100px !important;
    align-self: center !important;
}

#overall-score-card .risk-card-value {
    font-size: 2.1rem !important;
}

#overall-score-card .risk-card-label {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

/* Advanced Risk Score Color Classes */
.overall-score-low {
    background: #bbf7d0;  /* Darker green */
    border: 2px solid #4ade80;
}

.overall-score-medium {
    background: #fde68a;  /* Darker yellow */
    border: 2px solid #fbbf24;
}

.overall-score-high {
    background: #fecaca;  /* Medium red - lighter than before */
    border: 2px solid #fca5a5;
}

.overall-score-critical {
    background: #fca5a5;  /* Darker red - lighter than before */
    border: 2px solid #f87171;
}


.risk-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.risk-card-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.risk-card-score-suffix {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
}

.risk-card-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Spinner inside text card - same size as other cards */
.risk-card-text .fa-spinner {
    font-size: 1.9rem;
}

/* Review Sentiment card - align label at top like other cards */
#review-verdict-card {
    justify-content: flex-start !important;
    padding-top: 0.9rem !important;
}

#review-verdict-card .risk-card-text {
    margin-top: auto;
    margin-bottom: auto;
}

.risk-info-icon {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Dynamic and Static Analysis Cards - Default Green */
.risk-score-card.analysis-card {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
}

/* Analysis cards - left align for MacBook and smaller screens */
@media (max-width: 1600px) {
    .risk-score-card.analysis-card {
        align-items: flex-start !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .risk-score-card.analysis-card .risk-card-label {
        text-align: left !important;
        width: fit-content !important;
        align-self: flex-start !important;
    }

    .risk-score-card.analysis-card .risk-card-value {
        align-self: center !important;
    }
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .risk-scores-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .risk-score-card {
        min-width: 120px;
        padding: 1rem 0.75rem;
    }

    .risk-card-value {
        font-size: 1.7rem;
    }

    .risk-card-label {
        font-size: 0.75rem;
    }
}

/* ========== TABLET FIX (481px - 1024px) ========== */
/* Fixes for iPad, Surface Pro, iPad Mini, tablets */
@media (min-width: 481px) and (max-width: 1024px) {
    /* Risk scores - prevent label overflow */
    .risk-scores-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 0.5rem;
    }

    .risk-scores-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 0.4rem;
        width: 100%;
    }

    .risk-score-card {
        min-width: unset;
        padding: 0.6rem 0.4rem;
        height: auto;
        min-height: 70px;
        overflow: visible !important;
    }

    .risk-card-label {
        font-size: 0.55rem !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        line-height: 1.2;
        max-width: 100%;
        text-align: center;
    }

    .risk-card-value {
        font-size: 1.3rem;
    }

    .risk-card-text {
        font-size: 0.7rem;
    }

    #overall-score-card {
        transform: scale(1.02);
        height: auto;
        min-height: 75px;
        overflow: visible !important;
    }

    #overall-score-card .risk-card-label {
        white-space: normal !important;
        font-size: 0.55rem !important;
    }

    /* Overview grid - 2 columns on tablet */
    .overview-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        align-items: start !important;
    }

    /* Info cards - prevent overflow but allow natural height */
    .info-card-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: visible;
        height: auto !important;
        min-height: unset !important;
    }

    .info-card {
        overflow: visible;
        height: auto !important;
    }

    /* Privacy Policy section */
    .privacy-policy-section {
        overflow: visible;
    }

    .privacy-policy-section svg {
        width: 80px;
        height: 80px;
    }

    /* Permissions section - horizontal scroll */
    .manifest-card,
    .manifest-card .info-card,
    #manifestInfo {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100% !important;
    }

    .permissions-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: visible !important;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        width: max-content !important;
        min-width: 100%;
    }

    .permission-item-wrapper,
    .permission-button {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    /* Tables - horizontal scroll */
    .history-table {
        min-width: 500px;
    }

    #updateHistoryWrapper,
    #updateHistoryContent {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Developer info - stack on tablet */
    .developer-info-container {
        flex-direction: column;
        gap: 1rem;
    }

    .developer-details,
    .developer-address-section,
    .developer-map-section {
        width: 100%;
        min-width: unset;
        padding: 0;
    }

    /* Extension header */
    .extension-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .extension-info {
        flex: 1;
        min-width: 200px;
    }

    .extension-meta {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .extension-meta span {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .risk-scores-container {
        margin: 1rem;
    }

    /* Stack label above cards on mobile */
    .risk-scores-container > div {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .risk-scores-container > div > div:first-child {
        padding-top: 0 !important;
    }

    .risk-scores-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .risk-score-card {
        min-width: unset;
        padding: 0.9rem 0.7rem;
    }

    .risk-card-value {
        font-size: 1.5rem;
    }

    .risk-card-label {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
        white-space: normal;
    }

    .risk-card-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .risk-scores-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .risk-score-card {
        padding: 0.8rem 0.5rem;
    }

    .risk-card-value {
        font-size: 1.3rem;
    }

    .risk-card-label {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }

    .risk-card-text {
        font-size: 0.8rem;
    }

    .risk-info-icon {
        top: 0.3rem;
        right: 0.3rem;
        font-size: 0.9rem;
    }
}

/* ======= IOC ANALYSIS TABLE STYLES ======= */
/* Professional table styling for IOC analysis */

#ioc-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#ioc-table thead {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #d1d5db;
}

#ioc-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-right: 1px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
}

#ioc-table th:last-child {
    border-right: none;
}

#ioc-table th:hover {
    background-color: #f1f5f9;
}

#ioc-table th span {
    color: #9ca3af;
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: color 0.2s ease;
}

#ioc-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.15s ease;
}

#ioc-table tbody tr:hover {
    background-color: #f8fafc;
}

#ioc-table tbody tr:last-child {
    border-bottom: none;
}

#ioc-table td {
    padding: 0.75rem 1rem;
    border-right: 1px solid #e5e7eb;
    vertical-align: top;
    word-wrap: break-word;
}

#ioc-table td:last-child {
    border-right: none;
}

/* IOC Type Column */
#ioc-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

/* IOC Value Column */
#ioc-table td:nth-child(2) {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    max-width: 300px;
    line-height: 1.4;
    text-align: left;
}

/* Risk Column */
#ioc-table td:nth-child(3) {
    text-align: left;
    white-space: nowrap;
}

/* Files Column */
#ioc-table td:nth-child(3) {
    font-size: 0.8rem;
    color: #6b7280;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

/* Count Column */
#ioc-table td:nth-child(5) {
    text-align: center;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

/* Risk Badge Styles */
.risk-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.risk-badge.high {
    background-color: #dc2626;
    color: #ffffff;
}

.risk-badge.medium {
    background-color: #ea580c;
    color: #ffffff;
}

.risk-badge.low {
    background-color: #059669;
    color: #ffffff;
}

/* IOC Type Icons and Colors */
.ioc-type-url {
    color: #7c3aed;
}

.ioc-type-domain {
    color: #059669;
}

.ioc-type-api {
    color: #dc2626;
}

.ioc-type-email {
    color: #2563eb;
}

.ioc-type-ip {
    color: #ea580c;
}

/* Table Container Styling */
.ioc-table-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ioc-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ioc-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.ioc-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.ioc-table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Empty State */
.ioc-table-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    #ioc-table {
        font-size: 0.75rem;
    }
    
    #ioc-table th,
    #ioc-table td {
        padding: 0.5rem 0.75rem;
    }
    
    #ioc-table td:nth-child(2) {
        max-width: 200px;
    }
    
    #ioc-table td:nth-child(4) {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    #ioc-table {
        font-size: 0.7rem;
    }
    
    #ioc-table th,
    #ioc-table td {
        padding: 0.4rem 0.5rem;
    }
    
    #ioc-table td:nth-child(2) {
        max-width: 120px;
    }
    
    #ioc-table td:nth-child(4) {
        max-width: 100px;
    }
}



@media (max-width: 768px) {
    .main-container {
        margin-top: 150px;
    }

    .extension-meta {
        flex-wrap: wrap;
        justify-content: space-evenly;
    }

    #featuredBadgeHeader {
        margin: auto;
        padding-block: 10px;
    }

    .tab-content {
        padding: 1rem 1rem;
    }

    .developer-map-section {
        padding-left: 0rem!important;
        margin: auto;
    }

    .developer-info-container::before {
        display: none;
    }

    #fileAnalyzerList {
        overflow-x: auto;
    }

    #codeDiffList {
        overflow-x: auto;

        > div:first-of-type {
            background: white;
            border-bottom: 2px solid white;
        }
    }

    #vulnerabilities {
        > div:first-of-type > div:first-of-type > div:first-of-type {
            flex-wrap: wrap;

            > span:nth-child(2) {
                width: 100%;
            }
        }

        > div:first-of-type > div:first-of-type {
            flex-direction: column;
            gap: 1.5rem;
        }

        > div:first-of-type {
            margin-inline: 0rem!important;
        }
    }

    #simulationContent {
        > div:first-of-type > div:first-of-type {
            flex-direction: column;
            gap: 1rem!important;
        }

        h4 {
            margin-bottom: 1.25rem!important;
        }

        table tr {
            > td:first-of-type span{
                display: inline-block;
                width: max-content;
            }

            :first-of-type td {
                display: flex;
            }

            td {
                min-width: 200px;
            }
        }

        
    }


    #network-table-all-no, #network-table-unique-no,
    #network-table-all-adaptive, #network-table-unique-adaptive,
    #network-table-all-static, #network-table-unique-static,
    #playwright-table-all-static, #playwright-table-unique-static,
    #playwright-table-all-adaptive, #playwright-table-unique-adaptive
    {
        margin-inline: 15px;
    }

    #api-table-all-no, #api-table-unique-no, #api-table-unique-names-no,
    #api-table-all-static, #api-table-unique-static, #api-table-unique-names-static,
    #api-table-all-adaptive, #api-table-unique-adaptive, #api-table-unique-names-adaptive
    {
        margin-inline: 16px;
        overflow-x: auto;
    }


    #vulnList {
        overflow-x: auto;
    }


    #filesList {
        span {
            width: max-content;
            padding-right: 10px;
        }
    }

    #ioc-table {
        width: max-content!important;
    }


    .detail-section {
        background: white;
        border-radius: 12px;
        padding: 0;
        border: white;
    }


    .header-left a:nth-of-type(2) {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: 0;
    }

    .header {
        padding-bottom: 55px;
        /* padding-inline: 10px; */
    }

    .header-inner {
        justify-content: center;
    }

    #file-viewer > div:first-of-type > div:first-of-type {
        /* margin-top: 30px; */
        margin-left: 10px;
    }

    #fileSearchInput {
        width: 100%!important;
    }

    #viewerFilesList {
        width: max-content
    }

    #file-viewer > div:first-of-type > div:first-of-type {
        display: block;
    }


    #file-viewer > div {
        overflow-x: auto!important;
    }

    #copyCodeBtn {
        width: min-content;
    }

    #codeHeader > div:first-of-type > * {
        margin: 10px;
    }

    #folder-toggle {
        display: block!important;
    }

    .header {
        padding-inline: 10px;
    }

    .header-left {
        /* flex-direction: column; */
        margin: auto;
        gap: 5px;
        padding: 0;

        h1 {
            font-size: 1.5rem;
        }
    }
    
    #userInfo {
        width: 100%;
        position: fixed;
        top: 88px;
        right: 0rem;
        color: white;
        z-index: 101;
        justify-content: space-between;
        background: rgb(52 46 124);
        border: 1px solid rgb(52 46 124);
    }

    .header-left {
        img {
            width: 175px;
        }
    }

    #downloadReportBtn {
        margin-left: 0!important;
    }

}

#folder-toggle {
    display: none;
}

/* Update History Table - Simple and Perfect */
/* ========== UPDATE HISTORY TABLE - COMPLETE REBUILD ========== */

.history-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* HEADER */
.history-header {
    display: grid;
    grid-template-columns: 60px 110px 140px 100px 120px;
    gap: 12px;
    padding: 12px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-header .col-num {
    text-align: center;
}

.history-header .col-version {
    text-align: center;
    border-left: 1px solid #e2e8f0;
    padding-left: 6px;
}

.history-header .col-date {
    text-align: center;
    border-left: 1px solid #e2e8f0;
    padding-left: 6px;
}

.history-header .col-size {
    text-align: center;
    border-left: 1px solid #e2e8f0;
    padding-left: 6px;
}

.history-header .col-interval {
    text-align: center;
    border-left: 1px solid #e2e8f0;
    padding-left: 6px;
}

/* BODY */
.history-body {
    background: white;
    max-height: 400px;
    overflow-y: auto;
}

/* ROWS */
.history-row {
    display: grid;
    grid-template-columns: 60px 110px 140px 100px 120px;
    gap: 12px;
    padding: 12px 12px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.history-row:last-child {
    border-bottom: none;
}

.history-row .col-num {
    text-align: center;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.8rem;
}

.history-row .col-version {
    text-align: center;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.8rem;
    border-left: 1px solid #f1f5f9;
    padding-left: 6px;
}

.history-row .col-date {
    text-align: center;
    color: #6b7280;
    font-size: 0.8rem;
    border-left: 1px solid #f1f5f9;
    padding-left: 6px;
}

.history-row .col-size {
    text-align: center;
    color: #6b7280;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    border-left: 1px solid #f1f5f9;
    padding-left: 6px;
}

.history-row .col-interval {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    border-left: 1px solid #f1f5f9;
    padding-left: 6px;
}

#ai-analysis-container {
    .container {
        background: white;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        width: 100%;
    }

    .two-column {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    @media (max-width: 1024px) {
        .two-column {
            grid-template-columns: 1fr;
        }
    }

    .section {
        background-color: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        padding: 1rem;
        margin-bottom: 1rem;
        break-inside: avoid;
    }

    h1, h2, h3 {
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 0.75rem;
    }

    h1 {
        font-size: 1.3rem;
        border-bottom: 1px solid #e0e4e8;
        padding-bottom: 0.5rem;
    }

    h2 {
        font-size: 1.1rem;
        color: #34495e;
    }

    h3 {
        font-size: 1rem;
        color: #4a4a4a;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 1rem;
        table-layout: fixed;
        grid-column: 1 / -1;
    }

    th, td {
        border: 1px solid #e0e0e0;
        padding: 0.5rem;
        text-align: left;
        word-break: break-word;
    }

    th {
        background-color: #f8f9fa;
        font-weight: 600;
        color: #495057;
    }

    .badge {
        display: inline-block;
        padding: 0.2rem 0.5rem;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 600;
        margin-left: 0.5rem;
        vertical-align: middle;
    }

    .badge-critical {
        background-color: #dc2626;
        color: white;
    }

    .badge-high {
        background-color: #f97316;
        color: white;
    }

    .badge-medium {
        background-color: #eab308;
        color: white;
    }

    .badge-low {
        background-color: #22c55e;
        color: white;
    }

    .badge-info {
        background-color: #3b82f6;
        color: white;
    }

    .badge-unknown {
        background-color: #6b7280;
        color: white;
    }

    .kv-pair {
        display: flex;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e9ecef;
        flex-wrap: wrap;
    }

    .kv-key {
        font-weight: 600;
        color: #2c3e50;
        margin-right: 0.75rem;
        min-width: 150px;
        flex-shrink: 0;
    }

    .kv-value {
        flex-grow: 1;
        color: #4a4a4a;
        word-break: break-word;
    }

    ul, ol {
        margin: 0.2rem 0 0.2rem 1.3rem;
    }

    li {
        margin: 0.1rem 0;
        font-size: 0.875rem;
        word-break: break-word;
    }

    p, span {
        margin: 0.15rem 0;
        font-size: 0.875rem;
        word-break: break-word;
    }

    .url {
        color: #2563eb;
        word-break: break-all;
        font-size: 0.85rem;
    }

    .inline-value {
        color: #555;
    }

    @media (max-width: 768px) {
        .two-column {
            grid-template-columns: 1fr;
        }
    }
}

#agentic-analysis {
    #api-table-all {
        max-height: none !important;
    }

    #playwright-table-all {
        max-height: none !important;
    }

    #network-table-all {
        max-height: none !important;
    }
}

/* ========== MOBILE ONLY - Dynamic & Agentic Analysis - 480px ========== */
@media (max-width: 480px) {
    /* Dynamic Analysis Tab */
    #dynamic-analysis {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Agentic Analysis Tab */
    #agentic-analysis {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #agentic-analysis #api-table-all,
    #agentic-analysis #playwright-table-all,
    #agentic-analysis #network-table-all {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Override negative margins on mobile */
    .tab-content #dynamic-analysis,
    .tab-content #agentic-analysis {
        margin: 0 !important;
        width: 100% !important;
    }
} 