/**
 * Fiber Optic Networks Manager - Interactive Mapping System - Search Module & UI Components (SEARCH ONLY)
 * 
 * @description CSS styles for the unified search module and related UI components
 * @version 2025.11.08
 * @author Savin Ionut Razvan
 * 
 * @license Copyright (c) 2025 Savin Ionut Razvan. All rights reserved.
 * 
 * Features:
 * - Unified search module styling
 * - Search panel and interface components
 * - File selector and mode toggle
 * - Search results and navigation
 * - No responsive breakpoints (moved to responsive.css)
 * - No core application styles (moved to main.css)
 */

/* ==========================================================================
   GROUP 1: SEARCH CONTAINER & BUTTON
   ========================================================================== */

/* Used in: js/unified-search-module.js - Search button container */
/* Purpose: Desktop search button positioning and alignment */
.unified-search-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1202;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Constrain container size to prevent overlap */
    width: 2.5rem; /* Same as button width */
    height: 2.5rem; /* Same as button height */
    max-width: 2.5rem;
    max-height: 2.5rem;
    overflow: visible;
}

/* Used in: js/unified-search-module.js - Search button */
/* Purpose: Main search button styling */
.unified-search-container .search-button {
    width: 2.5rem;
    height: 2.5rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.2);
    color: #f9fafb;
    outline: none;
    position: relative;
    z-index: 1203;
}

/* Used in: js/unified-search-module.js - Search button hover */
/* Purpose: Search button hover effect */
.unified-search-container .search-button:hover {
    background: #374151;
    border-color: #4b5563;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.3);
}

/* Used in: js/unified-search-module.js - Search button active */
/* Purpose: Search button active effect */
.unified-search-container .search-button:active {
    transform: translateY(0);
    background: #4b5563;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.2);
}

/* Used in: js/unified-search-module.js - Search button focus */
/* Purpose: Search button focus effect for accessibility */
.unified-search-container .search-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Used in: js/unified-search-module.js - Search button SVG */
/* Purpose: Search icon styling */
.unified-search-container .search-button svg {
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
    stroke: #f9fafb;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

/* Used in: js/unified-search-module.js - Search button SVG hover */
/* Purpose: Search icon hover effect */
.unified-search-container .search-button:hover svg {
    transform: scale(1.1);
}

/* ==========================================================================
   GROUP 2: SEARCH PANEL (DESKTOP)
   ========================================================================== */

/* Used in: js/unified-search-module.js - Search panel container */
/* Purpose: Desktop search panel styling */
.search-panel {
    position: absolute;
    top: 0.5rem;
    right: 0;
    width: 18rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1rem);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1203;
    overflow: visible;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    margin: 0; /* Ensure no margins to prevent duplicate appearance */
}

/* Used in: js/unified-search-module.js - Search panel when open */
/* Purpose: Search panel open state */
.unified-search-container.open .search-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Desktop-specific search panel positioning */
@media (min-width: 601px) {
    .search-panel {
        position: absolute !important;
        top: 0.1rem !important;
        right: 3rem !important;
        width: 20rem !important; /* slimmer panel */
        max-height: 85vh !important;
        border-radius: 0.75rem !important;
        transform: translateY(-1rem) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        margin: 0 !important; /* Ensure no margins to prevent duplicate appearance */
    }
    
    .unified-search-container.open .search-panel {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }
    
    /* Desktop search button positioning */
    .unified-search-container {
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        z-index: 1202 !important;
    }
    
    /* Desktop search button styling */
    .unified-search-container .search-button {
        width: 2.5rem !important;
        height: 2.5rem !important;
        background: #1f2937 !important;
        border: 1px solid #374151 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.2) !important;
        color: #f9fafb !important;
        outline: none !important;
        position: relative !important;
        z-index: 1203 !important;
    }
    
    /* Desktop search button hover */
    .unified-search-container .search-button:hover {
        background: #374151 !important;
        border-color: #4b5563 !important;
        transform: translateY(-0.125rem) !important;
        box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.3) !important;
    }
    
    /* Desktop search button active */
    .unified-search-container .search-button:active {
        transform: translateY(0) !important;
        background: #4b5563 !important;
        box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.2) !important;
    }
    
    /* Desktop search button SVG */
    .unified-search-container .search-button svg {
        width: 1.125rem !important;
        height: 1.125rem !important;
        fill: none !important;
        stroke: #f9fafb !important;
        stroke-width: 2 !important;
        transition: transform 0.2s ease !important;
    }
    
    /* Desktop search button SVG hover */
    .unified-search-container .search-button:hover svg {
        transform: scale(1.1) !important;
    }
    
    /* Desktop toggle buttons */
    .mode-toggle {
        background: #374151 !important;
        border: 1px solid #4b5563 !important;
        border-radius: 0.5rem !important;
        padding: 0.125rem !important; /* tighter */
        gap: 0.125rem !important; /* tighter */
        flex: 1 !important;
        max-width: 11rem !important; /* slimmer */
    }
    
    .mode-btn {
        flex: 1 !important;
        padding: 0.3rem 0.6rem !important; /* slimmer */
        background: transparent !important;
        border: none !important;
        border-radius: 0.375rem !important;
        color: #9ca3af !important;
        font-size: 0.72rem !important; /* smaller text */
        font-weight: 500 !important;
        line-height: 1.1 !important; /* avoid 2 rows */
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.25rem !important; /* tighter gap */
        position: relative !important;
        overflow: hidden !important;
        white-space: nowrap !important; /* keep one line */
        min-width: 0 !important;
    }
    
    .mode-btn::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: #1f2937 !important;
        border-radius: 0.375rem !important;
        opacity: 0 !important;
        transition: all 0.2s ease !important;
        z-index: -1 !important;
    }
    
    .mode-btn .mode-icon,
    .mode-btn .mode-text {
        position: relative !important;
        z-index: 2 !important;
    }
    
    .mode-btn:hover {
        color: #9ca3af !important;
    }
    
    .mode-btn:hover::before {
        opacity: 0.3 !important;
    }
    
    .mode-btn.active {
        color: #ffffff !important;
        font-weight: 600 !important;
    }
    
    .mode-btn.active::before {
        opacity: 1 !important;
        background: #3b82f6 !important;
    }
    
    .mode-btn.active:hover {
        color: #ffffff !important;
    }
    
    .mode-icon {
        font-size: 0.75rem !important;
        flex-shrink: 0 !important;
    }
    
    .mode-text {
        font-size: 0.6875rem !important;
        font-weight: inherit !important;
        white-space: nowrap !important;
    }
    
    /* Desktop controls row spacing */
    .controls-row {
        gap: 0.375rem !important; /* tighter */
        align-items: center !important;
    }
    
    /* Desktop file selector dropdown - optimized height */
    .search-panel .file-selector-dropdown,
    .unified-search-container .file-selector-dropdown {
        max-height: 28rem !important; /* Increased to see more files */
        margin: 0.5rem 1rem !important; /* Ensure margin is maintained */
    }
    
    /* Desktop file selector item - compact but visible */
    .search-panel .file-selector-item,
    .unified-search-container .file-selector-item {
        min-height: 2.75rem !important; /* Compact height to see more files */
        padding: 0.4rem 0.5rem !important; /* Reduced padding for compact design */
        margin: 0 !important; /* Remove margins */
        gap: 0.4rem !important; /* Compact gap */
        display: flex !important;
        align-items: center !important;
        border-bottom: 1px solid #374151 !important; /* Ensure border is maintained */
    }
    
    /* Desktop file selector item label - compact */
    .search-panel .file-selector-item label,
    .unified-search-container .file-selector-item label {
        gap: 0.1rem !important; /* Minimal gap between text elements */
        margin: 0 !important;
        padding: 0 !important;
        flex: 1 !important;
    }
    
    /* Desktop file selector item text - smaller fonts */
    .search-panel .file-selector-item .file-name,
    .unified-search-container .file-selector-item .file-name {
        font-size: 0.7rem !important; /* Smaller font */
        line-height: 1.15 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .search-panel .file-selector-item .file-info,
    .unified-search-container .file-selector-item .file-info {
        font-size: 0.6rem !important; /* Smaller font */
        line-height: 1.15 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .search-panel .file-selector-item .file-description,
    .unified-search-container .file-selector-item .file-description {
        font-size: 0.55rem !important; /* Smaller font */
        line-height: 1.15 !important;
        margin: 0 !important;
        margin-top: 0.1rem !important;
        padding: 0 !important;
    }
    
    /* Desktop file selector item checkbox - smaller */
    .search-panel .file-selector-item input[type="checkbox"],
    .unified-search-container .file-selector-item input[type="checkbox"] {
        width: 12px !important;
        height: 12px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
    
    /* Desktop select buttons - smaller and compact */
    .search-panel .select-buttons,
    .unified-search-container .select-buttons {
        padding: 0.3rem 0.5rem !important; /* Reduced padding */
        margin: 0 !important;
        margin-top: 0.25rem !important;
        gap: 0.3rem !important; /* Reduced gap */
        border-top: 1px solid #374151 !important;
    }
    
    .search-panel .select-all-btn,
    .search-panel .select-none-btn,
    .unified-search-container .select-all-btn,
    .unified-search-container .select-none-btn {
        padding: 0.3rem 0.5rem !important; /* Smaller buttons */
        font-size: 0.65rem !important; /* Smaller font */
        min-height: 1.4rem !important; /* Smaller height */
        border-radius: 0.375rem !important;
        margin: 0 !important;
    }

    /* Slimmer file selector button */
    .file-selector-btn {
        width: 1.75rem !important;
        height: 1.75rem !important;
        font-size: 0.625rem !important;
    }
    .file-selector-btn .file-count {
        font-size: 0.5rem !important;
        min-width: 0.8rem !important;
        height: 0.8rem !important;
        padding: 0.1rem 0.2rem !important;
    }
    
    /* Slimmer search header/input */
    .search-header {
        padding: 0.75rem 0.75rem 0.5rem 0.75rem !important;
    }
    .search-header h3 {
        font-size: 0.9rem !important;
    }
    .search-input-container input {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
}

/* ==========================================================================
   GROUP 3: SEARCH HEADER & CONTROLS
   ========================================================================== */

/* Used in: js/unified-search-module.js - Search header */
/* Purpose: Search panel header styling */
.search-header {
    padding: 1rem;
    border-bottom: 1px solid #374151;
    background: #111827;
    position: relative;
    border-radius: 0.75rem 0.75rem 0 0; /* Top rounded, bottom square */
    margin: 0; /* Ensure no margins to prevent duplicate appearance */
}

/* Used in: js/unified-search-module.js - Header top row */
/* Purpose: Header top row container for title and close button */
.header-top-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

/* Used in: js/unified-search-module.js - Close search button */
/* Purpose: Close search button styling */
.close-search-btn {
    width: .75rem;
    height: .75rem;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #f9fafb;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Used in: js/unified-search-module.js - Close search button hover */
/* Purpose: Close search button hover effect */
.close-search-btn:hover {
    background: #4b5563;
    transform: scale(1.0);
}

/* Used in: js/unified-search-module.js - Close search button active */
/* Purpose: Close search button active effect */
.close-search-btn:active {
    transform: scale(1.0);
}

/* Used in: js/unified-search-module.js - Controls row */
/* Purpose: Controls row container */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Used in: js/unified-search-module.js - Search header title */
/* Purpose: Search panel title styling */
.search-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #f9fafb;
    display: flex;
    align-items: center;
    gap: 0.325rem;
    position: relative;
}

/* Used in: js/unified-search-module.js - Search header title icon */
/* Purpose: Search title icon styling */
.search-header h3::before {
    content: "🔍";
    font-size: .875rem;
    opacity: 0.8;
}

/* ==========================================================================
   GROUP 4: MODE TOGGLE
   ========================================================================== */

/* Used in: js/unified-search-module.js - Mode toggle container */
/* Purpose: Search mode toggle container */
.mode-toggle {
    display: flex;
    background: #374151;
    border-radius: 0.5rem;
    padding: 0.1875rem;
    gap: 0.1875rem;
    flex: 1;
    max-width: 12.5rem;
}

/* Used in: js/unified-search-module.js - Mode button */
/* Purpose: Individual mode button styling */
.mode-btn {
    flex: 1;
    padding: 0.375rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: #9ca3af;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    position: relative;
    overflow: hidden;
}

/* Used in: js/unified-search-module.js - Mode button background */
/* Purpose: Mode button background effect */
.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1f2937;
    border-radius: 0.375rem;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: -1;
}

/* Used in: js/unified-search-module.js - Mode button content */
/* Purpose: Mode button content positioning */
.mode-btn .mode-icon,
.mode-btn .mode-text {
    position: relative;
    z-index: 2;
}

/* Used in: js/unified-search-module.js - Mode button hover */
/* Purpose: Mode button hover effect */
.mode-btn:hover {
    color: #9ca3af;
}

/* Used in: js/unified-search-module.js - Mode button hover background */
/* Purpose: Mode button hover background effect */
.mode-btn:hover::before {
    opacity: 0.3;
}

/* Used in: js/unified-search-module.js - Active mode button */
/* Purpose: Active mode button styling */
.mode-btn.active {
    color: #ffffff;
    font-weight: 600;
}

/* Used in: js/unified-search-module.js - Active mode button background */
/* Purpose: Active mode button background effect */
.mode-btn.active::before {
    opacity: 1;
    background: #3b82f6;
}

/* Used in: js/unified-search-module.js - Active mode button hover */
/* Purpose: Active mode button hover effect */
.mode-btn.active:hover {
    color: #ffffff;
}

/* Used in: js/unified-search-module.js - Mode icon */
/* Purpose: Mode button icon styling */
.mode-icon {
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Used in: js/unified-search-module.js - Mode text */
/* Purpose: Mode button text styling */
.mode-text {
    font-size: 0.6875rem;
    font-weight: inherit;
    white-space: nowrap;
}

/* ==========================================================================
   GROUP 5: FILE SELECTOR
   ========================================================================== */

/* Used in: js/unified-search-module.js - File selector button */
/* Purpose: File selector button styling */
.file-selector-btn {
    width: 2rem;
    height: 2rem;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #f9fafb;
    font-size: 0.75rem;
    position: relative;
    outline: none;
    flex-shrink: 0;
}

/* Used in: js/unified-search-module.js - File selector button background */
/* Purpose: File selector button background effect */
.file-selector-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
}

/* Used in: js/unified-search-module.js - File selector button hover */
/* Purpose: File selector button hover effect */
.file-selector-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.3);
}

/* Used in: js/unified-search-module.js - File selector button hover background */
/* Purpose: File selector button hover background effect */
.file-selector-btn:hover::before {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Used in: js/unified-search-module.js - Active file selector button */
/* Purpose: Active file selector button styling */
.file-selector-btn.active {
    background: #3b82f6;
    border-color: #2563eb;
    box-shadow: 0 0.25rem 0.75rem rgba(59, 130, 246, 0.3);
}

/* Used in: js/unified-search-module.js - Active file selector button background */
/* Purpose: Active file selector button background effect */
.file-selector-btn.active::before {
    opacity: 1;
    transform: translateY(-10%) scale(1.1);
}

/* Used in: js/unified-search-module.js - File selector button active */
/* Purpose: File selector button active effect */
.file-selector-btn:active {
    transform: translateY(0);
    background: #6b7280;
}

/* Used in: js/unified-search-module.js - File selector button content */
/* Purpose: File selector button content positioning */
.file-selector-btn .file-icon,
.file-selector-btn .file-count {
    position: relative;
    z-index: 1;
}

/* Used in: js/unified-search-module.js - File icon */
/* Purpose: File selector icon styling */
.file-selector-btn .file-icon {
    font-size: 0.875rem;
    flex-shrink: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Used in: js/unified-search-module.js - File count */
/* Purpose: File count badge styling */
.file-selector-btn .file-count {
    background: #ef4444;
    color: white;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 0.125rem 0.25rem;
    border-radius: 0.5rem;
    min-width: 0.875rem;
    height: 0.875rem;
    text-align: center;
    flex-shrink: 0;
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1f2937;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.2);
}

/* Used in: js/unified-search-module.js - File selector dropdown */
/* Purpose: File selector dropdown container */
.file-selector-dropdown {
    position: static;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.3);
    max-height: 24rem; /* Default for mobile - desktop will override */
    /* overflow-y: auto; */
    margin: 0.5rem 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: all 0.2s ease;
    /* Removed display: none; to allow JavaScript to control visibility */
}

/* Used in: js/unified-search-module.js - File selector dropdown scrollbar */
/* Purpose: File selector dropdown scrollbar styling */
.file-selector-dropdown::-webkit-scrollbar {
    width: 6px;
}

/* Used in: js/unified-search-module.js - File selector dropdown scrollbar track */
/* Purpose: File selector dropdown scrollbar track */
.file-selector-dropdown::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 3px;
}

/* Used in: js/unified-search-module.js - File selector dropdown scrollbar thumb */
/* Purpose: File selector dropdown scrollbar thumb */
.file-selector-dropdown::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

/* Used in: js/unified-search-module.js - File selector dropdown scrollbar thumb hover */
/* Purpose: File selector dropdown scrollbar thumb hover */
.file-selector-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Used in: js/unified-search-module.js - File selector item */
/* Purpose: Individual file selector item */
/* NOTE: Desktop styles override these in @media (min-width: 601px) */
.file-selector-item {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #374151;
}

.file-selector-item:hover {
    background: #374151;
}

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

/* Used in: js/unified-search-module.js - File selector item checkbox */
/* Purpose: File selector item checkbox styling */
.file-selector-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
}

/* Used in: js/unified-search-module.js - File selector item label */
/* Purpose: File selector item label styling */
.file-selector-item label {
    flex: 1;
    cursor: pointer;
    font-size: 0.75rem;
    color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* Used in: js/unified-search-module.js - File name */
/* Purpose: File name styling */
.file-name {
    font-weight: 500;
    color: #f9fafb;
    font-size: 0.75rem;
}

/* Used in: js/unified-search-module.js - File info */
/* Purpose: File info styling */
.file-info {
    font-size: 0.625rem;
    color: #9ca3af;
    font-weight: 400;
}

/* ==========================================================================
   GROUP 6: SEARCH INPUT
   ========================================================================== */

/* Used in: js/unified-search-module.js - Search input container */
/* Purpose: Search input container styling */
.search-input-container {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid #374151;
    background: #111827;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: visible; /* Allow browser autocomplete dropdown to show */
}

/* Form wrapper inside search input container - make it transparent */
.search-input-container form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    position: relative; /* For autocomplete dropdown positioning */
    overflow: visible; /* Allow browser autocomplete dropdown to show */
}

.search-input-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, #374151, transparent);
}

/* Used in: js/unified-search-module.js - Search input field */
/* Purpose: Search input field styling */
.search-input-container input {
    flex: 1;
    padding: 0.75rem 0.875rem;
    background: #1f2937;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: #f9fafb;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
    min-width: 0;
}

/* Custom styling for datalist autocomplete dropdown */
.search-input-container input::-webkit-calendar-picker-indicator {
    display: none;
}

/* Style the datalist dropdown */
.search-input-container datalist {
    font-size: 0.75rem;
    background: #1f2937;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: #f9fafb;
}

/* Custom suggestions dropdown styling */
.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 1rem;
    right: 1rem;
    background: #1f2937;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #f9fafb;
    cursor: pointer;
    border-bottom: 1px solid #374151;
    transition: background-color 0.2s ease;
}

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

.suggestion-item:hover {
    background: #374151;
}

.suggestion-item:active {
    background: #4b5563;
}

.search-input-container input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.125rem rgba(59, 130, 246, 0.25);
}

.search-input-container input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Used in: js/unified-search-module.js - Search button inside panel */
/* Purpose: Search button styling inside search panel */
.search-btn {
    width: 2rem;
    height: 2rem;
    background: #4b5563;
    border: 1px solid #6b7280;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    font-size: 0.875rem;
    outline: none;
    flex-shrink: 0;
    position: relative;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1rem;
    height: 1rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>') no-repeat center;
    background-size: contain;
}

.search-btn:hover {
    background: #6b7280;
    transform: scale(1.05);
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.3);
}

.search-btn:hover::before {
    transform: translate(-50%, -50%) scale(1.1);
}

.search-btn:active {
    transform: scale(0.95);
    background: #9ca3af;
}

/* ==========================================================================
   GROUP 7: SEARCH RESULTS
   ========================================================================== */

/* Used in: js/unified-search-module.js - Search results container */
/* Purpose: Search results container styling */
.search-results {
    flex: 1;
    overflow-y: auto;
    max-height: 25rem;
    padding: 0;
    margin: 0;
    list-style: none;
    background: #111827;
}

/* Used in: js/unified-search-module.js - Search results scrollbar */
/* Purpose: Search results scrollbar styling */
.search-results::-webkit-scrollbar {
    width: 0.375rem;
}

/* Used in: js/unified-search-module.js - Search results scrollbar track */
/* Purpose: Search results scrollbar track */
.search-results::-webkit-scrollbar-track {
    background: #374151;
}

/* Used in: js/unified-search-module.js - Search results scrollbar thumb */
/* Purpose: Search results scrollbar thumb */
.search-results::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 0.1875rem;
}

/* Used in: js/unified-search-module.js - Search results scrollbar thumb hover */
/* Purpose: Search results scrollbar thumb hover */
.search-results::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Used in: js/unified-search-module.js - Search result item */
/* Purpose: Individual search result item */
.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #374151;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Used in: js/unified-search-module.js - Search result item hover */
/* Purpose: Search result item hover effect */
.search-result-item:hover {
    background: #374151;
}

/* Used in: js/unified-search-module.js - Search result item last child */
/* Purpose: Last search result item styling */
.search-result-item:last-child {
    border-bottom: none;
}

/* Used in: js/unified-search-module.js - Result icon */
/* Purpose: Search result icon styling */
.result-icon {
    width: 2rem;
    height: 2rem;
    background: #3b82f6;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
    font-weight: 600;
}

/* Used in: js/unified-search-module.js - Result content */
/* Purpose: Search result content container */
.result-content {
    flex: 1;
    min-width: 0;
}

/* Used in: js/unified-search-module.js - Result title */
/* Purpose: Search result title styling */
.result-title {
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* Used in: js/unified-search-module.js - Result subtitle */
/* Purpose: Search result subtitle styling */
.result-subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* Used in: js/unified-search-module.js - Result type */
/* Purpose: Search result type badge */
.result-type {
    display: inline-block;
    padding: 2px 6px;
    background: #374151;
    color: #9ca3af;
    font-size: 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* Used in: js/unified-search-module.js - Result action */
/* Purpose: Search result action container */
.result-action {
    flex-shrink: 0;
}

/* Used in: js/unified-search-module.js - Locate button */
/* Purpose: Locate button styling */
.locate-btn {
    padding: 6px 10px;
    background: #10b981;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 1px;
}

/* Used in: js/unified-search-module.js - Locate button hover */
/* Purpose: Locate button hover effect */
.locate-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Used in: js/unified-search-module.js - Locate button active */
/* Purpose: Locate button active effect */
.locate-btn:active {
    transform: translateY(0);
    background: #047857;
}

/* Used in: js/unified-search-module.js - Navigate button */
/* Purpose: Navigate button styling - matches locate-btn size and appearance */
.navigate-btn {
    padding: 6px 10px;
    background: #3b82f6;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 1px;
}

/* Used in: js/unified-search-module.js - Navigate button hover */
/* Purpose: Navigate button hover effect */
.navigate-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Used in: js/unified-search-module.js - Navigate button active */
/* Purpose: Navigate button active effect */
.navigate-btn:active {
    transform: translateY(0);
    background: #1d4ed8;
}

/* Used in: js/unified-search-module.js - Result action container */
/* Purpose: Search result action container - ensures consistent button spacing */
.result-action {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

/* Used in: js/unified-search-module.js - Button group styling */
/* Purpose: Ensures locate and navigate buttons have consistent sizing and spacing */
.result-action .locate-btn,
.result-action .navigate-btn {
    min-width: 2.5rem;
    height: 2rem;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    opacity: 1;
    visibility: visible;
}

/* Used in: js/unified-search-module.js - Locate button specific styling */
/* Purpose: Locate button appears above navigate button */
.result-action .locate-btn {
    order: 1;
}

/* Used in: js/unified-search-module.js - Navigate button specific styling */
/* Purpose: Navigate button appears below locate button */
.result-action .navigate-btn {
    order: 2;
}

/* Used in: js/unified-search-module.js - Button hover effects */
/* Purpose: Consistent hover effects for both buttons */
.result-action .locate-btn:hover,
.result-action .navigate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Used in: js/unified-search-module.js - Button active effects */
/* Purpose: Consistent active effects for both buttons */
.result-action .locate-btn:active,
.result-action .navigate-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Used in: js/unified-search-module.js - Button focus states */
/* Purpose: Consistent focus states for accessibility */
.result-action .locate-btn:focus,
.result-action .navigate-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ==========================================================================
   SHARE MODAL STYLES
   ========================================================================== */

/* Used in: js/unified-search-module.js - Share modal button hover effects */
/* Purpose: Enhanced hover effects for share modal buttons */
.share-modal button {
    transition: all 0.2s ease !important;
}

.share-modal button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.share-modal button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Used in: js/unified-search-module.js - Share modal copy button hover */
/* Purpose: Copy button hover effect */
.share-modal button[onclick*="copyToClipboard"]:hover {
    background: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

/* Used in: js/unified-search-module.js - Share modal WhatsApp button hover */
/* Purpose: WhatsApp button hover effect */
.share-modal button[onclick*="wa.me"]:hover {
    background: #1ea952 !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4) !important;
}

/* Used in: js/unified-search-module.js - Share modal email button hover */
/* Purpose: Email button hover effect */
.share-modal button[onclick*="mailto"]:hover {
    background: #d32f2f !important;
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.4) !important;
}

/* Used in: js/unified-search-module.js - Share modal close button hover */
/* Purpose: Close button hover effect */
.share-modal button[onclick*="closest('.share-modal')"]:hover {
    background: #4b5563 !important;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4) !important;
}

/* Used in: js/unified-search-module.js - Share modal scrollbar styling */
/* Purpose: Custom scrollbar for share modal content area */
.share-modal div[style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 8px;
}

.share-modal div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

.share-modal div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
    border: 1px solid #4b5563;
}

.share-modal div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
    border-color: #6b7280;
}

/* Used in: js/unified-search-module.js - Share modal scrollbar for Firefox */
/* Purpose: Firefox scrollbar styling for share modal */
.share-modal div[style*="overflow-y: auto"] {
    scrollbar-width: thin;
    scrollbar-color: #6b7280 #374151;
}

/* ==========================================================================
   GROUP 8: SEARCH STATS & FEEDBACK
   ========================================================================== */

/* Used in: js/unified-search-module.js - Search stats */
/* Purpose: Search statistics and feedback container */
.search-stats {
    padding: 0.75rem 1rem;
    background: #111827;
    border-top: 1px solid #374151;
    font-size: 0.75rem;
    color: #9ca3af;
    position: relative;
    border-radius: 0 0 0.75rem 0.75rem; /* Bottom rounded, top square */
    margin: 0; /* Ensure no margins to prevent duplicate appearance */
}

/* Used in: js/unified-search-module.js - Search stats icon */
/* Purpose: Search stats icon styling */
.search-stats::before {
    content: "ℹ️";
    margin-right: 0.375rem;
    font-size: 0.625rem;
    opacity: 0.7;
}

/* Used in: js/unified-search-module.js - Stats text */
/* Purpose: Search stats text styling */
.stats-text {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 400;
    line-height: 1.4;
}

/* Used in: js/unified-search-module.js - Stats text ready state */
/* Purpose: Ready state stats text styling */
.stats-text.ready {
    color: #10b981;
}

/* Used in: js/unified-search-module.js - Stats text searching state */
/* Purpose: Searching state stats text styling */
.stats-text.searching {
    color: #3b82f6;
}

/* Used in: js/unified-search-module.js - Stats text results state */
/* Purpose: Results state stats text styling */
.stats-text.results {
    color: #f9fafb;
}

/* Used in: js/unified-search-module.js - Stats text no results state */
/* Purpose: No results state stats text styling */
.stats-text.no-results {
    color: #f59e0b;
}

/* Used in: js/unified-search-module.js - Stats text error state */
/* Purpose: Error state stats text styling */
.stats-text.error {
    color: #ef4444;
}

/* Used in: js/unified-search-module.js - No results container */
/* Purpose: No results message container */
.no-results {
    padding: 1.25rem;
    text-align: center;
    color: #9ca3af;
    background: #111827;
}

/* Used in: js/unified-search-module.js - No results icon */
/* Purpose: No results icon styling */
.no-results-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Used in: js/unified-search-module.js - No results text */
/* Purpose: No results text styling */
.no-results-text {
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ==========================================================================
   GROUP 9: LOADING INDICATOR
   ========================================================================== */

/* Used in: js/unified-search-module.js - Loading indicator */
/* Purpose: Loading indicator container */
.loading-indicator {
    padding: 1.25rem;
    text-align: center;
    color: #3b82f6;
    background: #111827;
}

/* Used in: js/unified-search-module.js - Spinner */
/* Purpose: Loading spinner animation */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 0.125rem solid #374151;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

/* ==========================================================================
   GROUP 10: TARGET MARKER
   ========================================================================== */

/* Used in: js/unified-search-module.js - Target marker */
/* Purpose: Target marker for search results */
.target-marker {
    background: #ef4444 !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px #ef4444 !important;
    animation: enhancedPulse 2s infinite !important;
}

/* ==========================================================================
   GROUP 11: ZONE MENU HEADER
   ========================================================================== */

/* Used in: index.html - Zone menu header */
/* Purpose: Zone menu header styling */
.zone-menu-header {
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

/* Used in: index.html - Zone menu header hover */
/* Purpose: Zone menu header hover effect */
.zone-menu-header:hover {
    color: #3b82f6;
}

/* Used in: index.html - Zone menu icon */
/* Purpose: Zone menu icon styling */
.zone-menu-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Used in: index.html - Zone menu header collapsed icon */
/* Purpose: Zone menu header collapsed icon effect */
.zone-menu-header.collapsed .zone-menu-icon {
    transform: rotate(-90deg);
}

/* Used in: index.html - Zone submenu */
/* Purpose: Zone submenu container */
.zone-submenu {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Used in: index.html - Zone submenu collapsed */
/* Purpose: Zone submenu collapsed state */
.zone-submenu.collapsed {
    max-height: 0;
}

/* ==========================================================================
   GROUP 12: ANIMATIONS
   ========================================================================== */

/* Used in: js/unified-search-module.js - Fade in animation */
/* Purpose: Fade in effect for search components */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Used in: js/unified-search-module.js - Slide in animation */
/* Purpose: Slide in effect for search panel */
@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Used in: js/unified-search-module.js - Enhanced pulse animation */
/* Purpose: Enhanced pulse effect for target marker */
@keyframes enhancedPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Used in: js/unified-search-module.js - Spin animation */
/* Purpose: Spin effect for loading spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Used in: js/unified-search-module.js - Select buttons container */
/* Purpose: Select buttons container styling */
.select-buttons {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #374151;
    background: #111827;
}

/* Used in: js/unified-search-module.js - Select all/none buttons */
/* Purpose: Select all and select none buttons */
.select-all-btn,
.select-none-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    color: #f9fafb;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.select-all-btn:hover,
.select-none-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
    transform: translateY(-0.125rem);
}

.select-all-btn:active,
.select-none-btn:active {
    transform: translateY(0);
    background: #6b7280;
}

/* ==========================================================================
   GROUP 13: SEARCH SUGGESTIONS
   ========================================================================== */

/* Used in: js/unified-search-module.js - Search suggestions container */
/* Purpose: Container for search suggestions */
.search-suggestions {
    padding: 1rem;
    background: #1f2937;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    border: 1px solid #374151;
}

/* Used in: js/unified-search-module.js - Search suggestions heading */
/* Purpose: Heading for search suggestions */
.search-suggestions h4 {
    color: #f9fafb;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Used in: js/unified-search-module.js - Search suggestions list */
/* Purpose: List of search suggestions */
.search-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
}

/* Used in: js/unified-search-module.js - Search suggestion items */
/* Purpose: Individual search suggestion items */
.search-suggestions li {
    color: #d1d5db;
    font-size: 0.75rem;
    padding: 0.25rem 0;
    border-left: 2px solid #4b5563;
    padding-left: 0.75rem;
    margin: 0.25rem 0;
    transition: all 0.2s ease;
}

.search-suggestions li:hover {
    color: #f9fafb;
    border-left-color: #3b82f6;
    background: #374151;
    padding-left: 1rem;
}

/* Used in: js/unified-search-module.js - Search suggestions note */
/* Purpose: Note about local search */
.search-suggestions p {
    color: #9ca3af;
    font-size: 0.6875rem;
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid #374151;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ==========================================================================
   CASE FILE SELECTOR STYLES
   ========================================================================== */

/* Case File Selector Container */
.case-selector {
    position: relative;
    z-index: 10;
}

.case-file-selector {
    margin-top: 8px;
    padding: 12px;
    background: #374151;
    border-radius: 6px;
    border: 1px solid #4b5563;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    width: 100%;
    overflow: visible;
    position: relative; /* ensure it flows under the Case checkbox */
}

/* File Search Container */
.file-search-container {
    margin-bottom: 12px;
}

.file-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #4b5563;
    border-radius: 4px;
    font-size: 13px;
    background: #1f2937;
    color: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.file-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.file-search-input::placeholder {
    color: #9ca3af;
}

/* File List */
.file-list {
    max-height: 180px;
    min-height: 60px;
    overflow-y: auto;
    border: 1px solid #4b5563;
    border-radius: 4px;
    background: #1f2937;
    margin-top: 8px;
    box-sizing: border-box;
}

.file-list::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* File Item */
.file-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #374151;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 32px;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.file-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    transform: scale(1);
    min-width: 14px;
    min-height: 14px;
    accent-color: #3b82f6;
}

.file-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.file-name {
    font-size: 13px;
    font-weight: 400;
    color: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Selected Files Section */
.selected-files {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #4b5563;
}

.selected-files h5 {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 8px;
    font-weight: 500;
}

.selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #f9fafb;
    transition: background-color 0.2s;
    min-height: 28px;
}

.selected-file-item:hover {
    background: #374151;
}

.remove-file-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 3px;
    transition: background-color 0.2s;
    font-weight: 500;
}

.remove-file-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Loading Indicator */
.loading-indicator {
    margin-top: 8px;
    padding: 8px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 4px;
    font-size: 13px;
    color: #f9fafb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-indicator::before {
    content: "⏳";
    font-size: 16px;
}

/* File Status Styles */
.file-status {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.loading-status {
    font-size: 12px;
    font-weight: normal;
    transition: all 0.3s ease-in-out;
    display: inline-block;
}

.loading-status.loading {
    color: #fbbf24;
    font-weight: 500;
    background-color: rgba(251, 191, 36, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.loading-status.complete {
    color: #10b981;
    font-weight: 600;
    background-color: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.loading-status.error {
    color: #ef4444;
}

.loading-status.queued {
    color: #6b7280;
    background-color: rgba(107, 114, 128, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Search Highlighting */
.file-name mark {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* Animation for file selector */
.case-file-selector {
    transition: opacity 0.2s ease-in-out;
}

/* Loading Spinner */
.loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #374151;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .case-file-selector {
        padding: 10px;
        width: 100%;
    }
    
    .file-list {
        max-height: 150px;
        min-height: 50px;
    }
    
    .file-name {
        font-size: 13px;
    }
    
    .file-search-input {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .selected-file-item {
        font-size: 12px;
        padding: 5px 7px;
    }
    
    .loading-indicator {
        font-size: 12px;
        padding: 6px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .case-file-selector {
        padding: 8px;
        width: 100%;
    }
    
    .file-list {
        max-height: 120px;
        min-height: 40px;
    }
    
    .file-name {
        font-size: 12px;
    }
    
    .file-search-input {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    .selected-file-item {
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .loading-indicator {
        font-size: 11px;
        padding: 5px;
    }
}

/* Search Stats Status */
.stats-text {
    transition: all 0.3s ease-in-out;
}

.stats-text.ready {
    color: #10b981;
    font-weight: 600;
}

.stats-text.loading {
    color: #fbbf24;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

.stats-text.error {
    color: #ef4444;
    font-weight: 500;
}

.stats-text.queued {
    color: #6b7280;
    font-weight: 500;
}

/* Unified Control Group Styling */
.unified-control-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 0 !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* Left Control Group Styling (aligned with hamburger) */
.left-control-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.1rem !important; /* Small gap between buttons */
    position: fixed !important;
    z-index: 1000 !important;
    top: 4rem !important; /* Position below hamburger button (1rem + 2.5rem + 0.5rem) */
    left: 0.5rem !important; /* Move 0.5rem left from hamburger button */
}

.measurement-controls-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.1rem !important; /* Small gap between measurement buttons */
    margin-bottom: 10px !important;
}

.zoom-controls-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
}

/* Measurement Control Styling - Left Alignment */
.leaflet-control-polylinemeasure {
    margin: 0 !important; /* Remove all margins */
    width: 2.5rem !important; /* Match hamburger button width */
    display: block !important;
    position: relative !important;
}

/* Force measurement layers to be BELOW all other map layers */
.leaflet-measure-path-layer,
.leaflet-pane .leaflet-measure-path-layer,
svg.leaflet-zoom-animated path[class*="polyline-measure"],
path.polyline-measure-resultline,
path.leaflet-interactive[stroke*="#"],
.leaflet-overlay-pane svg path[class*="measure"] {
    pointer-events: none !important; /* Don't block clicks */
    z-index: 1 !important; /* Lowest z-index */
}

/* Measurement circles should also not block */
circle[class*="polyline-measure"],
.leaflet-overlay-pane circle[fill] {
    pointer-events: none !important;
    z-index: 1 !important;
}

/* Measurement control buttons - match your theme with higher specificity */
.leaflet-control-polylinemeasure .leaflet-control-polylinemeasure-toggle,
.leaflet-control-polylinemeasure a,
.leaflet-control-polylinemeasure button {
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    text-align: center !important;
    border-radius: 4px !important;
    margin-bottom: 2px !important;
    display: block !important;
    border: 2px solid #374151 !important;
    background: #1f2937 !important;
    color: #f9fafb !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: bold !important;
}

/* Hover states for measurement controls */
.leaflet-control-polylinemeasure .leaflet-control-polylinemeasure-toggle:hover,
.leaflet-control-polylinemeasure a:hover,
.leaflet-control-polylinemeasure button:hover {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

/* Active states for measurement controls */
.leaflet-control-polylinemeasure .leaflet-control-polylinemeasure-toggle:active,
.leaflet-control-polylinemeasure a:active,
.leaflet-control-polylinemeasure button:active {
    background: #4b5563 !important;
    border-color: #6b7280 !important;
}

/* Focus states for accessibility */
.leaflet-control-polylinemeasure .leaflet-control-polylinemeasure-toggle:focus,
.leaflet-control-polylinemeasure a:focus,
.leaflet-control-polylinemeasure button:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* Target the actual plugin elements with higher specificity */
#polyline-measure-control,
#polyline-measure-control *,
.polyline-measure-clearControl,
#unitControlId,
.leaflet-control-polylinemeasure,
.leaflet-control-polylinemeasure * {
    background: #1f2937 !important;
    /* PERFORMANCE: CSS containment to optimize layout recalculation */
    contain: layout style paint;
    color: #f9fafb !important;
    border: 1px solid #374151 !important;
    border-radius: 4px !important;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.2) !important;
}

/* Override Leaflet's default button styling */
.leaflet-control-polylinemeasure .leaflet-bar a,
.leaflet-control-polylinemeasure .leaflet-bar button,
.leaflet-control-polylinemeasure a,
.leaflet-control-polylinemeasure button {
    background: #1f2937 !important;
    color: #f9fafb !important;
    border: 1px solid #374151 !important;
    border-radius: 4px !important;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.2) !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    line-height: 2.5rem !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: bold !important;
    display: block !important;
    margin-bottom: 0.1rem !important; /* Small gap between buttons */
}

/* Fix Leaflet touch controls border and margin */
.leaflet-touch .leaflet-control-layers, 
.leaflet-touch .leaflet-bar {
    border: 2px solid rgba(0,0,0,0.2) !important;
    background-clip: padding-box !important;
    margin-left: 0 !important; /* Remove left margin for measurement controls */
}

/* Override any left margin on measurement controls */
.left-control-group .leaflet-bar,
.left-control-group .leaflet-control,
.measurement-controls-container .leaflet-bar,
.measurement-controls-container .leaflet-control {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Ensure measurement buttons have spacing when in our container */
.measurement-controls-container .leaflet-bar a,
.measurement-controls-container .leaflet-bar button,
.measurement-controls-container a,
.measurement-controls-container button {
    display: block !important;
    margin-bottom: 0.2rem !important;
}

.measurement-controls-container .leaflet-bar a:last-child,
.measurement-controls-container .leaflet-bar button:last-child,
.measurement-controls-container a:last-child,
.measurement-controls-container button:last-child {
    margin-bottom: 0 !important;
}

/* Specific button styling */
#polyline-measure-control a,
#polyline-measure-control button,
.polyline-measure-clearControl a,
.polyline-measure-clearControl button,
#unitControlId a,
#unitControlId button {
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: bold !important;
    background: #1f2937 !important;
    color: #f9fafb !important;
    border: 2px solid #374151 !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.1) !important;
    margin-bottom: 2px !important;
    display: block !important;
    position: relative !important;
    z-index: 1001 !important;
}

/* Hover states matching hamburger button */
#polyline-measure-control a:hover,
#polyline-measure-control button:hover,
.polyline-measure-clearControl a:hover,
.polyline-measure-clearControl button:hover,
#unitControlId a:hover,
#unitControlId button:hover,
.leaflet-control-polylinemeasure a:hover,
.leaflet-control-polylinemeasure button:hover {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.3) !important;
    transform: translateY(-0.125rem) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Active states */
#polyline-measure-control a:active,
#polyline-measure-control button:active,
.polyline-measure-clearControl a:active,
.polyline-measure-clearControl button:active,
#unitControlId a:active,
#unitControlId button:active {
    background: #4b5563 !important;
    border-color: #6b7280 !important;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .leaflet-control-polylinemeasure {
        margin-bottom: 8px !important;
        width: 28px !important;
    }
    
    .leaflet-control-polylinemeasure .leaflet-control-polylinemeasure-toggle {
        width: 28px !important;
        height: 28px !important;
        line-height: 28px !important;
        font-size: 14px !important;
        margin-bottom: 1px !important;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .leaflet-control-polylinemeasure {
        margin-bottom: 9px !important;
        width: 29px !important;
    }
    
    .leaflet-control-polylinemeasure .leaflet-control-polylinemeasure-toggle {
        width: 29px !important;
        height: 29px !important;
        line-height: 29px !important;
    }
}

/* Desktop adjustments */
@media (min-width: 1025px) {
    .leaflet-control-polylinemeasure {
        margin-bottom: 10px !important;
        width: 30px !important;
    }
    
    .leaflet-control-polylinemeasure .leaflet-control-polylinemeasure-toggle {
        width: 30px !important;
        height: 30px !important;
        line-height: 30px !important;
    }
}