/* CSS Custom Properties for Theming */
body[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa; /* GitHub light background */
    --bg-tertiary: #e1e4e8; /* Slightly darker for contrast */
    --bg-accent: #0969da; /* GitHub blue accent */
    --text-primary: #24292f; /* High contrast dark text */
    --text-secondary: #656d76; /* Readable secondary text */
    --text-light: #1f2328; /* Slightly lighter for emphasis */
    --border-color: #d0d7de; /* Subtle borders */
    --border-light: #e1e4e8; /* Even more subtle */
    --border-accent: #0969da; /* Accent borders */
    --shadow: rgba(9, 105, 218, 0.15);
    --shadow-dark: rgba(9, 105, 218, 0.25);
    --success: #1a7f37;
    --warning: #9a6700;
    --danger: #cf222e;
    --info: #0969da;
    --toolbar-bg: #f6f8fa;
    --panel-bg: #ffffff;
    --packet-hover: #f6f8fa;
    --packet-selected: #3b82f6;
    --header-bg: #e1e4e8;
    --row-even: #ffffff;
    --row-odd: #f6f8fa;
    --modal-overlay: rgba(0, 0, 0, 0.6);
}

body[data-theme="dark"] {
    --bg-primary: #2b2d31; /* SyscallShark dark background */
    --bg-secondary: #1e1f22; /* Darker panels */
    --bg-tertiary: #35373c; /* Lighter elements */
    --bg-accent: #00a8ff; /* Bright cyan-blue accent */
    --text-primary: #ffffff; /* Pure white text */
    --text-secondary: #b5bac1; /* Muted gray text */
    --text-light: #ffffff; /* Bright text */
    --text-tertiary: #80848e; /* Very muted text */
    --border-color: #3f4147; /* Subtle borders */
    --border-light: #35373c; /* Even more subtle */
    --border-accent: #00a8ff; /* Cyan-blue borders */
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.5);
    --success: #23a559; /* Green for success */
    --warning: #f0b232; /* Yellow for warnings */
    --danger: #f23f43; /* Red for errors */
    --info: #00a8ff; /* Cyan-blue for info */
    --toolbar-bg: #2b2d31;
    --panel-bg: #1e1f22;
    --packet-hover: rgba(0, 168, 255, 0.1);
    --packet-selected: #00a8ff;
    --header-bg: #2b2d31;
    --row-even: #2b2d31;
    --row-odd: #313338;
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --status-bar-bg: #0078d4; /* Blue status bar */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=VT323&display=swap');

body {
    font-family: 'Courier Prime', 'Courier New', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Main application pages (live.html, offline.html) need fixed height and no scroll */
body.app-page {
    overflow: hidden;
    height: 100vh;
}

.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-secondary);
}

.ad-slot::before {
    content: 'Advertisement';
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.5;
}

.ad-slot.ad-loaded::before,
.ad-slot.ad-disabled {
    display: none;
}

.app-ad-slot {
    flex: 0 0 auto;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.app-ad-slot-top {
    min-height: 90px;
}

.panel-ad-slot {
    min-height: 250px;
    margin-bottom: 1rem;
    border: 1px dashed var(--border-color);
    background: var(--bg-tertiary);
}

.coming-soon-text {
display: none;
}

/* Retro scan line effect for dark theme */
[data-theme="dark"] body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(74, 222, 128, 0.01) 2px,
        rgba(74, 222, 128, 0.01) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

.hidden {
    display: none !important;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px var(--shadow-dark);
    max-width: 400px;
    width: 90%;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--bg-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Packet List Loading Spinner */
.packet-list-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.packet-list-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--bg-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

.packet-list-loading-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

.loading-headline {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.loading-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.loading-download {
    margin: 1rem 0 1.5rem 0;
    padding: 0.75rem;
    background: rgba(0, 168, 255, 0.1);
    border: 1px solid rgba(0, 168, 255, 0.3);
    border-radius: 6px;
}

.download-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.download-link {
    color: var(--bg-accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.download-link:hover {
    color: #0094e6;
    border-bottom-color: #0094e6;
}

.download-link:active {
    transform: translateY(1px);
}

.loading-form {
    text-align: left;
}

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

.form-row label {
    min-width: 60px;
    font-weight: 500;
}

.form-row input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Connect Button Styling */
#overlayConnect {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--info), var(--bg-accent));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

#overlayConnect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#overlayConnect:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, var(--bg-accent), var(--info));
}

#overlayConnect:hover::before {
    left: 100%;
}

#overlayConnect:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#overlayConnect:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Form Actions Container */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Local Mode Button */
#overlayLocalMode,
.local-mode-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: block;
}

#overlayLocalMode::before,
.local-mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.1), transparent);
    transition: left 0.5s;
}

#overlayLocalMode:hover,
.local-mode-btn:hover {
    color: var(--info);
    border-color: var(--info);
    background: rgba(88, 166, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

#overlayLocalMode:hover::before,
.local-mode-btn:hover::before {
    left: 100%;
}

#overlayLocalMode:active,
.local-mode-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.1);
}

/* Pulse animation for local mode button when connection fails */
.connection-error #overlayLocalMode {
    animation: pulseLocalMode 2s infinite;
}

@keyframes pulseLocalMode {
    0%, 100% {
        border-color: var(--border-color);
        box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.4);
    }
    50% {
        border-color: var(--info);
        box-shadow: 0 0 0 8px rgba(88, 166, 255, 0.1);
    }
}

.overlay-error {
    background: var(--danger);
    color: white;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Main Application Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--toolbar-bg);
    border: 1px solid var(--border-color);
    border-bottom: 2px solid var(--border-accent);
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1.25rem;
    height: 60px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--shadow);
    margin: 4px 4px 0 4px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    font-family: 'VT323', monospace;
    text-shadow: 0 0 10px var(--text-primary);
    letter-spacing: 2px;
}

.app-logo {
    font-size: 1.8rem;
    animation: pulse 2s infinite;
}

.app-name {
    color: var(--text-primary);
    text-transform: uppercase;
}

.app-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.toolbar-btn.header-hamburger {
    display: none !important;
    padding: 0.75rem 1rem;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .toolbar-btn.header-hamburger {
        display: inline-flex !important;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Toolbar Controls */
.capture-controls,
.mode-selector {
    display: flex;
    gap: 0.5rem;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--bg-accent);
    border-radius: 4px;
    background: var(--bg-accent);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 36px;
}

.toolbar-btn:hover:not(:disabled) {
    background: #0094e6;
    border-color: #0094e6;
    box-shadow: 0 2px 8px rgba(0, 168, 255, 0.3);
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-btn.capture-btn.active {
    background: var(--bg-accent);
    color: white;
    border-color: var(--bg-accent);
}

.mode-btn {
    position: relative;
}

.mode-btn.active {
    background: var(--bg-accent);
    color: white;
    border-color: var(--bg-accent);
}

.btn-icon {
    font-size: 0.875rem;
}

.btn-text {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Theme Toggle */
.theme-btn {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn .theme-icon-dark,
.theme-btn .theme-icon-light {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 18px;
    line-height: 1;
}

/* Copyright Notice */
.copyright-notice {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.75rem;
    color: white;
    border-left: 1px solid var(--border-color);
    user-select: none;
}

.copyright-notice span {
    white-space: nowrap;
}

/* Version Info */
.header-version-info {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-left: 1px solid var(--border-color);
    user-select: none;
}

.header-version-info span {
    white-space: nowrap;
}

.status-bar-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
    user-select: none;
    white-space: nowrap;
}

[data-theme="light"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: none;
}

/* Show appropriate icon for each theme */
[data-theme="light"] .theme-icon-dark {
    display: flex;
}

[data-theme="dark"] .theme-icon-light {
    display: flex;
}

/* Status Indicators */
.status-indicators {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Tier Badge */
.tier-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.tier-badge.tier-free {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.tier-badge.tier-pro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tier-badge.tier-enterprise {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-color: #f5576c;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

/* Sync Status */
.sync-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sync-status.syncing {
    color: var(--warning);
    background: rgba(255, 193, 7, 0.1);
}

.sync-status.synced {
    color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.sync-status.error {
    color: var(--danger);
    background: rgba(244, 67, 54, 0.1);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    transition: background-color 0.3s ease;
}

.status-dot.connected {
    background: var(--success);
}

.bandwidth-indicator {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.bandwidth-indicator.warning {
    color: var(--warning);
    border-color: var(--warning);
    background: rgba(255, 193, 7, 0.1);
}

.bandwidth-indicator.danger {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(244, 67, 54, 0.1);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.packet-counter {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Performance Settings */
.slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 300px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.15);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.slider-container input[type="range"]:focus {
    border-color: var(--primary);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider-container input[type="range"]::-moz-range-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.15);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.slider-value {
    min-width: 60px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    text-align: right;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.slider-unit {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.setting-help {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
}

.memory-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.memory-value {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 60px;
}

.setting-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.setting-btn.secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    margin: 0 4px 4px 4px;
    position: relative;
    transition: all 0.3s ease;
}

/* Drag and Drop Visual Feedback */
.main-content.drag-over {
    background: rgba(52, 152, 219, 0.1);
    border: 3px dashed var(--primary);
    border-radius: 8px;
}

.main-content.drag-over::before {
    content: "📁 Drop PCAP file here";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    background: var(--bg-primary);
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    pointer-events: none;
}

/* Packet List Container */
.packet-list-container {
    display: flex;
    flex-direction: column;
    flex: 1; /* Take remaining space after bottom panel */
    min-height: 300px;
    background: var(--bg-primary);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.packet-list-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.filter-input.filter-active {
    border-color: var(--info);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--bg-accent);
    border-radius: 4px;
    background: var(--bg-accent);
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #0094e6;
    box-shadow: 0 2px 8px rgba(0, 168, 255, 0.3);
}

.filter-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Filter Mode Indicators */
.filter-input.filter-none {
    border-color: var(--border-color);
    background: var(--bg-primary);
}

.filter-input.filter-server {
    border-color: var(--success);
    background: var(--success-alpha);
    box-shadow: 0 0 0 1px var(--success-alpha);
}

.filter-input.filter-client {
    border-color: var(--warning);
    background: var(--warning-alpha);
    box-shadow: 0 0 0 1px var(--warning-alpha);
}

.filter-input.filter-hybrid {
    border-color: var(--info);
    background: var(--info-alpha);
    box-shadow: 0 0 0 1px var(--info-alpha);
}

/* Filter indicator icons */
.filter-input::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s ease;
}

.filter-input.filter-server::after {
    background: var(--success);
    box-shadow: 0 0 4px var(--success);
}

.filter-input.filter-client::after {
    background: var(--warning);
    box-shadow: 0 0 4px var(--warning);
}

.filter-input.filter-hybrid::after {
    background: var(--info);
    box-shadow: 0 0 4px var(--info);
}

.filter-input.filter-none::after {
    background: var(--text-secondary);
    opacity: 0.5;
}

/* Filter status indicator */
.filter-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.filter-progress {
    display: none;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.filter-progress.active {
    display: inline-flex;
}

.filter-progress.mobile {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
    justify-content: flex-start;
}

.filter-progress.mobile.active {
    display: flex;
}

.filter-progress-text {
    letter-spacing: 0.02em;
}

.filter-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--info);
    border-right-color: var(--info);
    animation: filter-spin 0.8s linear infinite;
}

.filter-input.filter-loading {
    cursor: progress;
}

@keyframes filter-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.filter-status-icon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.filter-status-icon.server {
    background: var(--success);
    box-shadow: 0 0 4px var(--success);
}

.filter-status-icon.client {
    background: var(--warning);
    box-shadow: 0 0 4px var(--warning);
}

.filter-status-icon.hybrid {
    background: var(--info);
    box-shadow: 0 0 4px var(--info);
}

/* Packet Table */
.packet-list-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.packet-table-header {
    display: flex;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
}

.header-cell {
    padding: 0.75rem 0.5rem;
    text-align: left;
    user-select: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-cell:hover {
    background: rgba(0, 168, 255, 0.05);
}

.header-cell:last-child {
    flex: 1; /* Last column takes remaining space */
}

/* Column resize handles */
.header-cell:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: transparent;
    cursor: col-resize;
    z-index: 10;
    transition: all 0.2s ease;
    border-right: 1px solid var(--border-light);
}

.header-cell:not(:last-child):hover::after {
    background: var(--border-accent);
    opacity: 0.3;
    border-right: 2px solid var(--border-accent);
    box-shadow: 0 0 4px var(--border-accent);
}

.header-cell.resizing::after {
    background: var(--bg-accent);
    box-shadow: 0 0 8px var(--bg-accent);
    width: 6px;
}

/* Default column widths */
.header-cell.seq { width: 80px; min-width: 50px; }
.header-cell.time { width: 120px; min-width: 80px; }
.header-cell.source { width: 150px; min-width: 100px; }
.header-cell.destination { width: 150px; min-width: 100px; }
.header-cell.protocol { width: 100px; min-width: 60px; }
.header-cell.length { width: 80px; min-width: 50px; }

.packet-table-body {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    position: relative; /* For absolute positioned loading spinner */
    transition: border-color 0.2s ease;
}

/* Fast scrolling indicator */
/* .packet-table-body.fast-scrolling {
    /* border-left: 3px solid var(--warning);
    box-shadow: inset 3px 0 0 var(--warning); */
} */

/* End of capture bar */
.end-of-capture-bar {
    background: linear-gradient(135deg, var(--success-light), var(--success));
    border-top: 2px solid var(--success);
    padding: 16px 20px;
    margin: 0;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.2s ease-out;
}

.end-bar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.end-bar-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.end-bar-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bg-primary);
    margin-bottom: 2px;
}

.end-bar-subtext {
    font-size: 0.8rem;
    color: var(--bg-primary);
    opacity: 0.9;
}

/* Hotkey feedback */
.hotkey-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: var(--bg-primary);
    border: 2px solid var(--border-accent);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px var(--shadow);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
    text-align: center;
    transition: all 0.2s ease;
}

.hotkey-feedback.hotkey-pause {
    border-color: var(--warning);
    background: rgba(240, 178, 50, 0.1);
    color: var(--warning);
}

.hotkey-feedback.hotkey-resume {
    border-color: var(--success);
    background: rgba(35, 165, 89, 0.1);
    color: var(--success);
}

.hotkey-feedback.hotkey-clear {
    border-color: var(--danger);
    background: rgba(242, 63, 67, 0.1);
    color: var(--danger);
}

.hotkey-feedback.hotkey-export {
    border-color: var(--info);
    background: rgba(0, 168, 255, 0.1);
    color: var(--info);
}

.hotkey-feedback.hotkey-streams {
    border-color: var(--bg-accent);
    background: rgba(0, 168, 255, 0.1);
    color: var(--bg-accent);
}

.hotkey-message {
    display: block;
    white-space: nowrap;
}

/* Hotkey help modal */
.hotkey-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.hotkey-help {
    background: var(--bg-primary);
    border: 2px solid var(--border-accent);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 32px var(--shadow-dark);
    max-width: 400px;
    width: 90%;
    animation: slideInUp 0.3s ease;
}

.hotkey-help h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    text-align: center;
}

.hotkey-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hotkey-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.hotkey-item kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 60px;
    text-align: center;
    box-shadow: 0 1px 2px var(--shadow);
}

.hotkey-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Packet Rows */
.packet-row {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.8125rem;
    min-height: 30px;
    align-items: center;
    color: var(--text-primary);
    background: var(--row-even);
    width: 100%;
}

.packet-row:nth-child(odd) {
    background: var(--row-odd);
}

.packet-row:hover {
    background: var(--packet-hover);
}

.packet-row.selected {
    background: rgba(0, 168, 255, 0.2);
    color: var(--text-primary);
    border-left: 3px solid var(--bg-accent);
    box-shadow: inset 0 0 0 1px rgba(0, 168, 255, 0.3);
    font-weight: 600;
}

.packet-row.selected .packet-cell {
    color: var(--text-primary);
}

.packet-row.selected .packet-cell.protocol {
    font-weight: 600;
    margin: 0 2px;
}

.packet-cell {
    padding: 0.5rem 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--text-primary);
    font-size: 0.85rem;
    border-right: 1px solid var(--border-light);
}

.packet-cell:last-child {
    border-right: none;
    flex: 1; /* Last cell takes remaining space */
}

.packet-cell.seq {
    width: 80px;
    text-align: right;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.packet-cell.time {
    width: 120px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.75rem;
}

.packet-cell.source {
    width: 150px;
}

.packet-cell.destination {
    width: 150px;
}

.packet-cell.protocol {
    width: 100px;
    font-weight: 600;
    text-transform: uppercase;
}

.packet-cell.length {
    width: 80px;
    text-align: right;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Virtual List Styles */
.rvlist-container {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.rvlist-item {
    background: transparent !important;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.rvlist-item:hover {
    background: transparent !important;
}

.rvlist-item:nth-child(odd) {
    background: transparent !important;
}

.rvlist-item:nth-child(odd):hover {
    background: transparent !important;
}

/* Ensure virtual list items inherit proper styling */
.rvlist-item .packet-row {
    border-bottom: none;
    /* Don't override background - let protocol colors show through */
}

/* .rvlist-item .packet-row:hover - let protocol colors show through */

.rvlist-item .packet-row.selected {
    background: rgba(0, 168, 255, 0.2) !important;
}

/* Empty State */
.packet-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-subtext {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Horizontal Splitter */
.horizontal-splitter {
    height: 12px;
    background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-tertiary));
    cursor: ns-resize;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 2px 4px;
    box-shadow: 0 1px 3px var(--shadow);
}

.horizontal-splitter:hover {
    background: linear-gradient(to bottom, var(--bg-tertiary), var(--bg-accent));
    border-color: var(--border-accent);
    box-shadow: 0 2px 6px var(--shadow-dark);
    transform: scaleY(1.1);
}

.horizontal-splitter.dragging {
    background: linear-gradient(to bottom, var(--bg-accent), var(--bg-primary));
    border-color: var(--border-accent);
    box-shadow: 0 4px 8px var(--shadow-dark);
    z-index: 100;
}

/* Add resize handle visual indicator */
.horizontal-splitter::before {
    content: '⋮⋮⋮';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    opacity: 0.7;
}

.horizontal-splitter:hover::before,
.horizontal-splitter.dragging::before {
    color: var(--text-primary);
    opacity: 1;
}

/* Bottom Panel Container */
.bottom-panel-container {
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    flex: 0 1 350px; /* Allow shrinking and growing, start at 350px */
    min-height: 200px;
    max-height: 80vh; /* Allow more space when dragging up */
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow);
}

.bottom-panel-container.collapsed {
    height: 40px;
}

.bottom-panel-container.collapsed .panel-content {
    display: none;
}

/* Panel Tabs */
.panel-tabs {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    height: 36px;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Webkit scrollbar styling for panel tabs */
.panel-tabs::-webkit-scrollbar {
    height: 4px;
}

.panel-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.panel-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.panel-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--border-accent);
}

.tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8125rem;
    user-select: none;
    color: var(--text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(0, 168, 255, 0.05);
}

.tab.active {
    background: var(--panel-bg);
    border-bottom: 2px solid var(--bg-accent);
    color: var(--text-primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 0.875rem;
}

.tab-text {
    white-space: nowrap;
}

.tab-spacer {
    flex: 1;
    min-width: 0;
}

.panel-collapse-btn {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.panel-collapse-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.bottom-panel-container.collapsed .collapse-icon {
    transform: rotate(180deg);
}

/* Panel Content */
.panel-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.panel {
    display: none;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.panel.active {
    display: flex;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.panel-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.panel-btn:hover {
    background: var(--bg-tertiary);
}

.panel-btn.primary {
    background: var(--bg-accent);
    color: white;
    border-color: var(--bg-accent);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Help Panel */
.help-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.help-empty-state {
    color: var(--text-secondary);
    font-style: italic;
}

.help-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.help-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section-description {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.help-list {
    list-style: disc;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.help-list li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.help-list li:last-child {
    margin-bottom: 0;
}

.help-list code {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.help-example-code {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    display: inline-block;
    margin-bottom: 0.35rem;
}

.help-example-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.help-example-item {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--bg-accent);
    color: var(--text-secondary);
}

.help-example-description {
    margin-top: 0.35rem;
    font-size: 0.85rem;
}

.help-note {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.about-section {
    margin-top: 2rem;
}

.help-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}

@media (max-width: 768px) {
    .help-section {
        padding: 1rem;
    }

    .help-list {
        padding-left: 1.25rem;
    }
}

/* Packet Details Panel */
.packet-detail-content {
    height: 100%;
    display: block;
    overflow-y: auto;
}

.packet-detail-content.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-empty {
    text-align: center;
    color: var(--text-light);
}

.detail-summary {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 0;
    margin-bottom: 0;
    border-left: 3px solid var(--bg-accent);
}

.detail-summary div {
    margin-bottom: 0.5rem;
}

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

/* Settings Panel */
.settings-section {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 4px var(--shadow);
}

.settings-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-accent);
    padding-bottom: 0.75rem;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    flex-wrap: wrap;
}

.setting-row:hover {
    background: var(--bg-tertiary);
}

.setting-row label {
    min-width: 140px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.setting-row input,
.setting-row select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px var(--shadow);
}

.setting-row input:focus,
.setting-row select:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1), 0 2px 4px var(--shadow);
    transform: translateY(-1px);
}

/* Enhanced select styling */
.setting-row select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23656d76' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
    cursor: pointer;
}

.setting-row select:hover {
    border-color: var(--border-accent);
    background-color: var(--bg-tertiary);
}

.setting-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-accent);
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.setting-btn:hover {
    opacity: 0.9;
}

.setting-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.radio-group {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.radio-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 80px;
    text-align: center;
    user-select: none;
}

.radio-label:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

/* Style the label when radio is checked */
.radio-label:has(input[type="radio"]:checked) {
    background: var(--info);
    color: white;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

/* Fallback for browsers without :has() support */
.radio-label.active {
    background: var(--info);
    color: white;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.radio-text {
    pointer-events: none;
    transition: all 0.2s ease;
}

.checkbox-text {
    font-size: 0.875rem;
}

/* Responsive render mode buttons */
@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .radio-label {
        min-width: unset;
        width: 100%;
    }
}

/* Protocols Panel */
.protocols-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
}

.protocol-builder {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    background: var(--bg-secondary);
}

.protocol-builder h4 {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Installed Protocols & Protocol Colors Styling */
.installed-protocols,
.protocol-colors-section {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    background: var(--bg-secondary);
}

.installed-protocols h4,
.protocol-colors-section h4 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Protocol Colors Actions */
.protocol-colors-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.protocol-colors-actions input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.protocol-colors-actions input[type="color"] {
    width: 50px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.protocol-color-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.protocol-color-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.protocol-color-item:hover {
    border-color: var(--border-accent);
    box-shadow: 0 2px 4px var(--shadow);
}

.protocol-color-item input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.protocol-color-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.protocol-color-item button {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}


.protocol-color-item button:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-accent);
}

.protocol-color-item button.apply-color {
    background: var(--info);
    color: white;
    border-color: var(--info);
}

.protocol-color-item button.apply-color:hover {
    background: #4A8FD6;
}

.protocol-color-item button.secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.protocol-color-item button.secondary:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Installed Protocols Styling */
.proto-installed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.proto-installed-list.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    text-align: center;
    padding: 24px;
}

.proto-installed-list.empty::before {
    content: '📦';
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.proto-installed-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow);
    animation: slideInUp 0.3s ease-out;
}

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

.proto-installed-item:hover {
    border-color: var(--border-accent);
    box-shadow: 0 4px 8px var(--shadow-dark);
    transform: translateY(-1px);
}

.proto-installed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.proto-installed-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.proto-installed-meta {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    opacity: 0.8;
}

.proto-installed-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.proto-installed-actions button {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.proto-installed-actions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.proto-installed-actions button:hover::before {
    left: 100%;
}

.proto-installed-actions button:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-accent);
    color: var(--text-light);
}

.proto-installed-actions button.proto-load {
    background: var(--info);
    color: white;
    border-color: var(--info);
}

.proto-installed-actions button.proto-load:hover {
    background: var(--info);
    opacity: 0.9;
    transform: translateY(-1px);
}

.proto-installed-actions button.proto-export {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.proto-installed-actions button.proto-export:hover {
    background: var(--success);
    opacity: 0.9;
    transform: translateY(-1px);
}

.proto-installed-actions button.proto-remove {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.proto-installed-actions button.proto-remove:hover {
    background: var(--danger);
    opacity: 0.9;
    transform: translateY(-1px);
}

.proto-installed-actions button.secondary {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.proto-installed-actions button.secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.proto-installed-body {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.proto-installed-body span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.proto-installed-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Protocol Color Indicator */
.proto-installed-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--protocol-color, var(--info));
    border-radius: 8px 0 0 8px;
}

.proto-installed-item {
    position: relative;
}

/* Responsive Design for Installed Protocols */
@media (max-width: 768px) {
    .filter-button {
        display: flex;
        gap: 0.5rem;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .filter-button button {
        padding: 10px;
    }
    .proto-installed-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .proto-installed-actions {
        justify-content: flex-end;
    }
    
    .proto-installed-actions button {
        flex: 1;
        min-width: 0;
    }
    
    .proto-installed-body {
        flex-direction: column;
        gap: 8px;
    }
}

.builder-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.signatures-section {
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.section-header h5 {
    font-size: 0.875rem;
    font-weight: 600;
}

.add-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--bg-accent);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.add-btn:hover {
    background: var(--bg-accent);
    color: white;
}

.signatures-list {
    min-height: 60px;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    background: var(--bg-primary);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.form-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-btn.primary {
    background: var(--bg-accent);
    color: white;
    border-color: var(--bg-accent);
}

.form-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-btn:hover {
    opacity: 0.9;
}

/* Annotation Panel */
.annotation-content {
    height: 100%;
}

.annotation-info {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.annotation-info.empty {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.annotation-info.empty::before {
    content: '📝';
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.6;
}

.packet-info, .selection-info {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.packet-info {
    font-weight: 600;
}

.selection-info {
    color: var(--text-secondary);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.info-label {
    font-weight: 500;
    min-width: 120px;
}

#selectedPacketInfo {
    font-weight: 600;
    color: var(--text-primary);
}

.annotation-instructions {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid var(--info);
}

.annotation-instructions h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--info);
}

.annotation-instructions ol {
    margin-left: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.annotation-instructions li {
    margin-bottom: 0.25rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay, rgba(0, 0, 0, 0.8));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    color: var(--text-primary);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-container {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px var(--shadow-dark), 0 0 0 1px var(--border-light);
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-input {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-input:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

/* Guided Tutorial */
.app-tutorial {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1300;
}

.app-tutorial.hidden {
    display: none !important;
}

.app-tutorial-backdrop {
    position: absolute;
    inset: 0;
    background: var(--modal-overlay, rgba(0, 0, 0, 0.75));
    backdrop-filter: blur(6px);
}

.app-tutorial-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2.25rem 2.5rem;
    background: var(--panel-bg, var(--bg-primary));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    overflow-y: auto;
}

.tutorial-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.tutorial-close:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
}

.tutorial-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tutorial-step-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.tutorial-progress {
    width: 180px;
    height: 6px;
    background: var(--border-light);
    border-radius: 999px;
    overflow: hidden;
}

.tutorial-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--bg-accent);
    border-radius: inherit;
    transition: width 0.3s ease;
}

.tutorial-link {
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.tutorial-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tutorial-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tutorial-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tutorial-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tutorial-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
}

.tutorial-list li {
    position: relative;
    padding-left: 2rem;
    font-size: 0.975rem;
    color: var(--text-primary);
    line-height: 1.55;
}

.tutorial-list li::before {
    content: '✓';
    position: absolute;
    left: 0.45rem;
    top: 0;
    color: var(--success);
    font-weight: 700;
}

.tutorial-tip {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(0, 168, 255, 0.07);
    border: 1px solid rgba(0, 168, 255, 0.25);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tutorial-tip-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--bg-accent);
    margin-right: 0.25rem;
}

.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
}

.tutorial-btn {
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tutorial-btn.primary {
    background: var(--bg-accent);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 168, 255, 0.25);
}

.tutorial-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 168, 255, 0.3);
}

.tutorial-btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.tutorial-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tutorial-btn:disabled,
.tutorial-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tutorial-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    margin-bottom: 1.5rem;
}

.callout-copy h4 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.callout-copy p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tutorial-inline-btn {
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.25rem;
    background: var(--bg-accent);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.tutorial-inline-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 168, 255, 0.25);
}

@media (max-width: 768px) {
    .app-tutorial {
        padding: 1.25rem;
    }
    
    .app-tutorial-dialog {
        padding: 1.75rem;
        gap: 1.25rem;
    }
    
    .tutorial-progress {
        width: 140px;
    }
    
    .tutorial-title {
        font-size: 1.45rem;
    }
    
    .tutorial-callout {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tutorial-inline-btn {
        width: 100%;
        text-align: center;
    }
}


.modal-color-input {
    width: 60px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg-secondary);
}

.modal-btn {
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-accent);
}

.modal-btn.primary {
    background: var(--info);
    color: white;
    border-color: var(--info);
}

.modal-btn.primary:hover {
    background: #4A8FD6;
}

.modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px var(--shadow-dark), 0 0 0 1px var(--border-light);
    max-width: 90vw;
    max-height: 90vh;
    min-width: 320px;
    min-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

/* Responsive modal for small screens */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 1rem;
        border-radius: 8px;
    }
    
    .packet-annotation-modal {
        width: auto;
        height: auto;
        min-height: 500px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .modal-footer button {
        min-width: 80px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Responsive loading overlay */
    .loading-card {
        padding: 1.5rem;
        max-width: 95%;
    }
    
    .form-actions {
        gap: 0.5rem;
    }
    
    #overlayConnect, #overlayLocalMode {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Responsive toolbar interface selector */
    .interface-selector {
        margin-left: 0.5rem;
        gap: 0.25rem;
    }
    
    .interface-label {
        font-size: 0.8rem;
    }
    
    .interface-select {
        min-width: 100px;
        font-size: 0.8rem;
    }
    
    /* Responsive PCAN config in toolbar */
    .pcan-config-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-left: 0.5rem;
    }
    
    .pcan-config-row {
        gap: 0.2rem;
    }
    
    .pcan-label {
        font-size: 0.7rem;
    }
    
    .pcan-select {
        min-width: 70px;
        font-size: 0.7rem;
    }
}

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

.packet-annotation-modal {
    width: 900px;
    height: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
    transform: scale(1.1);
}

.modal-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
}

.modal-footer button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-footer button.primary {
    background: var(--info);
    color: white;
    border-color: var(--info);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-footer button.primary:hover:not(:disabled) {
    background: var(--info-dark);
    border-color: var(--info-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.modal-footer button:not(.primary) {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.modal-footer button:not(.primary):hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--info);
    color: var(--info);
}

.modal-footer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Hex Viewer Styles (in modal) */
.hex-viewer-container {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 1rem 0;
    background: var(--bg-secondary);
}

.hex-viewer-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.hex-viewer-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.hex-viewer-controls button {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.hex-viewer-controls button:hover {
    background: var(--bg-tertiary);
}

.hex-viewer-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-left: auto;
}

.hex-viewer-instructions {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.hex-viewer {
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    background: var(--bg-primary);
    max-height: 300px;
    overflow-y: auto;
}

/* Hex Row Layout */
.hex-row {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    padding: 2px 0;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.hex-row:hover {
    background: var(--bg-tertiary);
}

.hex-row.selection-row {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--packet-selected);
}

/* Offset Column */
.hex-offset {
    width: 80px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 1rem;
    flex-shrink: 0;
    text-align: right;
}

/* Hex Bytes Column */
.hex-bytes {
    display: flex;
    gap: 4px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.hex-byte {
    display: inline-block;
    width: 24px;
    text-align: center;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
}

.hex-byte:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.hex-byte.selected {
    background: var(--packet-selected);
    color: white;
    border-color: var(--packet-selected);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hex-byte.selection-start {
    border-left: 3px solid var(--accent-color);
}

.hex-byte.selection-end {
    border-right: 3px solid var(--accent-color);
}

/* ASCII Column */
.hex-ascii {
    display: flex;
    gap: 1px;
    flex-grow: 1;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.ascii-char {
    display: inline-block;
    width: 12px;
    text-align: center;
    padding: 2px 1px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.8rem;
}

.ascii-char:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.ascii-char.selected {
    background: var(--packet-selected);
    color: white;
    border-color: var(--packet-selected);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ascii-char.selection-start {
    border-left: 2px solid var(--accent-color);
}

.ascii-char.selection-end {
    border-right: 2px solid var(--accent-color);
}

/* UTF-8 Character Styling */
.ascii-char.utf8-char {
    color: var(--accent-color);
    font-weight: 500;
}

.ascii-char.control-char {
    color: var(--text-secondary);
    font-style: italic;
}

.ascii-char.non-printable {
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

/* Annotation Options Styling */
.annotation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.annotation-option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
    flex: 1;
}

.annotation-option-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.annotation-option-group select,
.annotation-option-group input[type="text"],
.annotation-option-group input[type="number"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    transition: all 0.2s ease;
}

.annotation-option-group select:focus,
.annotation-option-group input[type="text"]:focus,
.annotation-option-group input[type="number"]:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
    background: var(--bg-primary);
}

.annotation-option-group select:hover,
.annotation-option-group input[type="text"]:hover,
.annotation-option-group input[type="number"]:hover {
    border-color: var(--border-accent);
}

.annotation-option-group input[type="text"]::placeholder,
.annotation-option-group input[type="number"]::placeholder {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Annotation Preview */
.annotation-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.annotation-preview label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.signature-preview {
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--info);
    min-height: 60px;
    word-break: break-all;
    line-height: 1.6;
}

.signature-preview:empty::after {
    content: 'Select bytes to generate signature';
    color: var(--text-tertiary);
    font-style: italic;
}

/* Copy Button Styling */
.detail-field-copyable {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 6px;
}

.copy-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
}

.copy-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--info);
    color: var(--info);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.copy-btn svg {
    display: block;
}

/* Interface Selector in Toolbar */
.interface-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding: 0.5rem;
    border-left: 1px solid var(--border-color);
}

.interface-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.interface-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 120px;
}

.interface-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* PCAN Configuration in Toolbar */
.pcan-config-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    padding: 0.5rem;
    border-left: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 6px;
}

.pcan-config-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pcan-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.pcan-select {
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    min-width: 80px;
}

.pcan-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.pcan-checkbox {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-color);
}

/* PCAN Configuration (Legacy - for settings panel) */
.pcan-config {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
}

.pcan-config h5 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.pcan-config .setting-row {
    margin-bottom: 0.75rem;
}

.pcan-config .setting-row:last-child {
    margin-bottom: 0;
}

.pcan-config label {
    display: inline-block;
    width: 120px;
    font-weight: 500;
    color: var(--text-primary);
}

.pcan-config select,
.pcan-config input[type="checkbox"] {
    margin-left: 0.5rem;
}

.pcan-config select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.pcan-config select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.pcan-config input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
}

/* Protocol Section Header */
.protocols-section-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.protocols-section-header h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.protocols-section-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Protocol Type Badges */
.built-in-badge, .custom-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.built-in-badge {
    background: var(--accent-color);
    color: white;
}

.custom-badge {
    background: var(--success-color);
    color: white;
}

/* Color Picker Styling */
.proto-color-picker {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
    margin-right: 0.5rem;
}

.proto-color-picker:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Built-in vs Custom Protocol Styling */
.proto-installed-item.built-in {
    border-left: 3px solid var(--accent-color);
}

.proto-installed-item.custom {
    border-left: 3px solid var(--success-color);
}

/* Fullscreen Mode */
.main-content.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--bg-primary);
}

/* Ensure toolbar remains accessible in fullscreen */
.main-content.fullscreen .toolbar {
    position: relative;
    z-index: 10000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.main-content.fullscreen .packet-list-container {
    height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-content.fullscreen .packet-list-content {
    flex: 1;
    overflow-y: auto;
}

.main-content.fullscreen .packet-list-header {
    flex-shrink: 0;
}

.main-content.fullscreen .horizontal-splitter {
    display: none;
}

.main-content.fullscreen .bottom-panel-container {
    display: none;
}

.toolbar-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Packet Details Layout */
.packet-details-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.packet-details-summary {
    flex-shrink: 0;
}

.packet-details-hex {
    flex: 1;
    min-height: 0;
}

.packet-details-hex h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 8px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* Compact detail summary */
.detail-summary {
    font-size: 13px;
    line-height: 1.4;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.detail-summary div {
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
}

.detail-summary strong {
    min-width: 120px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Hex Split View Styles */
.hex-split-container {
    margin-top: 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex: 1;
    min-height: 300px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: relative;
    overflow: hidden;
}

.hex-split-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

.hex-split-panel + .hex-split-panel {
    border-left: 1px solid var(--border-color);
}

.hex-split-panel-header {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.hex-split-panel-body {
    font-family: 'Cascadia Code', 'Fira Code', 'Courier New', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    padding: 16px;
    background: transparent;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    white-space: pre;
    word-wrap: break-word;
}

.hex-split-hex {
    color: var(--info);
    background: transparent;
}

.hex-split-text {
    color: var(--success);
    background: transparent;
    font-size: 12px;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toolbar-left,
    .toolbar-right {
        gap: 0.75rem;
    }
    
    .btn-text {
        display: none;
    }
    
    .copyright-notice {
        display: none;
    }
    
    .packet-table-header,
    .packet-row {
        display: grid !important;
        grid-template-columns: 80px 120px 140px 140px 100px 80px 1fr;
        font-size: 0.8rem;
        min-width: 800px; /* Ensure comfortable width */
    }
    
    /* Hide packet table headers in mobile mode */
    .packet-table-header {
        display: none !important;
    }
    
    /* Override individual cell widths for grid layout */
    .packet-cell {
        width: auto !important;
        min-width: auto !important;
        flex: none !important;
    }
    
    /* Allow horizontal scrolling for packet list on mobile */
    .packet-list-container {
        overflow: hidden; /* Let the content handle scrolling */
    }
    
    .packet-list-content {
        overflow-x: auto;
        overflow-y: auto;
    }
    
    .packet-list {
        min-width: 800px; /* Match the minimum width of packet rows */
    }
    
    /* Ensure virtual list also allows horizontal scrolling on mobile */
    .rvlist-container {
        overflow-x: auto;
        overflow-y: auto;
        min-width: 800px; /* Match packet row minimum width */
    }
    
    .rvlist-item {
        min-width: 800px; /* Match packet row minimum width */
    }
    
    /* Ensure virtual list items have the same grid layout as regular packet rows */
    .rvlist-item .packet-row {
        display: grid !important;
        grid-template-columns: 80px 120px 140px 140px 100px 80px 1fr;
        min-width: 800px;
    }
    
    /* Ensure virtual list packet cells also use grid layout */
    .rvlist-item .packet-cell {
        width: auto !important;
        min-width: auto !important;
        flex: none !important;
    }
    
    .hex-split-container {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .hex-split-panel + .hex-split-panel {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .hex-split-panel-header {
        border-bottom: 1px solid var(--border-color);
    }

    .hex-split-panel-body {
        max-height: 260px;
        height: auto;
        overflow: auto;
    }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

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

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

.slide-in-bottom {
    animation: slideInBottom 0.3s ease-out;
}

@keyframes slideInBottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-mono {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.font-bold {
    font-weight: 600;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }

/* Status Bar (SyscallShark style) */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: var(--status-bar-bg, #0078d4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    font-size: 0.875rem;
    z-index: 1000;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.3);
}

.status-bar-left,
.status-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-bar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.status-bar span {
    white-space: nowrap;
}
.mb-2 { margin-bottom: 1rem; }

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

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

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
/* ===================================
   Stream Analysis Modal Styles
   =================================== */

.stream-analysis-container {
    max-width: 1200px;
    width: 95vw;
    height: 90vh;
    overflow: hidden;
}

/* Stream View Tabs */
.stream-view-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0; /* Prevent shrinking */
}

.stream-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    top: 2px;
}

.stream-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
}

.stream-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
}

.stream-tab .tab-icon {
    font-size: 1.1rem;
}

/* Stream Views */
.stream-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.stream-view.active {
    display: flex;
}

/* Bandwidth Chart View */
.bandwidth-chart-container {
    flex: 1;
    padding: 1rem;
    overflow: auto;
}

.aggregate-bandwidth-chart {
    min-height: 400px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1.5rem;
}

.aggregate-bandwidth-chart .empty-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.stream-analysis-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Stats Summary Wrapper - for collapsible on mobile */
.stream-stats-wrapper {
    flex-shrink: 0;
}

/* Stats toggle button - hidden on desktop */
.stream-stats-toggle {
    display: none;
}

/* Stats Summary Cards */
.stream-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
    flex-shrink: 0; /* Prevent shrinking */
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Stream Controls */
.stream-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.stream-controls label {
    color: var(--text-primary);
    font-weight: 500;
}

.stream-select,
.stream-input {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.stream-select:focus,
.stream-input:focus {
    outline: none;
    border-color: var(--primary);
}

.stream-input {
    flex: 1;
    min-width: 200px;
}

/* Stream List */
.stream-list-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.stream-list {
    padding: 0.5rem;
}

.stream-list-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stream-list-item:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.stream-list-item:active {
    transform: translateX(4px) scale(0.98);
}

.stream-list-item.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 168, 255, 0.2);
}

.stream-protocol {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stream-in-progress {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--success);
    font-size: 0.6rem;
    animation: pulse-in-progress 2s ease-in-out infinite;
}

@keyframes pulse-in-progress {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.stream-connection {
    margin-bottom: 0.75rem;
}

.stream-endpoints {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.stream-src,
.stream-dst {
    color: var(--text-primary);
}

.stream-arrow {
    color: var(--text-secondary);
}

.stream-metrics {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.stream-metric {
    display: flex;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.metric-label {
    color: var(--text-secondary);
}

.metric-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Sparkline */
.stream-sparkline {
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 4px;
    padding: 0.25rem;
}

.stream-sparkline svg {
    display: block;
}

.stream-list-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Stream Details */
.stream-details {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.stream-details h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.stream-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stream-back-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.stream-back-btn:active {
    transform: translateX(-1px);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
}

.stream-detail-section {
    margin-bottom: 1.5rem;
}

.stream-detail-section h4 {
    color: var(--primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stream-detail-section p {
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.stream-detail-section strong {
    color: var(--text-secondary);
}

/* Timeline Chart */
.stream-timeline {
    margin-top: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

.stream-timeline svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .stream-analysis-container {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border-radius: 0;
    }

    .stream-stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .stream-controls {
        flex-wrap: wrap;
    }

    .stream-metrics {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .stream-stats-summary {
        grid-template-columns: 1fr;
    }

    .stream-endpoints {
        flex-direction: column;
        align-items: flex-start;
    }

    .stream-arrow {
        transform: rotate(90deg);
    }
}

/* Stream Analysis Loading Overlay */
.stream-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.stream-loading-content {
    text-align: center;
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 16px;
    border: 2px solid var(--primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.stream-loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: stream-spin 1s linear infinite;
}

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

.stream-loading-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stream-loading-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Stream Analysis Progress Bar */
.stream-progress-container {
    width: 100%;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stream-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    transition: width 0.2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.stream-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 14px 14px 0 0;
}

.stream-progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

/* Stream Analysis Cancel Button */
.stream-loading-cancel {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stream-loading-cancel:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.stream-loading-cancel:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Hide top toolbar controls on mobile */
    .capture-controls,
    .interface-selector,
    .mode-selector {
        display: none !important;
    }

    .status-indicators, #themeToggle {
        display: none !important;
    }

    /* Hide header version info and app title elements on mobile */
    .header-version-info,
    .app-title {
        display: none !important;
    }

    /* Hide disabled feature tabs and panels */
    [data-panel="protocols"],
    [data-panel="annotation"],
    #protocolsPanel,
    #annotationPanel {
        display: none !important;
    }
    /* Hide specific status elements on mobile, but keep the status bar background */
    .status-bar-message,
    .status-bar-packets,
    .status-bar-connection-dot {
        display: none !important;
    }
    
    /* Keep status bar visible but make it smaller on mobile */
    .status-bar {
        height: 20px;
        font-size: 0.75rem;
        padding: 0 0.5rem;
    }
    
    /* Hide desktop filter bar in mobile mode */
    .packet-list-header .filter-bar {
        display: none !important;
    }
    
    /* Hide fullscreen button on mobile */
    #toggleFullscreen {
        display: none !important;
    }
    
    /* Keep panel tabs visible on mobile so users can access settings */
    .bottom-panel-container .panel-tabs {
        display: flex !important;
    }
    
    /* Make panel collapse button more touch-friendly on mobile */
    .panel-collapse-btn {
        padding: 0.75rem !important;
        font-size: 1.2rem !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    /* Make horizontal splitter more touch-friendly on mobile */
    .horizontal-splitter {
        height: 20px !important;
        min-height: 20px !important;
        touch-action: none;
    }
    
    .horizontal-splitter::before {
        font-size: 16px !important;
        letter-spacing: 3px !important;
    }
    
    /* Make tabs more touch-friendly on mobile */
    .tab {
        min-height: 44px !important;
        padding: 0.75rem 1rem !important;
        touch-action: manipulation;
    }
    
    /* Mobile filter controls */
    .mobile-filter-controls {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .mobile-filter-controls .filter-input {
        flex: 1;
        padding: 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        background: var(--bg-primary);
        color: var(--text-primary);
        font-size: 0.875rem;
        box-sizing: border-box;
        min-width: 0;
    }
    
    .mobile-filter-controls .filter-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    }
    
    .mobile-filter-controls .filter-button {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex-shrink: 0;
    }
    
    .mobile-filter-controls .filter-btn {
        min-width: 60px !important;
        min-height: 36px !important;
        padding: 0.5rem !important;
        font-size: 0.75rem !important;
        flex-direction: row !important;
        justify-content: center !important;
    }
    
    /* Let base CSS handle panel display - no overrides needed */
    
    /* Mobile Panel Toggle Button */
    .mobile-panel-toggle {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--bg-secondary);
        border: 2px solid var(--primary);
        border-radius: 12px;
        color: var(--text-primary);
        cursor: pointer;
        font-size: 18px;
        height: 52px;
        width: auto;
        min-width: 52px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        transition: all 0.2s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        position: relative;
    }
    
    /* Add a subtle menu indicator */
    .mobile-panel-toggle::before {
        content: '';
        position: absolute;
        top: -2px;
        right: -2px;
        width: 8px;
        height: 8px;
        background: var(--primary);
        border-radius: 50%;
        opacity: 0.8;
    }
    
    .mobile-panel-toggle:hover {
        background: var(--bg-tertiary);
        border-color: var(--primary);
        transform: scale(1.05);
    }
    
    .mobile-panel-toggle:active {
        transform: scale(0.95);
    }
    
    .menu-icon {
        font-size: 20px;
        font-weight: 700;
        transition: all 0.2s ease;
        margin-bottom: 2px;
    }
    
    .mobile-panel-toggle .btn-text {
        font-size: 10px;
        font-weight: 500;
        text-align: center;
        line-height: 1;
        margin-top: 2px;
    }
    
    .mobile-panel-toggle:hover .menu-icon {
        transform: scale(1.1);
    }
    
    /* Mobile Panel */
    .mobile-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    
    .mobile-panel.open {
        transform: translateX(0);
    }

    /* Hide hamburger menu when mobile panel is open */
    .mobile-panel-open .toolbar-btn.header-hamburger {
        display: none !important;
    }
    
    .mobile-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-secondary);
    }
    
    .mobile-panel-header h3 {
        margin: 0;
        color: var(--text-primary);
        font-size: 20px;
    }
    
    .mobile-panel-close {
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: background 0.2s ease;
    }
    
    .mobile-panel-close:hover {
        background: var(--bg-tertiary);
    }
    
    .mobile-panel-content {
        padding: 20px;
    }
    
    .mobile-section {
        margin-bottom: 24px;
    }
    
    .mobile-section h4 {
        margin: 0 0 12px 0;
        color: var(--text-primary);
        font-size: 16px;
        font-weight: 600;
    }
    
    .mobile-button-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .mobile-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        color: var(--text-primary);
        cursor: pointer;
        font-size: 14px;
        height: 80px;
        padding: 12px;
        transition: all 0.2s ease;
        text-decoration: none;
    }
    
    .mobile-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--primary);
        transform: translateY(-2px);
    }
    
    .mobile-btn:active {
        transform: translateY(0);
    }
    
    .mobile-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }
    
    .mobile-btn .btn-icon {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .mobile-btn .btn-text {
        font-size: 11px;
        font-weight: 500;
        text-align: center;
        line-height: 1.2;
    }
    
    .mobile-btn.capture-btn {
        background: var(--success);
        border-color: var(--success);
        color: white;
    }
    
    .mobile-btn.capture-btn:hover {
        background: var(--success-hover);
        border-color: var(--success-hover);
    }
    
    .mobile-btn.secondary {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
    }
    
    .mobile-btn.mode-btn {
        grid-column: 1 / -1;
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }
    
    .mobile-btn.mode-btn:hover {
        background: var(--primary-hover);
        border-color: var(--primary-hover);
    }
    
    .mobile-interface-controls {
        display: flex;
        gap: 12px;
        align-items: center;
    }
    
    .mobile-select {
        flex: 1;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        color: var(--text-primary);
        font-size: 14px;
        padding: 12px;
        height: 48px;
    }
    
    /* Adjust packet list for mobile */
    .packet-list-container {
        margin: 8px;
    }
    
    /* Adjust packet cells for mobile */
    .packet-cell {
        font-size: 12px;
        padding: 6px 4px;
    }
    
    .packet-cell.seq {
        min-width: 40px;
    }
    
    .packet-cell.time {
        min-width: 60px;
    }
    
    .packet-cell.source,
    .packet-cell.destination {
        min-width: 80px;
    }
    
    .packet-cell.protocol {
        min-width: 60px;
    }
    
    .packet-cell.length {
        min-width: 50px;
    }
    
    .packet-cell.info {
        flex: 1;
        min-width: 100px;
    }
    
    /* Adjust filter bar for mobile */
    .filter-bar {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    
    .filter-input {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .filter-btn {
        margin: 5px 0;
    }
    
    /* Adjust modal for mobile */
    .modal-container {
        width: 100vw;
        height: 100vh;
        max-width: none;
        margin: 0;
        border-radius: 0;
    }
    
    /* Adjust stream analysis for mobile */
    .stream-analysis-container {
        width: 100vw;
        height: 100vh;
        max-width: none;
        margin: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Make modal body scrollable and fill available space */
    .stream-analysis-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 2rem;
        min-height: 0; /* Critical for flex overflow */
    }
    
    /* Stats wrapper collapsible on mobile */
    .stream-stats-wrapper {
        flex-shrink: 0;
        margin-bottom: 0.5rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-tertiary);
        overflow: hidden;
    }
    
    /* Show toggle button on mobile */
    .stream-stats-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.75rem 1rem;
        background: var(--bg-tertiary);
        border: none;
        color: var(--text-primary);
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s ease;
    }
    
    .stream-stats-toggle:hover {
        background: var(--bg-secondary);
    }
    
    .stream-stats-toggle .toggle-icon {
        font-size: 0.7rem;
        transition: transform 0.3s ease;
    }
    
    .stream-stats-toggle[aria-expanded="false"] .toggle-icon {
        transform: rotate(-90deg);
    }
    
    /* Compact stats summary on mobile */
    .stream-stats-summary {
        flex-shrink: 0;
        margin-bottom: 0;
        padding: 0.5rem;
        gap: 0.5rem;
        grid-template-columns: repeat(2, 1fr);
        max-height: 200px; /* For animation */
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    }
    
    /* Collapsed state */
    .stream-stats-summary.collapsed {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        opacity: 0;
    }
    
    .stat-card {
        padding: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .stream-view-tabs {
        flex-direction: column;
        flex-shrink: 0;
        padding: 0 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .stream-tab {
        width: 100%;
        margin: 2px 0;
        padding: 0.5rem 1rem;
    }
    
    /* Stream view takes remaining space and is scrollable */
    .stream-view {
        flex: 1;
        display: none;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0; /* Critical for flex overflow */
    }
    
    .stream-view.active {
        display: flex;
    }
    
    /* Stream controls compact on mobile */
    .stream-controls {
        flex-shrink: 0;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .stream-controls label {
        font-size: 0.8rem;
    }
    
    .stream-select,
    .stream-input {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    /* Fix streams list for mobile - THIS IS THE KEY FIX */
    .stream-list-container {
        flex: 1;
        overflow-x: hidden;
        overflow-y: auto;
        border-radius: 4px;
        min-height: 200px; /* Minimum visible height */
    }
    
    .stream-list {
        padding: 0.25rem;
        min-width: 100%;
    }
    
    .stream-list-item {
        padding: 0.75rem;
        margin-bottom: 0.25rem;
        border-radius: 4px;
    }
    
    /* Make stream details responsive */
    .stream-details {
        padding: 0.75rem;
        margin-top: 0.5rem;
        border-radius: 4px;
        overflow-x: auto;
        flex-shrink: 0;
    }
    
    /* Fix stream item layout for mobile */
    .stream-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .stream-item-stats {
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
    }
    
    .stream-stat {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Make stream sparkline responsive */
    .stream-sparkline {
        width: 100%;
        min-width: 200px;
    }
    
    .stream-sparkline svg {
        width: 100%;
        height: auto;
    }
    
    /* Fix chart containers for mobile */
    .bandwidth-chart-container {
        flex: 1;
        padding: 0.75rem;
        overflow-x: auto;
        overflow-y: auto;
        min-height: 300px;
    }

    .aggregate-bandwidth-chart {
        min-height: 280px;
        padding: 1rem;
        width: 100%;
        min-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure charts are responsive */
    .aggregate-bandwidth-chart svg {
        width: 100% !important;
        height: 100% !important;
        max-width: 100%;
        min-height: 250px;
    }
    
    /* Mobile Packet Modal */
    .mobile-packet-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        z-index: 1002;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-packet-modal.hidden {
        display: none;
    }
    
    .mobile-packet-modal.open {
        transform: translateY(0);
    }
    
    .mobile-packet-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }
    
    .mobile-packet-modal-header h3 {
        margin: 0;
        color: var(--text-primary);
        font-size: 1.25rem;
    }
    
    .mobile-packet-modal-close {
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 4px;
        transition: background-color 0.2s ease;
    }
    
    .mobile-packet-modal-close:hover {
        background: var(--bg-tertiary);
    }
    
    .mobile-packet-modal-content {
        flex: 1;
        overflow: auto;
        padding: 1rem;
    }
    
    .mobile-packet-detail-content {
        color: var(--text-primary);
        font-family: 'Courier New', monospace;
        font-size: 0.875rem;
        line-height: 1.4;
        min-width: max-content;
        white-space: normal;
    }
    
    /* Allow horizontal scrolling for packet detail content */
    .mobile-packet-detail-content .packet-detail-section {
        white-space: normal;
        min-width: 100%;
    }
    
    .mobile-packet-detail-content .detail-row {
        white-space: nowrap;
        min-width: max-content;
    }
    
    .mobile-packet-detail-content .detail-key {
        white-space: nowrap;
        min-width: max-content;
    }
    
    .mobile-packet-detail-content .detail-value {
        white-space: nowrap;
        min-width: max-content;
    }
    
    /* Allow hex content to wrap properly in mobile modal */
    .mobile-packet-detail-content .packet-details-hex {
        white-space: normal;
        overflow-x: auto;
    }
    
    .mobile-packet-detail-content .packet-details-hex pre {
        white-space: pre-wrap;
        word-break: break-all;
    }

    .mobile-packet-loading,
    .mobile-packet-error {
        font-family: 'Courier New', monospace;
        font-size: 0.95rem;
        color: var(--text-secondary);
        text-align: center;
        padding: 1.5rem 0;
    }
    
    .mobile-packet-error {
        color: var(--warning);
    }
}

/* Hide mobile elements on desktop */
@media (min-width: 769px) {
    .mobile-panel-toggle,
    .mobile-panel,
    .mobile-packet-modal {
        display: none !important;
    }

    .capture-controls,
    .interface-selector,
    .mode-selector {
        display: flex !important;
    }

    /* Hide version info in mode selector on desktop */
    .mode-selector .version-info {
        display: none !important;
    }
    
    .bottom-panel-container {
        display: flex !important;
    }
    
    /* Restore panel tabs on desktop */
    .bottom-panel-container .panel-tabs {
        display: flex !important;
    }
    
    /* Let base CSS handle panel display - no overrides needed */
    
    /* Restore full status bar on desktop */
    .status-bar {
        height: 30px !important;
        font-size: 0.875rem !important;
        padding: 0 1rem !important;
    }
    
    /* Restore status bar elements on desktop */
    .status-bar-message,
    .status-bar-packets,
    .status-bar-connection-dot {
        display: inline !important;
    }
}

/* Packet context menu */
.packet-context-menu {
    position: fixed;
    display: none;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
    z-index: 20000;
    overflow: hidden;
    backdrop-filter: blur(16px);
}

.packet-context-menu.visible {
    display: block;
}

.packet-context-menu.hidden {
    display: none;
}

.packet-context-menu-list {
    display: flex;
    flex-direction: column;
}

.packet-context-menu-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.packet-context-menu-item:hover:not(.disabled) {
    background: rgba(9, 105, 218, 0.12);
    color: var(--bg-accent);
}

.packet-context-menu-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.packet-context-menu-divider {
    height: 1px;
    background: var(--border-color);
}

.packet-row.marked {
    background-color: rgba(250, 204, 21, 0.18);
    border-left-color: #facc15 !important;
}

body[data-theme='dark'] .packet-row.marked {
    background-color: rgba(250, 204, 21, 0.12);
}

/* Filter autocomplete */
.filter-autocomplete {
    position: absolute;
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
    z-index: 16000;
    overflow: hidden;
}

.filter-autocomplete.visible {
    display: block;
}

.filter-autocomplete.hidden {
    display: none;
}

.filter-autocomplete-list {
    display: flex;
    flex-direction: column;
}

.filter-autocomplete-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.filter-autocomplete-item:hover,
.filter-autocomplete-item.active {
    background: rgba(9, 105, 218, 0.14);
    color: var(--bg-accent);
}

/* Export progress modal */
.export-progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
    z-index: 18000;
}

.export-progress-modal.visible {
    display: flex;
}

.export-progress-content {
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    text-align: center;
    min-width: 260px;
}

.export-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
    overflow: hidden;
    margin: 0.75rem 0;
}

.export-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--bg-accent);
    transition: width 0.2s ease;
}

.export-progress-count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
