sw-fe/src/styles/searchBar.css

161 lines
3.8 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:root {
--sw-search-bg-dark: rgba(6, 12, 30, 0.96);
--sw-search-bg-light: rgba(255, 255, 255, 0.96);
--sw-search-text-dark: #f9fafb;
--sw-search-text-light: #111827;
--sw-search-placeholder-dark: #6b7280;
--sw-search-placeholder-light: #9ca3af;
--sw-search-ring: rgba(96, 165, 250, 0.65);
}
/* Conteneur de la barre de recherche au-dessus de la map */
.sw-search-bar {
position: absolute;
top: 96px;
left: 50%;
transform: translateX(-50%);
z-index: 50;
width: min(75vw, 520px); /* <<< 75% de lécran max 520px */
}
/* Pour les grands écrans on garde le même comportement */
@media (min-width: 1024px) {
.sw-search-bar {
width: min(75vw, 520px);
}
}
.sw-search-inner {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.55rem 1.1rem;
border-radius: 999px;
border: 1px solid rgba(148, 163, 184, 0.25);
box-shadow:
0 18px 45px rgba(0, 0, 0, 0.75),
0 0 0 1px rgba(15, 23, 42, 0.9);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
}
/* Thèmes : dark + blue = texte clair, light = texte foncé */
html[data-theme="dark"] .sw-search-inner,
html[data-theme="blue"] .sw-search-inner {
background: var(--sw-search-bg-dark);
color: var(--sw-search-text-dark);
}
html[data-theme="light"] .sw-search-inner {
background: var(--sw-search-bg-light);
color: var(--sw-search-text-light);
}
/* Input */
.sw-search-input {
flex: 1 1 auto;
min-width: 0;
border: none;
outline: none;
background: transparent;
font-size: 0.95rem;
}
/* Couleurs du texte dans linput suivant le thème */
html[data-theme="dark"] .sw-search-input,
html[data-theme="blue"] .sw-search-input {
color: var(--sw-search-text-dark);
}
html[data-theme="light"] .sw-search-input {
color: var(--sw-search-text-light);
}
/* Placeholder suivant le thème */
html[data-theme="dark"] .sw-search-input::placeholder,
html[data-theme="blue"] .sw-search-input::placeholder {
color: var(--sw-search-placeholder-dark);
}
html[data-theme="light"] .sw-search-input::placeholder {
color: var(--sw-search-placeholder-light);
}
/* Petit glow au focus */
.sw-search-inner:focus-within {
box-shadow:
0 18px 45px rgba(0, 0, 0, 0.85),
0 0 0 1px var(--sw-search-ring),
0 0 0 6px rgba(37, 99, 235, 0.35);
}
/* Icône loupe */
.sw-search-icon {
flex: 0 0 auto;
font-size: 0.95rem;
opacity: 0.8;
}
/* Résultats (dropdown) */
.sw-search-results {
margin-top: 0.45rem;
border-radius: 1rem;
overflow: hidden;
max-height: 360px;
overscroll-behavior: contain;
box-shadow:
0 18px 45px rgba(0, 0, 0, 0.85),
0 0 0 1px rgba(15, 23, 42, 0.9);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
}
/* Couleurs du dropdown par thème */
html[data-theme="dark"] .sw-search-results,
html[data-theme="blue"] .sw-search-results {
background: rgba(6, 12, 30, 0.98);
color: var(--sw-search-text-dark);
}
html[data-theme="light"] .sw-search-results {
background: rgba(255, 255, 255, 0.98);
color: var(--sw-search-text-light);
}
.sw-search-result-item {
padding: 0.65rem 0.9rem;
font-size: 0.9rem;
cursor: pointer;
display: flex;
flex-direction: column;
gap: 0.15rem;
}
/* Texte des résultats suivant le thème */
html[data-theme="dark"] .sw-search-result-item-title,
html[data-theme="blue"] .sw-search-result-item-title {
color: var(--sw-search-text-dark);
}
html[data-theme="light"] .sw-search-result-item-title {
color: var(--sw-search-text-light);
}
.sw-search-result-item-sub {
font-size: 0.78rem;
opacity: 0.8;
}
/* Hover/active suivant le thème */
html[data-theme="dark"] .sw-search-result-item:hover,
html[data-theme="blue"] .sw-search-result-item:hover {
background: rgba(15, 23, 42, 0.9);
}
html[data-theme="light"] .sw-search-result-item:hover {
background: rgba(243, 244, 246, 1);
}