/* Base styles */
:root {
    --color-bg: #1e1e1e;
    --color-bg-secondary: #252526;
    --color-bg-hover: #2a2d2e;
    --color-text: #cccccc;
    --color-text-muted: #999999;
    --color-border: #3e3e3e;
    --color-header-bg: #252526;
    --color-header-hover-bg: #2d2d2e;
    --color-input-bg: #3c3c3c;
    --color-primary: #0e639c;
    --color-primary-dark: #0b4d7c;
    --color-passed: #4caf50;
    --color-failed: #f44336;
    --color-skipped: #ff9800;
    --color-item-bg: #252526;
    --color-hover: #3c3c3c;
    --color-primary-hover: #1177bb;
    --color-error: #f14c4c;
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-info: #2196f3;
    --color-toast-bg: #333;
    --border-radius: 4px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 4px 10px rgba(0, 0, 0, 0.5);
    --transition-speed: 0.3s;
    --accent-color: #0e639c;
    --accent-color-light: rgba(14, 99, 156, 0.5);
    --accent-color-bright: #2196f3;
    --highlight-color: rgba(33, 150, 243, 0.2);
    --highlight-color-light: rgba(33, 150, 243, 0.1);
    --text-color: #333;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    font-size: var(--font-size-md);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

.container.with-docked-panel {
    margin-right: 380px;
}

.hidden {
    display: none !important;
}

/* Header styles */
header {
    background-color: var(--color-header-bg);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: 2;
}

header h1 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: center;
    justify-content: space-between;
}

.folder-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

select, button {
    background-color: var(--color-item-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-md);
    cursor: pointer;
}

select {
    min-width: 200px;
}

button:hover {
    background-color: var(--color-hover);
}

button.active {
    background-color: var(--color-primary);
}

.filter-controls {
    display: flex;
    gap: var(--spacing-xs);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: var(--spacing-md);
}

#search-input {
    background-color: var(--color-item-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-md);
    min-width: 200px;
}

#search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.search-clear {
    position: absolute;
    right: var(--spacing-xs);
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 var(--spacing-xs);
}

.search-clear:hover {
    color: var(--color-text);
}

/* Loading and No Results states */
.loading, .no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Test Results Gallery */
.test-results {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.test-group {
    background-color: var(--color-item-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.test-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--color-header);
    border-bottom: 1px solid var(--color-border);
}

.test-file-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 500;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

.test-card {
    position: relative;
    background-color: var(--color-item-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.test-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.test-card:hover .test-thumbnail {
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.test-card-header {
    padding: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.test-card-header:hover {
    background-color: var(--color-bg-hover);
}

.test-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: var(--spacing-xs);
}

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

.status.failed {
    background-color: var(--color-error);
}

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

.test-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.test-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-item-bg);
    color: var(--color-text-muted);
    border-radius: var(--border-radius);
    font-size: var(--font-size-md);
    border: 1px dashed var(--color-border);
}

.missing-image-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--color-warning);
    color: #000;
    padding: 2px 6px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    opacity: 0.85;
    z-index: 1;
}

.test-info {
    padding: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Detail Modal */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center; /* Center horizontally */
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

/* Adjust modal width when docked panel is visible */
.detail-modal.with-docked-panel {
    width: calc(100% - 380px);
}

.detail-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Regular Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

/* Modal Content */
.detail-modal .modal-content {
    background-color: var(--color-bg);
    border-radius: var(--border-radius);
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.modal .modal-content {
    background-color: var(--color-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-header-bg);
    flex-wrap: nowrap;
}

.modal-header h2 {
    margin: 0;
    padding: 0;
    font-size: 1.5rem;
    color: var(--color-text);
    font-weight: 600;
    min-width: 0;
    flex: 1;
}

/* Group button styling */
#modal-group-button {
    margin: 0 10px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 5px 10px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 14px;
    flex-shrink: 0;
    height: 32px;
}

#modal-group-button:hover {
    background-color: var(--color-primary-hover);
}

#modal-group-button svg {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Selection container */
.modal-header .test-selection-container {
    display: flex;
    align-items: center;
    margin-left: 4px;
    margin-right: 8px;
    flex-shrink: 0;
    height: 32px;
}

/* Selection button in modal header */
.test-selection-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--color-input-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 5px 10px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: background-color 0.2s, border-color 0.2s;
    height: 32px;
}

.test-selection-button .selection-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid currentColor;
    border-radius: 3px;
    background-color: transparent;
    position: relative;
}

.test-selection-button .checkmark-svg {
    opacity: 0;
    transition: opacity 0.2s;
    position: absolute;
}

.test-selection-button:hover {
    background-color: var(--color-hover);
}

.test-selection-button.selected {
    background-color: var(--color-input-bg);
    color: var(--color-text);
}

.test-selection-button.selected:hover {
    background-color: var(--color-hover);
}

.test-selection-button.selected .selection-button-icon {
    background-color: var(--color-primary);
    border-color: var(--color-primary-dark);
}

/* Old checkbox styles - keep for backward compatibility */
.modal-header .test-selection-checkbox {
    position: static;
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    transform: none;
    padding: 0;
    box-shadow: none;
    opacity: 1;
}

.modal-header .selection-label {
    font-size: var(--font-size-md);
    color: var(--color-text);
    white-space: nowrap;
}

/* Test info section */
.modal-header .test-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    color: var(--color-text);
    flex-shrink: 0;
}

.modal-header .test-info .status {
    margin-right: 0;
}

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

/* Close button */
.modal-header .close-button {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text);
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    padding: 0 5px;
    opacity: 0.7;
    margin-left: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.modal-header .close-button:hover {
    opacity: 1;
}

/* Grid Mode */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.grid-item h3 {
    font-size: var(--font-size-md);
    font-weight: 500;
    text-align: center;
}

.image-container {
    position: relative;
    background-color: #1a1a1a;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc((95vh - 250px) / 3); /* Divide available height by 3 with some padding */
}

.detail-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Single Image Mode */
.single-image-view {
    padding: var(--spacing-md);
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 200px;
}

.single-image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.single-image-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 500;
}

.back-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--border-radius);
    cursor: pointer;
}

.back-button:hover {
    background-color: var(--color-primary-hover);
}

.single-image-container {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    background-color: #1a1a1a;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
	width: 100%;
}

.annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: default;
}

.annotation-canvas.zooming {
    cursor: zoom-in;
}

.konva-container {
	position: relative;
	overflow: hidden;
}

.konva-container img {
	display: block;
	max-width: 100%;
}

.konva-container canvas {
	position: absolute;
	top: 0;
	left: 0;
	pointer-events: none;
}

#single-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Error Container */
.error-container-wrapper {
    margin: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: var(--color-item-bg);
}

.error-header {
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.error-header h3 {
    font-size: var(--font-size-md);
    font-weight: 500;
    margin: 0;
    color: var(--color-error);
}

.toggle-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.toggle-button:hover {
    background-color: var(--color-primary-hover);
}

.error-container {
    padding: var(--spacing-md);
    background-color: rgba(241, 76, 76, 0.1);
    color: var(--color-error);
    white-space: pre-wrap;
    font-family: monospace;
    overflow: auto;
    transition: max-height 0.3s ease-in-out;
}

.error-container.collapsed {
    max-height: 100px;
}

.error-container.expanded {
    max-height: 300px;
}

/* Prominent Error - Used for tests with errors but no screenshots */
.prominent-error {
    padding: var(--spacing-lg);
    background-color: rgba(241, 76, 76, 0.2);
    border: none;
    border-top: 2px solid var(--color-error);
    border-bottom: 2px solid var(--color-error);
    color: var(--color-error);
    font-size: var(--font-size-md);
    font-weight: 500;
    max-height: none !important;
}

/* Media Queries */
@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .folder-selector, .filter-controls, .search-container {
        width: 100%;
    }
    
    .search-container {
        margin-left: 0;
    }
    
    #search-input {
        width: 100%;
    }
    
    select {
        min-width: 0;
        width: 100%;
    }
    
    .keyboard-shortcuts-minimal {
        display: none;
    }
}

/* Modal URLs Section */
.modal-urls-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--color-header);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}

.modal-urls-section .urls-label {
    color: var(--color-text-muted);
    white-space: nowrap;
}

.modal-urls-section .urls-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
}

.modal-urls-section .url-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: var(--color-item-bg);
    border-radius: 4px;
    padding: 2px 6px;
}

.modal-urls-section .url-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-link);
    text-decoration: none;
}

.modal-urls-section .url-link:hover {
    text-decoration: underline;
    color: var(--color-link-hover);
}

.modal-urls-section .url-link svg {
    flex-shrink: 0;
}

.modal-urls-section .copy-path-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.modal-urls-section .copy-path-button:hover {
    color: var(--color-link);
    background-color: var(--color-border);
}

.modal-urls-section .copy-path-button.copied {
    color: var(--color-success);
}

.modal-urls-section .copy-path-button.copied svg {
    transform: scale(1.1);
}

/* Copy Toast Notification */
.copy-toast {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: var(--font-size-sm);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Modal Bottom Bar */
.modal-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    border-top: 1px solid var(--color-border);
    background-color: var(--color-header);
}

/* Minimal Keyboard Shortcuts */
.keyboard-shortcuts-minimal {
    display: flex;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-item-bg);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.7rem;
    line-height: 1;
    padding: 3px 5px;
    margin: 0 1px;
}

.modal-status-icons {
    display: flex;
    gap: var(--spacing-sm);
    margin-right: auto;
}

/* Error Panel Icon */
.error-panel-icon {
    background: none;
    border: none;
    color: var(--color-error);
    cursor: pointer;
    padding: var(--spacing-xs);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.error-panel-icon:hover {
    opacity: 0.8;
    color: var(--color-error);
}

/* Test Selection Checkboxes */
.test-card .test-selection-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    transform: scale(1.3);
    cursor: pointer;
    background-color: var(--color-item-bg);
    border-radius: 3px;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.test-selection-checkbox:hover,
.test-selection-checkbox:checked {
    opacity: 1;
}

.selection-count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-right: 5px;
    font-weight: 500;
}

.add-to-group-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    margin-left: 10px;
    transition: background-color 0.2s;
}

.add-to-group-button:hover {
    background-color: var(--primary-color-hover);
}

.add-to-group-button:disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.add-to-group-button svg {
    width: 16px;
    height: 16px;
}

.copy-command-tooltip {
    position: relative;
    display: inline-block;
}

.copy-success {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-toast-bg, #333);
    color: white;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.copy-success.visible {
    opacity: 1;
}

/* Group Panel (Slide-in) */
.group-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background-color: var(--color-bg);
    border-left: 1px solid var(--color-border);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    z-index: 900;
    display: none; /* Hidden by default, shown via JS when active */
    flex-direction: column;
    overflow: hidden;
}

.group-panel.active {
    display: flex;
}

.selected-count {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-left: 10px;
}

.close-panel-button {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.close-panel-button:hover {
    opacity: 1;
}

.panel-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.panel-section {
    padding: 12px 16px;
    border-bottom: 1px solid #444;
}

.panel-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 8px;
}

.panel-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.go-to-reports-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 10px 15px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.go-to-reports-button:hover {
    background-color: var(--color-bg-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.go-to-reports-button svg {
    width: 18px;
    height: 18px;
}

.inline-form {
    display: flex;
    gap: 10px;
}

.inline-form input {
    flex-grow: 1;
    padding: 8px 12px;
    background-color: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text);
}

.inline-form input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.create-group-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

.create-group-button:hover {
    background-color: var(--color-primary-hover);
}

.create-group-button:disabled {
    background-color: var(--color-bg-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.existing-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: visible;
    margin-top: 10px;
}

.existing-group-item {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 8px;
}

.existing-group-item.active {
    border-color: var(--color-border);
    box-shadow: none;
}

.existing-group-item:hover {
    border-color: var(--color-border-hover, #ccc);
}

/* Only show blue border on focused group */
.existing-group-item.focused {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

/* Ensure header is positioned relatively for the indicator */
.existing-group-item .group-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Add visual indicator for clickable headers with better positioning */
.existing-group-item .group-header::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background-color: var(--color-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 3px;
}

.existing-group-item .group-header:hover::before {
    opacity: 0.5;
}

/* Focus indicator for test items */
.group-test-item {
    position: relative;
    transition: background-color 0.2s ease;
}

.group-test-item:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.group-test-item.focused {
    background-color: var(--color-bg-hover);
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
    color: var(--color-text);
    animation: none;
}

.group-test-item.focused-no-animation {
    background-color: var(--color-bg-hover);
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
    color: var(--color-text);
}

/* Remove the item blink animation */
@keyframes group-item-blink {
    0%, 100% {
        background-color: var(--color-bg-hover);
        border-left-color: var(--accent-color);
    }
}

/* Remove other animations for group test items */
.group-test-item {
    transition: background-color 0.2s ease;
}

.group-test-item.focused {
    animation: none !important;
}

.group-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.group-name {
    font-weight: 500;
}

.group-test-count {
    font-size: 12px;
    color: var(--color-text-muted);
}

.group-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-to-group-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}

.add-to-group-button:hover {
    background-color: var(--color-primary-hover);
}

.add-to-group-button:disabled {
    background-color: var(--color-bg-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.edit-group-button,
.delete-group-button,
.toggle-tests-button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.edit-group-button:hover,
.delete-group-button:hover,
.toggle-tests-button:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-text);
}

.delete-group-button:hover {
    color: var(--color-error);
}

.group-tests-list {
    max-height: none;
    overflow-y: visible;
    border-top: 1px solid var(--color-border);
}

.group-test-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
    transition: background-color 0.2s ease;
}

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

.group-test-item:hover {
    background-color: var(--color-bg-hover);
}

.group-test-item .test-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.group-test-item .remove-test-button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.6;
    line-height: 1;
}

.group-test-item:hover .remove-test-button {
    opacity: 1;
}

.group-test-item .remove-test-button:hover {
    color: var(--color-error);
}

.no-tests-message {
    padding: 10px 15px;
    color: var(--color-text-muted);
    font-style: italic;
    font-size: 13px;
}

.no-groups-message {
    color: var(--color-text-muted);
    font-style: italic;
    margin: 15px 0;
}

/* Toggle button styling for groups */
.toggle-tests-button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.toggle-tests-button:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-text);
}

.toggle-tests-button .expand-icon {
    transition: transform 0.2s ease;
}

.toggle-tests-button .expand-icon.rotated {
    transform: rotate(180deg);
}

/* Collapsed test list */
.group-tests-list.collapsed {
    display: none;
}

/* Focused test item */
.group-test-item.focused {
    background-color: var(--color-bg-hover);
    color: var(--color-text);
    font-weight: 500;
    position: relative;
    z-index: 10;
}

.group-test-item.focused .remove-test-button {
    color: rgba(255, 255, 255, 0.8);
}

.group-test-item.focused .remove-test-button:hover {
    color: white;
}

/* Context Menu */
.context-menu {
    position: absolute;
    min-width: 180px;
    background-color: var(--color-bg);
    box-shadow: var(--shadow-strong);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.15s ease-out;
}

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

.context-menu-title {
    padding: 10px 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-header-bg);
    color: var(--color-text);
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light, rgba(62, 62, 62, 0.5));
}

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

.context-menu-item:hover {
    background-color: var(--color-primary);
    color: white;
}

/* Checkmark styles */
.context-menu-checkmark {
    position: absolute;
    right: 15px;
    font-weight: bold;
    color: var(--color-success);
}

/* Card add to group button */
.card-add-to-group-button {
    position: absolute;
    top: 40px;
    right: 10px;
    z-index: 1;
    border-radius: 9999px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-add-to-group-button:hover {
    opacity: 1;
    background-color: var(--color-primary);
    color: white;
}

.card-add-to-group-button.group-count {
    margin-left: 10px;
}

.card-add-to-group-button.has-groups {
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.test-card:hover .card-add-to-group-button {
    opacity: 0.9;
}

/* Animation for focused item - 3 distinct blinks */
@keyframes focusItemPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 99, 156, 0.9);
        transform: scale(1);
    }
    10% {
        box-shadow: 0 0 0 10px rgba(14, 99, 156, 0);
        transform: scale(1.02);
    }
    30% {
        box-shadow: 0 0 0 0 rgba(14, 99, 156, 0);
        transform: scale(1);
    }
    
    33% {
        box-shadow: 0 0 0 0 rgba(14, 99, 156, 0.9);
        transform: scale(1);
    }
    43% {
        box-shadow: 0 0 0 10px rgba(14, 99, 156, 0);
        transform: scale(1.02);
    }
    63% {
        box-shadow: 0 0 0 0 rgba(14, 99, 156, 0);
        transform: scale(1);
    }
    
    66% {
        box-shadow: 0 0 0 0 rgba(14, 99, 156, 0.9);
        transform: scale(1);
    }
    76% {
        box-shadow: 0 0 0 10px rgba(14, 99, 156, 0);
        transform: scale(1.02);
    }
    96% {
        box-shadow: 0 0 0 0 rgba(14, 99, 156, 0);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 99, 156, 0);
        transform: scale(1);
    }
}

.group-test-item.focused {
    background-color: var(--color-bg-hover);
    color: var(--color-text);
    font-weight: 500;
    position: relative;
    animation: focusItemPulse 3s 1;
    z-index: 10; /* Ensure it's above other items when animating */
}

/* Focused but without animation - used for preparing the element before animation */
.group-test-item.focused-no-animation {
    background-color: var(--color-bg-hover);
    border-left: 3px solid var(--accent-color);
}

.group-test-item.focused-no-animation::before {
    content: none;
}

/* Ensure thumbnails never scale */
.test-thumbnail {
    transition: none;
    transform: none !important;
}

.test-card:hover .test-thumbnail {
    transform: none !important;
}

/* Define the missing keyframes animation */
@keyframes focusItemGlow {
    0% {
        background-color: var(--highlight-color-light);
        border-left-color: var(--accent-color);
    }
    50% {
        background-color: var(--highlight-color);
        border-left-color: var(--accent-color-bright);
    }
    100% {
        background-color: var(--highlight-color-light);
        border-left-color: var(--accent-color);
    }
}

/* Restore necessary text styles for group test items */
.group-test-item.focused .test-name {
    color: var(--color-text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.group-test-item.focused .remove-test-button {
    opacity: 1;
    color: var(--color-text-muted);
}

.group-test-item.focused .remove-test-button:hover {
    color: var(--color-error);
}

.group-test-item.focused-no-animation .test-name {
    color: var(--color-text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.group-test-item.focused-no-animation .remove-test-button {
    opacity: 1;
    color: var(--color-text-muted);
}

.group-test-item.focused-no-animation .remove-test-button:hover {
    color: var(--color-error);
}

/* Test card highlight animation */
.test-card.highlight {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color-light);
}

.test-card.highlight-animated {
    animation: highlight-blink 1s ease-in-out;
}

@keyframes highlight-blink {
    0% {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 2px var(--accent-color-light);
    }
    25% {
        border-color: var(--accent-color-bright);
        box-shadow: 0 0 0 3px var(--accent-color);
    }
    50% {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 2px var(--accent-color-light);
    }
    75% {
        border-color: var(--accent-color-bright);
        box-shadow: 0 0 0 3px var(--accent-color);
    }
    100% {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 2px var(--accent-color-light);
    }
}

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

.panel-header h2 {
    margin: 0;
    font-size: 18px;
}

/* Group badge for tests */
.group-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    background-color: rgba(33, 150, 243, 0.9);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    z-index: 2;
    pointer-events: none;
}

.group-badge svg {
    width: 12px;
    height: 12px;
}

.test-url {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    padding-left: 14px;
}

.test-url span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Group Dropdown in Modal */
.group-dropdown-container {
    position: relative;
    display: inline-block;
    margin-right: 15px;
}

.group-dropdown-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--primary-color, #4a6ee0);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.group-dropdown-button:hover {
    background-color: var(--primary-color-hover, #3a5dcf);
}

.group-dropdown-button svg {
    width: 16px;
    height: 16px;
}

.group-dropdown-content {
    position: absolute;
    bottom: 100%;
    left: 0;
    min-width: 250px;
    background-color: var(--color-bg, #fff);
    border: 1px solid var(--color-border, #ddd);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px;
    z-index: 10;
    margin-bottom: 10px;
    max-height: 300px;
    overflow-y: auto;
    transition: opacity 0.2s;
}

.group-dropdown-content.hidden {
    display: none;
}

.group-dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
}

.group-dropdown-item:hover {
    background-color: var(--color-bg-hover, #f5f5f5);
}

.group-dropdown-item input[type="checkbox"] {
    margin-right: 10px;
}

.group-dropdown-item label {
    cursor: pointer;
    font-size: 14px;
    flex-grow: 1;
    user-select: none;
}

.group-dropdown-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--color-border, #ddd);
}

.group-dropdown-actions button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.save-groups-button {
    background-color: var(--primary-color, #4a6ee0);
    color: white;
    border: none;
}

.save-groups-button:hover {
    background-color: var(--primary-color-hover, #3a5dcf);
}

.cancel-groups-button {
    background-color: var(--color-bg-secondary, #f0f0f0);
    color: var(--color-text, #333);
    border: 1px solid var(--color-border, #ddd);
}

.cancel-groups-button:hover {
    background-color: var(--color-bg-hover, #e5e5e5);
}

/* Group button in modal header */
.group-button {
    position: relative;
    background-color: #4a6ee0;
    border: none;
    color: white;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.group-button:hover {
    background-color: #3a5dcf;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.group-button svg {
    width: 22px;
    height: 22px;
}

/* Group dropdown menu */
.group-dropdown-menu {
    position: absolute;
    top: 100px;  /* Will be set by JS */
    left: 100px; /* Will be set by JS */
    background-color: var(--color-bg, white);
    border: 1px solid var(--color-border, #ddd);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    min-width: 250px;
    max-width: 350px;
    z-index: 1050;
    overflow: hidden;
}

.group-dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text, #333);
    background-color: var(--color-header-bg, #f5f5f5);
    border-bottom: 1px solid var(--color-border, #ddd);
}

.group-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--color-border-light, #eee);
}

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

.group-dropdown-item:hover {
    background-color: var(--color-bg-hover, #f5f5f5);
}

.group-dropdown-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.group-dropdown-item label {
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

/* Remove the animation class completely */
.test-selection-button.button-flash {
    animation: none;
}

@keyframes button-flash {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: var(--color-primary); color: white; }
    100% { transform: scale(1); }
}

/* Hide the report group header by default - it's only for report view */
.report-group-header {
    display: none;
}

/* Test file header in detail modal */
.detail-file-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 4px;
    margin-bottom: 12px;
    padding-left: 2px;
}

.detail-file-header svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.detail-file-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono, monospace);
}

/* File header bar in detail modal */
.detail-file-bar {
    
    background-color: var(--color-primary);
    color: white;
    padding: 8px 20px;
    font-size: 1.5rem;
    color: var(--color-text);
    font-weight: 600;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

/* Button flash animation for selection changes */
.button-flash {
    animation: button-flash 0.3s ease-in-out;
}

@keyframes button-flash {
    0% {
        transform: scale(1);
        box-shadow: none;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 8px var(--primary-color);
    }
    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

.zoom-indicator {
    font-size: 14px;
    color: #555;
    margin-left: 10px;
    display: inline-block;
}

/* Group-related UI for shape assignments */
.shape-group-controls {
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    width: 100%;
}

.group-assignment-title {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

#shape-group-selector {
    margin-bottom: var(--spacing-xs);
    width: 100%;
}

#assign-shape-to-group {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    width: 100%;
}

#assign-shape-to-group:hover {
    background-color: var(--color-primary-hover);
}

#assign-shape-to-group:disabled {
    background-color: var(--color-text-muted);
    cursor: not-allowed;
}

/* Group filter controls */
.group-filter-controls {
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    width: 100%;
}

.group-filter-title {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

#group-filter-selector {
    width: 100%;
}

/* Annotation controls container */
.annotation-controls {
    display: flex;
    align-items: stretch;
    gap: var(--spacing-sm);
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 10;
}

.annotation-mode-button{
  margin: 0 3px;
  padding: 4px;
  background: transparent;
  border: 1px solid #3e3e3e;
  border-radius: 4px;
  cursor: pointer;
  height: 22px;
  width: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #cccccc;
  box-sizing: border-box;

}
  
.annotation-mode-button.active {
    background-color: #0e639c;
    border-color: #1177bb;
    color: #ffffff;
}
.annotation-mode-button:hover:not(.active) {
    background-color: #3c3c3c;
}

/* Group Panel Layout Improvements */
.group-panel .panel-section {
    padding: 12px 16px;
    border-bottom: 1px solid #444;
}

/* Add extra padding to the sections above the tabs */
.group-panel > .panel-section {
    padding: 14px 16px;
}

/* Panel tabs styling */
.panel-tabs {
    display: flex;
    padding: 0 8px;
    margin-top: 6px;
    margin-bottom: 0;
    border-bottom: 1px solid #444;
}

.panel-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-right: 5px;
    opacity: 0.7;
    transition: opacity 0.2s, border-bottom 0.2s;
    border-bottom: 2px solid transparent;
}

.panel-tab:hover {
    opacity: 0.9;
}

.panel-tab.active {
    opacity: 1;
    border-bottom: 2px solid #4a90e2;
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Quick Add Grid */
.quick-add-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.quick-add-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: row;
    gap: 8px;
    padding-right: 5px;
}

/* Remove the column classes since we're using grid again */
.quick-add-column {
    display: none;
}

.quick-add-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 12px;
    min-height: 48px;
    background-color: #2a2a2a;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #e0e0e0;
    transition: background-color 0.2s, border-color 0.2s;
}

.quick-add-button span:first-child {
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    flex: 1;
    margin-right: 5px;
    word-break: break-word;
}

.quick-add-button .checkmark {
    color: #4caf50;
    font-weight: bold;
    flex-shrink: 0;
}

.quick-add-button:hover {
    background-color: #3c3c3c;
    border-color: #505050;
}

.quick-add-button.in-group {
    background-color: #1e3a5f;
    border-color: #2c5999;
}

/* Adjust the header spacing */
.group-panel .panel-header {
    padding: 14px 16px;
    background-color: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
}

/* Search highlight for group input */
#new-group-name.searching {
  background-color: rgba(66, 153, 225, 0.1);
  border-color: rgba(66, 153, 225, 0.5);
}

.group-search-hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

.copy-from-test-container {
  margin-bottom: 12px;
  width: 100%;
}

.copy-from-test-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.copy-from-test-controls {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.copy-from-test-search-container {
  flex: 1;
  position: relative;
}

.copy-from-test-input {
  width: 100%;
  padding: 6px 8px;
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.85rem;
  min-height: 32px;
  box-sizing: border-box;
}

.copy-from-test-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-bg-hover);
}

.copy-from-test-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--color-bg-disabled, #444);
}

.copy-from-test-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: -80px; /* Extend beyond input but stay within the panel bounds (380px - 32px padding - 80px button area) */
  width: auto; /* Let it size based on left/right constraints */
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 250px; /* Slightly taller for better visibility */
  overflow-y: auto;
  overflow-x: auto; /* Allow horizontal scrolling for long test names */
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Enhanced shadow for floating effect */
}

.copy-from-test-dropdown.hidden {
  display: none;
}

.copy-from-test-option {
  padding: 10px 14px; /* More padding for better readability in wider dropdown */
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
  white-space: nowrap; /* Prevent text wrapping */
  /* Removed overflow:hidden and text-overflow:ellipsis to allow full scrolling */
}

.copy-from-test-option:last-child {
  border-bottom: none;
}

.copy-from-test-option:hover {
  background-color: var(--color-bg-hover);
}

.copy-from-test-option.highlighted {
  background-color: var(--color-bg-hover);
}

.copy-from-test-option.selected {
  background-color: var(--color-primary);
  color: white;
}

.copy-from-test-option.is-previous {
  font-weight: 500;
  color: var(--color-primary);
  background-color: rgba(74, 144, 226, 0.1);
}

.copy-from-test-option.is-previous.highlighted {
  background-color: rgba(74, 144, 226, 0.2);
}

.copy-from-test-option.is-previous.selected {
  background-color: var(--color-primary);
  color: white;
}

.copy-from-test-option.immediately-previous {
  font-weight: 600;
  color: var(--color-primary);
  background-color: rgba(74, 144, 226, 0.15);
  border-left: 3px solid var(--color-primary);
  padding-left: 11px; /* Adjust for border (14px - 3px) */
}

.copy-from-test-option.immediately-previous.highlighted {
  background-color: rgba(74, 144, 226, 0.25);
}

.copy-from-test-option.immediately-previous.selected {
  background-color: var(--color-primary);
  color: white;
  border-left-color: white;
}

.copy-from-test-option.no-results {
  color: var(--color-text-muted);
  font-style: italic;
  cursor: default;
}

.copy-from-test-option.no-results:hover {
  background-color: transparent;
}

.copy-groups-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: var(--color-primary);
  color: white;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 32px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.copy-groups-button:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.copy-groups-button:disabled {
  background-color: var(--color-bg-disabled, #444);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.copy-groups-button svg {
  flex-shrink: 0;
}

/* Export Controls */
.export-controls {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: var(--color-primary);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.action-button:hover {
    background-color: var(--color-primary-hover);
}

.action-button svg {
    width: 16px;
    height: 16px;
}