/**
 * PCT Integrations - Autocomplete Styles
 * Add this to your frontend.css or create integrations.css
 */

/* Autocomplete Container */
.pct-autocomplete-container {
    position: relative;
}

.pct-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 4px;
    display: none;
}

/* Autocomplete Items */
.pct-autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.pct-autocomplete-item:last-child {
    border-bottom: none;
}

.pct-autocomplete-item:hover {
    background-color: #f8f9fa;
}

.pct-autocomplete-item:active {
    background-color: #e9ecef;
}

/* Company Title */
.pct-autocomplete-title {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 4px;
}

/* Meta Information */
.pct-autocomplete-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.pct-company-number {
    font-family: monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

.pct-company-status {
    text-transform: capitalize;
}

.pct-company-status::before {
    content: '•';
    margin-right: 6px;
    color: #28a745;
}

/* Address */
.pct-autocomplete-address {
    font-size: 12px;
    color: #868e96;
    line-height: 1.4;
}

/* Loading State */
.pct-autocomplete-loading {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

.pct-autocomplete-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: pct-spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes pct-spin {
    to { transform: rotate(360deg); }
}

/* Error/Empty States */
.pct-autocomplete-error,
.pct-autocomplete-empty {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

.pct-autocomplete-error {
    color: #dc3545;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pct-autocomplete-results {
        max-height: 250px;
    }
    
    .pct-autocomplete-item {
        padding: 10px 12px;
    }
    
    .pct-autocomplete-title {
        font-size: 13px;
    }
    
    .pct-autocomplete-meta,
    .pct-autocomplete-address {
        font-size: 11px;
    }
}

/* Input field with integration active */
input[data-integration]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}