MedScope-Backend / static /css /alternativesStyle.css
ShadowGard3n's picture
Made responsive
ca1ea49
/* ===================================================================
1. GLOBAL VARIABLES & RESET
================================================================= */
: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;
--card-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
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: inherit;
transition: color 0.3s;
}
/* ===================================================================
2. HEADER & NAVIGATION (Responsive)
================================================================= */
header {
background-color: rgba(10, 25, 47, 0.95);
padding: 1rem 5%;
border-bottom: 1px solid var(--border-color);
position: sticky;
top: 0;
z-index: 1000;
backdrop-filter: blur(10px);
}
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;
}
nav a {
color: var(--text-normal);
font-weight: 500;
padding: 0.5rem 0;
font-size: 0.95rem;
}
nav a:hover, nav a.active {
color: var(--accent-primary);
border-bottom: 2px solid var(--accent-primary);
}
/* ===================================================================
3. HERO & SEARCH LAYOUT
================================================================= */
main {
max-width: 1100px;
margin: 2rem auto;
padding: 0 5%;
}
.hero {
background-color: var(--bg-medium-dark);
padding: 2.5rem;
border-radius: 12px;
box-shadow: var(--card-shadow);
text-align: center;
border: 1px solid var(--border-color);
}
.hero h1 {
color: var(--text-bright);
margin-bottom: 0.5rem;
font-size: 2rem;
}
.hero p {
color: var(--text-muted);
font-size: 1.1rem;
margin-bottom: 2rem;
}
/* --- The Search Container (Flexbox) --- */
.search-container {
display: flex;
align-items: stretch; /* Make both boxes same height */
justify-content: center;
margin-top: 2rem;
gap: 20px;
}
.search-form {
flex: 1;
background: var(--bg-light-dark);
padding: 2rem;
border-radius: 8px;
border: 1px solid var(--border-color);
display: flex;
flex-direction: column;
justify-content: center;
transition: transform 0.2s, box-shadow 0.2s;
}
.search-form:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
border-color: var(--accent-primary);
}
.search-form h2 {
font-size: 1.25rem;
color: var(--accent-primary);
margin-bottom: 1.5rem;
text-align: center;
}
.or-divider {
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
color: var(--text-bright);
font-size: 1.1rem;
background: var(--bg-deep-dark);
width: 50px;
height: 50px;
border-radius: 50%;
border: 2px solid var(--border-color);
align-self: center;
flex-shrink: 0; /* Prevent shrinking */
z-index: 2;
}
/* ===================================================================
4. FORM ELEMENTS
================================================================= */
.form-group {
margin-bottom: 1.5rem;
width: 100%;
position: relative;
}
input[type="text"] {
width: 100%;
padding: 1rem;
border: 1px solid var(--border-color);
border-radius: 6px;
font-size: 1rem;
background-color: var(--bg-medium-dark);
color: var(--text-bright);
transition: border-color 0.3s;
}
input:focus {
outline: none;
border-color: var(--accent-primary);
box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.1);
}
button[type="submit"] {
width: 100%;
padding: 1rem;
background-color: var(--accent-primary);
color: var(--accent-primary-text);
border: none;
border-radius: 6px;
font-size: 1rem;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s;
}
button[type="submit"]:hover {
background-color: var(--accent-primary-darker);
}
/* --- Autocomplete Dropdown --- */
.autocomplete-container {
position: relative;
}
.suggestions-box {
position: absolute;
top: 100%;
left: 0;
right: 0;
z-index: 100;
background-color: var(--bg-light-dark);
border: 1px solid var(--accent-primary);
border-top: none;
max-height: 200px;
overflow-y: auto;
border-radius: 0 0 6px 6px;
display: none;
box-shadow: 0 10px 20px rgba(0,0,0,0.5);
text-align: left;
}
.suggestion-item {
padding: 12px 15px;
cursor: pointer;
transition: background-color 0.2s;
color: var(--text-normal);
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);
}
/* ===================================================================
5. RESULTS SECTION
================================================================= */
#results-section {
margin-top: 3rem;
}
.hidden {
display: none !important;
}
#results-section h2 {
color: var(--text-bright);
margin-bottom: 1.5rem;
font-size: 1.5rem;
border-left: 4px solid var(--accent-primary);
padding-left: 1rem;
}
#results-section h3 {
color: var(--text-normal);
margin: 2rem 0 1rem 0;
}
#results-section h3 span {
color: var(--accent-primary);
font-style: italic;
}
/* Primary Drug Card */
#primary-drug-info {
margin-bottom: 3rem;
padding: 2rem;
background: var(--bg-medium-dark);
border-radius: 12px;
border: 1px solid var(--border-color);
}
.drug-card {
background-color: var(--bg-light-dark);
padding: 1.5rem;
border-radius: 8px;
box-shadow: var(--card-shadow);
border: 1px solid var(--border-color);
display: flex;
flex-direction: column;
transition: transform 0.2s;
}
.drug-card:hover {
border-color: var(--accent-primary);
}
.drug-card.primary {
border-left: 5px solid var(--accent-primary);
}
.drug-name {
font-size: 1.4rem;
font-weight: bold;
color: var(--accent-primary);
margin-bottom: 1rem;
display: block;
}
.drug-card strong {
color: var(--text-bright);
display: block;
margin-top: 0.5rem;
}
.side-effects-list {
margin-top: 0.5rem;
padding-left: 1.2rem;
color: var(--text-normal);
font-size: 0.95rem;
}
.side-effects-list li {
margin-bottom: 0.25rem;
}
/* Alternatives Grid */
.results-grid {
display: grid;
/* Responsive Grid Logic */
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1.5rem;
}
/* ===================================================================
6. RESPONSIVE MEDIA QUERIES
================================================================= */
/* Tablet & Mobile Navigation */
@media (max-width: 900px) {
header { padding: 1rem; }
nav {
flex-direction: column;
gap: 1rem;
}
nav ul {
flex-wrap: wrap;
justify-content: center;
width: 100%;
gap: 1rem;
}
}
/* Mobile Layout */
@media (max-width: 768px) {
.hero {
padding: 1.5rem;
}
.hero h1 { font-size: 1.75rem; }
/* Stack the search forms */
.search-container {
flex-direction: column;
gap: 1rem;
align-items: stretch;
}
.or-divider {
margin: 0.5rem auto; /* Center horizontally */
transform: scale(0.8); /* Slightly smaller on mobile */
}
.search-form {
width: 100%;
padding: 1.5rem;
}
/* Adjust Grid for smaller phones */
.results-grid {
grid-template-columns: 1fr; /* Single column on phones */
}
}
/* ===================================================================
7. FOOTER
================================================================= */
footer {
text-align: center;
padding: 2rem 5%;
margin-top: 4rem;
background-color: var(--bg-medium-dark);
color: var(--text-muted);
font-size: 0.9rem;
border-top: 1px solid var(--border-color);
}