Spaces:
Sleeping
Sleeping
| /* =================================================================== | |
| Global Styles & Variables | |
| ================================================================= */ | |
| :root { | |
| --bg-deep-dark: #0a192f; | |
| --bg-medium-dark: #172a46; | |
| --bg-light-dark: #2c3e50; | |
| --text-bright: #ccd6f6; | |
| --text-normal: #bdc3c7; | |
| --text-muted: #8892b0; | |
| --accent-primary: #64ffda; | |
| --accent-primary-darker: #52d3b4; | |
| --accent-primary-text: #0a192f; | |
| --border-color: #304a6e; | |
| --shadow-color: rgba(0, 0, 0, 0.5); | |
| --card-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7); | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; | |
| } | |
| body { | |
| background-color: var(--bg-deep-dark); | |
| color: var(--text-normal); | |
| line-height: 1.6; | |
| font-size: 16px; | |
| background-image: linear-gradient(rgba(10, 25, 47, 0.9), rgba(10, 25, 47, 0.9)), | |
| url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><path fill="%23172a46" fill-opacity="0.3" d="M0 0 H40 V40 H0 Z M20 0 V40 M0 20 H40"></path></svg>'); | |
| background-size: 40px 40px; | |
| background-repeat: repeat; | |
| overflow-x: hidden; | |
| } | |
| a { | |
| text-decoration: none; | |
| color: var(--accent-primary); | |
| transition: color 0.3s; | |
| } | |
| a:hover { | |
| color: var(--accent-primary-darker); | |
| } | |
| /* =================================================================== | |
| Header & Navigation | |
| ================================================================= */ | |
| header { | |
| background-color: rgba(10, 25, 47, 0.95); | |
| box-shadow: 0 2px 8px rgba(0,0,0,0.3); | |
| padding: 1rem 5%; | |
| backdrop-filter: blur(10px); | |
| position: sticky; | |
| top: 0; | |
| z-index: 1000; | |
| border-bottom: 1px solid var(--border-color); | |
| } | |
| nav { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| flex-wrap: wrap; | |
| } | |
| .logo { | |
| font-size: 1.5rem; | |
| font-weight: bold; | |
| color: var(--accent-primary); | |
| letter-spacing: 1px; | |
| } | |
| nav ul { | |
| list-style: none; | |
| display: flex; | |
| gap: 1.5rem; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| nav a { | |
| color: var(--text-normal); | |
| font-weight: 500; | |
| transition: color 0.3s; | |
| padding: 0.5rem 0; | |
| display: inline-block; | |
| } | |
| nav a:hover, nav a.active { | |
| color: var(--accent-primary); | |
| border-bottom: 2px solid var(--accent-primary); | |
| } | |
| @media (max-width: 768px) { | |
| header { padding: 1rem; } | |
| nav { flex-direction: column; gap: 1rem; } | |
| nav ul { flex-wrap: wrap; justify-content: center; gap: 1rem; width: 100%; } | |
| nav a { font-size: 0.9rem; padding: 0.25rem 0; } | |
| } | |
| /* =================================================================== | |
| Main Content & Hero | |
| ================================================================= */ | |
| main { | |
| padding: 2rem 5%; | |
| max-width: 1000px; | |
| margin: 0 auto; | |
| width: 100%; | |
| } | |
| .hero { | |
| text-align: center; | |
| padding: 2.5rem; | |
| background-color: var(--bg-medium-dark); | |
| border-radius: 8px; | |
| box-shadow: var(--card-shadow); | |
| border: 1px solid var(--border-color); | |
| margin-bottom: 2rem; | |
| } | |
| .hero h1 { | |
| margin-bottom: 0.5rem; | |
| color: var(--text-bright); | |
| font-size: 2.5rem; | |
| font-weight: 600; | |
| line-height: 1.2; | |
| } | |
| .hero p { | |
| color: var(--text-muted); | |
| font-size: 1.1rem; | |
| margin-bottom: 2rem; | |
| } | |
| @media (max-width: 600px) { | |
| main { padding: 1rem; } | |
| .hero { padding: 1.5rem 1rem; } | |
| .hero h1 { font-size: 1.8rem; } | |
| .hero p { font-size: 1rem; margin-bottom: 1.5rem; } | |
| } | |
| /* =================================================================== | |
| Prediction Form | |
| ================================================================= */ | |
| #drug-search-form { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 1.5rem; | |
| text-align: left; | |
| } | |
| #drug-search-form fieldset { | |
| border: 1px solid var(--border-color); | |
| border-radius: 8px; | |
| padding: 1.5rem; | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); | |
| gap: 1.25rem; | |
| width: 100%; | |
| } | |
| #drug-search-form legend { | |
| color: var(--accent-primary); | |
| font-weight: 600; | |
| font-size: 1.1rem; | |
| padding: 0 0.5rem; | |
| margin-left: 0.5rem; | |
| } | |
| /* FIX: Changed selector to be direct child only. | |
| This prevents it from targeting the inner dropdown divs. */ | |
| #drug-search-form fieldset > div { | |
| display: flex; | |
| flex-direction: column; | |
| position: relative; | |
| } | |
| /* NEW FIX: Z-Index Stacking Context | |
| This ensures that when a user clicks a field (focus-within), | |
| that specific field's container rises above its siblings. | |
| This prevents the dropdown from being hidden behind the next row's inputs. */ | |
| #drug-search-form fieldset > div:focus-within { | |
| z-index: 100; | |
| } | |
| #drug-search-form label { | |
| font-size: 0.9rem; | |
| color: var(--text-normal); | |
| margin-bottom: 0.35rem; | |
| font-weight: 500; | |
| } | |
| #drug-search-form input, | |
| #drug-search-form select { | |
| width: 100%; | |
| padding: 0.75rem; | |
| border: 1px solid var(--border-color); | |
| border-radius: 4px; | |
| font-size: 1rem; | |
| background-color: var(--bg-light-dark); | |
| color: var(--text-bright); | |
| transition: border-color 0.3s, box-shadow 0.3s; | |
| appearance: none; | |
| } | |
| #drug-search-form select { | |
| background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ccd6f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); | |
| background-repeat: no-repeat; | |
| background-position: right 1rem center; | |
| background-size: 1em; | |
| padding-right: 2.5rem; | |
| } | |
| #drug-search-form input:focus, | |
| #drug-search-form select:focus { | |
| outline: none; | |
| border-color: var(--accent-primary); | |
| box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1); | |
| } | |
| #drug-search-form input::placeholder { | |
| color: var(--text-muted); | |
| } | |
| /* --- Autocomplete --- */ | |
| .autocomplete-container { | |
| position: relative; | |
| width: 100%; | |
| } | |
| /* Added ID to increase specificity over any generic rules */ | |
| #drug-search-form .suggestions-box { | |
| display: none; | |
| position: absolute; | |
| top: 100%; | |
| left: 0; | |
| right: 0; | |
| background-color: var(--bg-light-dark); | |
| border: 1px solid var(--accent-primary); | |
| border-top: none; | |
| border-radius: 0 0 4px 4px; | |
| max-height: 200px; | |
| overflow-y: auto; | |
| z-index: 9999; /* Increased z-index */ | |
| box-shadow: 0 5px 15px rgba(0,0,0,0.5); | |
| } | |
| .suggestion-item { | |
| padding: 12px 10px; | |
| color: var(--text-normal); | |
| cursor: pointer; | |
| transition: background-color 0.2s; | |
| border-bottom: 1px solid var(--border-color); | |
| } | |
| .suggestion-item:last-child { | |
| border-bottom: none; | |
| } | |
| .suggestion-item:hover { | |
| background-color: var(--bg-medium-dark); | |
| color: var(--accent-primary); | |
| } | |
| /* --- Submit Button --- */ | |
| button[type="submit"] { | |
| padding: 1rem 1.5rem; | |
| background-color: var(--accent-primary); | |
| color: var(--accent-primary-text); | |
| border: none; | |
| border-radius: 4px; | |
| font-size: 1.1rem; | |
| font-weight: bold; | |
| letter-spacing: 0.5px; | |
| cursor: pointer; | |
| transition: background-color 0.3s, transform 0.2s; | |
| width: 100%; | |
| max-width: 300px; | |
| align-self: center; | |
| margin-top: 1rem; | |
| } | |
| button[type="submit"]:hover { | |
| background-color: var(--accent-primary-darker); | |
| transform: translateY(-2px); | |
| box-shadow: 0 4px 10px rgba(100, 255, 218, 0.1); | |
| } | |
| @media (max-width: 480px) { | |
| #drug-search-form fieldset { | |
| grid-template-columns: 1fr; | |
| padding: 1rem; | |
| } | |
| } | |
| /* =================================================================== | |
| Results Section | |
| ================================================================= */ | |
| .results-container { | |
| display: grid; | |
| grid-template-columns: 1fr; | |
| gap: 2rem; | |
| margin-top: 2.5rem; | |
| padding: 2.5rem; | |
| background-color: var(--bg-medium-dark); | |
| border-radius: 8px; | |
| box-shadow: var(--card-shadow); | |
| border: 1px solid var(--border-color); | |
| } | |
| @media (min-width: 768px) { | |
| .results-container { | |
| grid-template-columns: 1fr 1fr; | |
| } | |
| } | |
| @media (max-width: 600px) { | |
| .results-container { | |
| padding: 1.5rem; | |
| margin-top: 1.5rem; | |
| } | |
| } | |
| .results-container.hidden { | |
| display: none; | |
| } | |
| .result-box h3 { | |
| color: var(--accent-primary); | |
| border-bottom: 1px solid var(--border-color); | |
| padding-bottom: 0.75rem; | |
| margin-bottom: 1rem; | |
| font-size: 1.25rem; | |
| } | |
| #risk-profile-list, | |
| #side-effects-list { | |
| list-style-type: none; | |
| padding-left: 0; | |
| color: var(--text-bright); | |
| } | |
| #risk-profile-list li, | |
| #side-effects-list li { | |
| margin-bottom: 0.75rem; | |
| position: relative; | |
| padding-left: 1.5rem; | |
| line-height: 1.5; | |
| } | |
| #risk-profile-list li::before, | |
| #side-effects-list li::before { | |
| content: '»'; | |
| position: absolute; | |
| left: 0; | |
| color: var(--accent-primary); | |
| font-weight: bold; | |
| top: -2px; | |
| } | |
| /* =================================================================== | |
| Footer | |
| ================================================================= */ | |
| footer { | |
| text-align: center; | |
| padding: 2rem 5%; | |
| margin-top: 3rem; | |
| background-color: var(--bg-medium-dark); | |
| color: var(--text-muted); | |
| font-size: 0.9rem; | |
| border-top: 1px solid var(--border-color); | |
| } |