﻿/* #region Autocomplete */

    .autocomplete-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

    .autocomplete-dropdown.show {
        display: block;
    }

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

    .autocomplete-item:last-child {
        border-bottom: none;
    }

    .autocomplete-item:hover,
    .autocomplete-item.active {
        background-color: #f8f9fa;
    }

.autocomplete-item-icon {
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .autocomplete-item-icon img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .autocomplete-item-icon.default-icon {
        color: #6c757d;
        font-size: 18px;
    }

.autocomplete-item-content {
    flex: 1;
    min-width: 0;
}

.autocomplete-item-text {
    font-size: 14px;
    color: #212529;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-item-source {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.autocomplete-item-badge {
    margin-left: 8px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-google {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-persthing {
    background-color: #f3e5f5;
    color: #7b1fa2;
}
/* Loading State */
.autocomplete-loading {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

    .autocomplete-loading::after {
        content: '...';
        animation: dots 1.5s steps(4, end) infinite;
    }

@keyframes dots {
    0%, 20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%, 100% {
        content: '...';
    }
}
/* No Results State */
.autocomplete-no-results {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}
/* Selected Result Display */
#selectedResult .card {
    border-left: 4px solid #667eea;
}

#selectedResult .result-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    margin-right: 16px;
}

    #selectedResult .result-icon img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
/* Form Control Enhancement */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating > label {
    color: #6c757d;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}
/* Scrollbar Styling */
.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

    .autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
        background: #868e96;
    }

/*#endregion */

/* #region Dropdown */

:root {
    --combo-border: #ced4da;
    --combo-focus: #86b7fe;
    --combo-shadow: rgba(13, 110, 253, 0.18);
    --combo-menu-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.08);
}

body {
    min-height: 100vh;
}

.combo-wrapper {
    position: relative;
}

.combo-box {
    position: relative;
}

.combo-input {
    padding-right: 3.25rem !important;
    cursor: text;
}

.combo-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 3rem;
    height: 100%;
    border: 0;
    background: transparent;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

    .combo-toggle:focus-visible {
        outline: none;
        box-shadow: inset 0 0 0 2px var(--combo-focus);
        border-radius: 0.375rem;
    }

.combo-arrow {
    width: 0.7rem;
    height: 0.7rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.combo-box.is-open .combo-arrow {
    transform: rotate(-135deg) translateY(-1px);
}

.combo-box.is-open .combo-input,
.combo-input:focus {
    border-color: var(--combo-focus);
    box-shadow: 0 0 0 0.25rem var(--combo-shadow);
}

.combo-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    display: none;
    max-height: 15rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.75rem;
    box-shadow: var(--combo-menu-shadow);
    padding: 0.4rem;
    z-index: 1055;
}

    .combo-menu.is-visible {
        display: block;
    }

    .combo-menu.open-upward {
        top: auto;
        bottom: calc(100% + 0.45rem);
    }

.combo-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 0.5rem;
    padding: 0.7rem 0.85rem;
    color: #212529;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .combo-item:hover,
    .combo-item:focus-visible,
    .combo-item.is-active {
        background: #e9f2ff;
        color: #0d6efd;
        outline: none;
    }

    .combo-item.is-hidden {
        display: none;
    }

.meta-output {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.9rem;
    font-size: 0.9rem;
    min-height: 7rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.event-output {
    min-height: 8.5rem;
}

/*#endregion */