frontend_nyla/src/components/UiComponents/AddressAutocomplete/AddressAutocomplete.module.css

211 lines
4.2 KiB
CSS

.autocompleteContainer {
position: relative;
width: 100%;
}
.suggestionsWrapper {
position: absolute;
top: 100%;
left: 0;
right: 0;
margin-top: 4px;
z-index: 1000;
max-height: 300px;
overflow: hidden;
border-radius: 12px;
/* Glassmorphism effect */
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.3);
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.1),
0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}
/* Dark theme support */
[data-theme="dark"] .suggestionsWrapper {
background: rgba(30, 30, 30, 0.85);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.3),
0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.suggestionsList {
list-style: none;
margin: 0;
padding: 8px;
max-height: 300px;
overflow-y: auto;
overflow-x: hidden;
}
.suggestionItem {
padding: 12px 16px;
cursor: pointer;
border-radius: 8px;
transition: all 0.2s ease;
margin-bottom: 4px;
position: relative;
/* Subtle background for better visibility */
background: rgba(255, 255, 255, 0.5);
}
.suggestionItem:last-child {
margin-bottom: 0;
}
.suggestionItem:hover {
background: rgba(59, 130, 246, 0.1);
transform: translateX(2px);
}
.suggestionItemSelected {
background: rgba(59, 130, 246, 0.15) !important;
/* Glow effect for selected item */
box-shadow:
0 0 12px rgba(59, 130, 246, 0.4),
0 0 24px rgba(59, 130, 246, 0.2),
inset 0 0 8px rgba(59, 130, 246, 0.1);
border: 1px solid rgba(59, 130, 246, 0.3);
transform: translateX(4px);
}
/* Dark theme adjustments */
[data-theme="dark"] .suggestionItem {
background: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .suggestionItem:hover {
background: rgba(59, 130, 246, 0.2);
}
[data-theme="dark"] .suggestionItemSelected {
background: rgba(59, 130, 246, 0.25) !important;
box-shadow:
0 0 16px rgba(59, 130, 246, 0.5),
0 0 32px rgba(59, 130, 246, 0.3),
inset 0 0 12px rgba(59, 130, 246, 0.15);
border: 1px solid rgba(59, 130, 246, 0.4);
}
.suggestionText {
display: block;
color: var(--color-text, #111827);
font-size: 14px;
line-height: 1.5;
word-break: break-word;
}
[data-theme="dark"] .suggestionText {
color: var(--color-text, #f9fafb);
}
.highlight {
background: rgba(59, 130, 246, 0.2);
color: var(--color-primary, #3b82f6);
font-weight: 600;
padding: 0 2px;
border-radius: 2px;
}
[data-theme="dark"] .highlight {
background: rgba(59, 130, 246, 0.3);
color: #60a5fa;
}
.loadingText,
.noResultsText {
display: block;
padding: 12px 16px;
color: var(--color-text-secondary, #6b7280);
font-size: 14px;
text-align: center;
font-style: italic;
}
.errorText {
display: block;
padding: 12px 16px;
color: #ef4444;
font-size: 14px;
text-align: center;
font-weight: 500;
}
[data-theme="dark"] .loadingText,
[data-theme="dark"] .noResultsText {
color: var(--color-text-secondary, #9ca3af);
}
[data-theme="dark"] .errorText {
color: #f87171;
}
/* Scrollbar styling */
.suggestionsList::-webkit-scrollbar {
width: 8px;
}
.suggestionsList::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.05);
border-radius: 4px;
}
.suggestionsList::-webkit-scrollbar-thumb {
background: rgba(59, 130, 246, 0.3);
border-radius: 4px;
transition: background 0.2s;
}
.suggestionsList::-webkit-scrollbar-thumb:hover {
background: rgba(59, 130, 246, 0.5);
}
[data-theme="dark"] .suggestionsList::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .suggestionsList::-webkit-scrollbar-thumb {
background: rgba(59, 130, 246, 0.4);
}
[data-theme="dark"] .suggestionsList::-webkit-scrollbar-thumb:hover {
background: rgba(59, 130, 246, 0.6);
}
/* Responsive design */
@media (max-width: 640px) {
.suggestionsWrapper {
border-radius: 8px;
max-height: 250px;
}
.suggestionItem {
padding: 10px 12px;
}
.suggestionText {
font-size: 13px;
}
}
/* Animation for dropdown appearance */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.suggestionsWrapper {
animation: fadeIn 0.2s ease-out;
}