/**
 * File Search Styles for SecureFileLink Divi Module - Version 2
 */

/* Selected File Display Area */
.tls-selected-file-display {
    margin-top: 10px;
}

.tls-selected-file-info {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 12px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tls-selected-file-details {
    flex-grow: 1;
}

.tls-selected-file-title {
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.tls-selected-file-id {
    color: #666;
    font-size: 12px;
}

.tls-remove-selection {
    background: #d63638 !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    transition: background-color 0.2s ease !important;
}

.tls-remove-selection:hover {
    background: #b32d2e !important;
}

.tls-remove-selection:focus {
    outline: none !important;
    box-shadow: 0 0 3px rgba(214, 54, 56, 0.5) !important;
}

.tls-file-search-container {
    position: relative;
    z-index: 10000;
}

.tls-file-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 10001;
}

.tls-file-search-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tls-file-search-item:hover {
    background-color: #f8f9fa;
}

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

.tls-file-search-item strong {
    color: #333;
    font-weight: 600;
}

.tls-file-search-item small {
    color: #666;
    font-size: 0.85em;
}

.tls-file-search-no-results,
.tls-file-search-error {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.tls-file-search-error {
    color: #d63638;
}

/* Divi Builder specific adjustments */
.et_pb_modal_settings_container .tls-file-search-container {
    position: relative;
}

.et_pb_modal_settings_container .tls-file-search-dropdown {
    position: absolute;
    max-height: 200px;
    border: 1px solid #ddd;
    background: #ffffff;
    z-index: 999999;
}

/* Visual Builder adjustments */
.et-fb-modal .tls-file-search-dropdown {
    z-index: 1000000;
}

/* Ensure proper positioning in different contexts */
.et-pb-option-container {
    position: relative;
}

.et-pb-option-container .tls-file-search-container {
    width: 100%;
}

/* Scrollbar styling for dropdown */
.tls-file-search-dropdown::-webkit-scrollbar {
    width: 8px;
}

.tls-file-search-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tls-file-search-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.tls-file-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}