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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    padding: 20px;
}

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

.auth-modal {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.auth-modal h2 {
    color: #333;
    margin-bottom: 1rem;
}

.auth-modal p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.auth-btn {
    background-color: #0078d4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.auth-btn:hover {
    background-color: #106ebe;
}

/* Contact help section */
.auth-help {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.auth-help p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.contact-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-btn:hover {
    background-color: #5a6268;
}

/* Contact form styles */
.contact-form {
    padding: 20px;
}

.contact-form p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.contact-form .form-group {
    margin-bottom: 15px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.submit-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #218838;
}

.submit-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.cancel-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

/* User Controls Styles */
.user-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-icon {
    cursor: pointer;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #0078d4;
    color: white;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.user-avatar:hover {
    background-color: #106ebe;
}

.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    min-width: 200px;
    display: none;
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
}

.user-icon:hover .user-dropdown,
.user-dropdown:hover {
    display: block;
}

.user-dropdown #user-name {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.logout-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.logout-btn:hover {
    background-color: #c82333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header Section */
.header-section {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    margin-bottom: 8px;
    color: #333;
}

h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Warehouse Subtitle */
.warehouse-subtitle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin-top: 8px;
}

.warehouse-subtitle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.warehouse-subtitle:active {
    transform: translateY(0);
}

.warehouse-subtitle .warehouse-icon {
    font-size: 16px;
}

.warehouse-subtitle .warehouse-label {
    font-weight: 500;
    opacity: 0.9;
}

.warehouse-subtitle .warehouse-name-display {
    font-weight: 700;
    color: white;
}

.warehouse-subtitle .warehouse-change-hint {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 4px;
}

/* Warehouse Modal Styles */
.warehouse-modal .modal-content {
    max-width: 500px;
}

.warehouse-modal-content {
    text-align: center;
    padding: 40px 30px;
}

.warehouse-modal-header h2 {
    margin-bottom: 10px;
    color: #333;
    font-size: 28px;
}

.warehouse-modal-header p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

.warehouse-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.warehouse-option-btn {
    flex: 1;
    max-width: 180px;
    padding: 30px 20px;
    background-color: white;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.warehouse-option-btn:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.2);
}

.warehouse-option-btn:active {
    transform: translateY(-2px);
}

.warehouse-icon {
    font-size: 48px;
}

.warehouse-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.warehouse-modal-note {
    color: #999;
    font-size: 13px;
    margin-top: 20px;
}

/* User Dropdown Button Styles */
.dropdown-btn {
    width: 100%;
    padding: 12px 16px;
    background-color: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #e9ecef;
}

.dropdown-btn:hover {
    background-color: #f8f9fa;
}

.dropdown-btn .btn-icon {
    font-size: 16px;
}

.dropdown-btn .btn-text {
    font-weight: 500;
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background-color: transparent;
    color: #6c757d;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #f8f9fa;
}

/* Tab Content Styles */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

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

/* Section Styles */
.search-section, .upload-section {
    margin-bottom: 30px;
}

.section-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 30px 0;
}

/* Search Styles */
.search-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.search-container input[type="text"] {
    flex: 1;
    margin-bottom: 0;
}

/* Search button styling */
.search-button {
    padding: 10px 24px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.search-icon {
    font-size: 18px;
}

.search-text {
    font-size: 16px;
}

/* Search input group styling */
.search-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

#search {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-mode-select {
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
    cursor: pointer;
    min-width: 140px;
    transition: border-color 0.3s ease;
}

.search-mode-select:hover {
    border-color: #999;
}

.search-mode-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    #search,
    .search-mode-select,
    .search-button {
        width: 100%;
    }
    
    .search-button {
        justify-content: center;
    }
}

/* Searching state */
.search-button:disabled .search-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

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

.search-results {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.search-results-header {
    background-color: #e9ecef;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-results-header h3 {
    margin: 0;
}

.results-toggle-container {
    display: flex;
    align-items: center;
}

/* Toggle Switch Styles */
.toggle-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    margin-right: 15px;
}

.toggle-label input[type="checkbox"] {
    display: none; /* Hide the default checkbox */
}

/* The toggle switch track */
.toggle-label input[type="checkbox"] + span::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    margin-right: 8px;
    vertical-align: middle;
    transition: background-color 0.3s ease;
    position: relative;
}

/* The toggle switch knob */
.toggle-label input[type="checkbox"] + span::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    margin-left: 2px;
    margin-top: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked state - track */
.toggle-label input[type="checkbox"]:checked + span::before {
    background-color: #007bff;
}

/* Checked state - knob position */
.toggle-label input[type="checkbox"]:checked + span::after {
    transform: translateX(20px);
}

/* Hover effect */
.toggle-label:hover input[type="checkbox"] + span::before {
    background-color: #999;
}

.toggle-label:hover input[type="checkbox"]:checked + span::before {
    background-color: #0056b3;
}

/* Make the span relative for absolute positioning of the knob */
.toggle-label span {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Optional: Add some spacing between toggles */
.search-controls {
    align-items: center;
    margin-bottom: 15px;
    gap: 20px;
}

/* Sort button styling */
.sort-btn {
    margin-left: auto;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.sort-btn:hover {
    background-color: #e9ecef;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    gap: 15px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-content.detailed-view {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: stretch;
}

.result-main {
    flex: 1;
    display: flex;
    gap: 15px;
}

/* Status action buttons */
.status-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    padding: 0 10px;
    min-width: 120px;
}

.status-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    min-height: 48px; /* Mobile-friendly touch target */
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.status-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.status-btn:active {
    transform: translateY(0);
}

.status-btn-completed {
    background-color: #28a745;
    color: white;
}

.status-btn-completed:hover {
    background-color: #218838;
}

.status-btn-duplicate {
    background-color: #dc3545;
    color: white;
}

.status-btn-duplicate:hover {
    background-color: #c82333;
}

.status-btn-missing {
    background-color: #4035dc;
    color: white;
}

.status-btn-missing:hover {
    background-color: #8b23c8;
}

.status-icon {
    font-size: 20px;
    line-height: 1;
}

.status-text {
    font-size: 14px;
}

/* Compact buttons for table view */
.status-actions-compact {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.status-btn-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-btn-compact:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.status-btn-compact.status-btn-completed {
    background-color: #28a745;
    color: white;
}

.status-btn-compact.status-btn-duplicate {
    background-color: #dc3545;
    color: white;
}

.status-btn-clear {
    background-color: #17a2b8;
    color: white;
}

.status-btn-clear:hover {
    background-color: #138496;
}

.status-btn-compact.status-btn-clear {
    background-color: #17a2b8;
    color: white;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .result-content.detailed-view {
        flex-direction: column;
    }
    
    .result-main {
        flex-direction: column;
    }
    
    .status-actions {
        flex-direction: row;
        width: 100%;
        padding: 15px 0 5px 0;
        min-width: auto;
    }
    
    .status-btn {
        flex: 1;
        padding: 14px 16px;
    }
    
    .result-image {
        max-width: 100%;
        height: auto;
    }
}

/* Disabled state for buttons */
.status-btn:disabled,
.status-btn-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Add visual feedback for completed/duplicate items */
.result-item.completed-item .status-btn-completed,
.result-item.completed-item .status-btn-duplicate,
.result-item.completed-item .status-btn-missing {
    opacity: 0.6;
}

.result-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.result-details {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

.result-location {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.result-metadata {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 5px;
}

.result-timestamp {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
}

.result-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.result-data-table th,
.result-data-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
}

.result-data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.result-data-table tr:hover {
    background-color: #f5f5f5;
}

/* For the summary view table */
#results-list {
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .result-content.detailed-view {
        flex-direction: column;
    }
    
    .result-image {
        width: 100%;
        height: 200px;
    }
}

/* Simple View Styles */
.result-content.simple-view .result-details {
    padding: 12px 0;
}

.result-content.simple-view .result-location {
    font-size: 18px;
    margin-bottom: 4px;
}

.result-content.simple-view .result-metadata {
    font-size: 14px;
    color: #666;
}

.result-content.simple-view .result-data-table {
    display: none;
}

/* Detailed View Styles */
.result-content.detailed-view .result-data-table {
    display: table;
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
}

.result-data-table th,
.result-data-table td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.result-data-table th {
    font-weight: bold;
    background-color: #f8f9fa;
}

.no-results {
    padding: 30px;
    text-align: center;
    color: #666;
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.autocomplete-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background-color: #f8f9fa;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.suggestion-text {
    flex: 1;
    color: #333;
}

.suggestion-count {
    font-size: 12px;
    color: #666;
    background-color: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.autocomplete-loading {
    padding: 10px 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.autocomplete-no-results {
    padding: 10px 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.upload-options {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.option-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #4CAF50;
    background-color: white;
    color: #4CAF50;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.option-btn:hover {
    background-color: #4CAF50;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 5px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    height: 100%;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.camera-container {
    position: relative;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    height: 70%;
}

#camera-video {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
}

#camera-canvas {
    width: 100%;
    height: auto;
    max-height: 400px;
}

.camera-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    justify-content: center;
}

.camera-control-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    background-color: #007bff;
    color: white;
}

.camera-control-btn:hover {
    background-color: #0056b3;
}

.accept-btn {
    background-color: #28a745 !important;
}

.accept-btn:hover {
    background-color: #218838 !important;
}

.preview-container {
    margin-bottom: 20px;
    display: none;
}

.preview-container h3 {
    margin-bottom: 10px;
}

.image-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.image-preview {
    position: relative;
    height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview .source-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

.upload-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.upload-btn:hover {
    background-color: #45a049;
}

.upload-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.progress-container {
    margin-top: 20px;
    display: none;
    background-color: #f1f1f1;
    border-radius: 4px;
    position: relative;
    height: 30px;
}

.progress-bar {
    background-color: #4CAF50;
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width 0.3s;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: bold;
}

.status {
    margin-top: 20px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.uploaded-files {
    margin-top: 20px;
    display: none;
}

.uploaded-files h3 {
    margin-bottom: 10px;
}

.uploaded-files ul {
    list-style-type: none;
}

.uploaded-files li {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.uploaded-files li:last-child {
    border-bottom: none;
}

.uploaded-files a {
    color: #0066cc;
    text-decoration: none;
}

.uploaded-files a:hover {
    text-decoration: underline;
}

.result-image {
    max-height: 256px;
    max-width: 256px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 10px;
        margin: 10px;
    }

    .modal-content {
        width: 98%;
        margin: 1% auto;
    }
    
    .camera-controls {
        flex-direction: column;
    }
    
    .camera-control-btn {
        width: 100%;
    }
    
    .upload-options {
        flex-direction: column;
    }
    
    .search-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-btn, .clear-search-btn {
        width: 100%;
    }
}

.sort-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    transition: background-color 0.2s;
}

.sort-btn:hover {
    background-color: #0056b3;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* Summary view table specific styles */
.result-data-table.summary-table {
    width: 100%;
    margin: 0;
}

.result-data-table.summary-table th {
    background-color: #007bff;
    color: white;
    padding: 12px;
}

.result-data-table.summary-table td {
    padding: 10px;
}

.result-data-table.summary-table tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.result-data-table.summary-table tbody tr:hover {
    background-color: #e9ecef;
}

/* Container width fix */
#search-results {
    width: 100%;
    max-width: 1200px; /* Adjust this based on your layout */
    margin: 0 auto;
}

#results-list {
    width: 100%;
}

/* Image Lightbox Styles */
.image-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90vh;
    margin-top: 5vh;
    animation: zoomIn 0.3s;
    cursor: zoom-out;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #ff6b6b;
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-size: 14px;
}

/* Navigation buttons */
.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 24px;
    padding: 10px 15px;
    border: none;
    transition: background-color 0.3s;
    z-index: 10000;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Make result images clickable */
.result-image {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.result-image:hover {
    opacity: 0.8;
}

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 80vh;
        margin-top: 10vh;
    }
    
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        padding: 8px 12px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}

/* Loading state for images */
.lightbox-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.lightbox-loading::after {
    content: 'Loading...';
    color: white;
    font-size: 18px;
}

/* Search mode dropdown styles */
.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.search-mode-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

.search-mode-select:hover {
    border-color: #999;
}

.search-mode-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Search mode info tooltip */
.search-mode-info {
    display: inline-block;
    margin-left: 5px;
    color: #666;
    cursor: help;
}

.search-mode-tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-mode-select {
        width: 100%;
    }
    
    #search {
        width: 100%;
    }
}

/* Red X for duplicate button */
.status-icon-x {
    color: #ff4444;
    font-weight: bold;
    font-size: 22px;
}

.status-btn-duplicate .status-icon-x {
    color: white; /* White on colored background */
}

.status-btn-duplicate:hover .status-icon-x {
    color: #ffe6e6; /* Lighter on hover */
}

/* Ensure the duplicate button has good contrast */
.status-btn-duplicate {
    background-color: #dc3545; /* Bootstrap danger red */
    color: white;
}

.status-btn-duplicate:hover {
    background-color: #c82333;
}

.status-btn-missing {
    background-color: #4035dc;
    color: white;
}
.status-btn-missing:hover {
    background-color: #8b23c8;
}

.status-btn-compact.status-btn-duplicate {
    background-color: #dc3545;
    color: white;
}
/* Help button styling */
.help-btn {
    background: white;
    color: #007bff;
    border: 2px solid #007bff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
    transition: all 0.2s ease;
}

.help-btn:hover {
    background: #f8f9fa;
    border-color: #0056b3;
    color: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}