voxmed / static /style.css
jay2219's picture
v1.0.0
ad8910e
Raw
History Blame Contribute Delete
13.8 kB
/* ======================================================================
Village Health Screener — V2 Design System
Card-based clinical layout with WhatsApp-green palette
====================================================================== */
/* --- Design Tokens --- */
:root {
--green-primary: #25D366;
--green-dark: #128C7E;
--green-light: #DCF8C6;
--clinical-white: #FFFFFF;
--off-white: #F0F2F5;
--text-primary: #111B21;
--text-secondary: #667781;
--border-color: #E9EDEF;
--severity-1: #4CAF50;
--severity-2: #8BC34A;
--severity-3: #FF9800;
--severity-4: #FF5722;
--severity-5: #F44336;
--shadow: rgba(0, 0, 0, 0.08);
}
/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
body, html {
margin: 0;
padding: 0;
font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, sans-serif;
background-color: var(--off-white);
color: var(--text-primary);
min-height: 100vh;
-webkit-font-smoothing: antialiased;
}
/* --- Header (Fixed Top Bar) --- */
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 56px;
background: var(--clinical-white);
border-bottom: 1px solid var(--border-color);
box-shadow: 0 1px 3px var(--shadow);
display: flex;
align-items: center;
padding: 0 16px;
gap: 10px;
z-index: 100;
}
.header-icon { flex-shrink: 0; }
.header h1 {
margin: 0;
font-size: 17px;
font-weight: 600;
color: var(--text-primary);
flex: 1;
}
/* --- Status Pill --- */
#status-pill {
display: inline-flex;
align-items: center;
gap: 5px;
border-radius: 12px;
padding: 4px 10px;
font-size: 12px;
font-weight: 500;
transition: all 0.3s ease;
}
#status-pill[data-state="connecting"] {
background: #F0F0F0;
color: #888;
}
#status-pill[data-state="connecting"] .status-dot {
width: 6px; height: 6px; border-radius: 50%;
background: #aaa;
display: inline-block;
}
#status-pill[data-state="ready"] {
background: var(--green-light);
color: var(--green-dark);
}
#status-pill[data-state="ready"] .status-dot {
width: 6px; height: 6px; border-radius: 50%;
background: var(--green-primary);
display: inline-block;
}
#status-pill[data-state="error"] {
background: #FFEBEE;
color: #D32F2F;
}
#status-pill[data-state="error"] .status-dot {
width: 6px; height: 6px; border-radius: 50%;
background: #F44336;
display: inline-block;
}
/* --- Main Content --- */
.main-content {
padding-top: 72px;
padding-bottom: 24px;
max-width: 860px;
margin: 0 auto;
padding-left: 16px;
padding-right: 16px;
}
/* --- Input Section Grid --- */
.input-section {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16px;
}
@media (max-width: 600px) {
.input-section {
grid-template-columns: 1fr;
}
}
/* --- Cards --- */
.card {
background: var(--clinical-white);
border-radius: 16px;
padding: 20px;
box-shadow: 0 2px 8px var(--shadow);
border: 1px solid var(--border-color);
}
.card-label {
font-size: 13px;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 6px;
}
/* --- Mic Button --- */
.mic-btn {
width: 72px;
height: 72px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 12px;
background: var(--green-primary);
border: none;
border-radius: 50%;
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease;
box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn:active { transform: scale(0.95); }
.mic-btn.recording {
background: #FF5252;
box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.5);
animation: pulse-recording 1.5s infinite;
}
@keyframes pulse-recording {
0% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.5); }
70% { box-shadow: 0 0 0 20px rgba(255, 82, 82, 0); }
100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}
/* --- Mic Status --- */
#mic-status {
text-align: center;
font-size: 13px;
color: var(--text-secondary);
margin-bottom: 12px;
}
/* --- Waveform Container --- */
#waveform-container {
width: 100%;
height: 80px;
margin-bottom: 12px;
border-radius: 8px;
background: var(--off-white);
overflow: hidden;
}
#waveform-canvas {
width: 100%;
height: 100%;
display: block;
}
/* --- Transcript Box --- */
.transcript-box {
display: none;
background: var(--off-white);
border-radius: 10px;
padding: 12px;
font-size: 14px;
line-height: 1.6;
font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
position: relative;
margin-top: 8px;
}
.transcript-box.visible { display: block; }
#transcript-text {
outline: none;
min-height: 24px;
}
#transcript-text:focus {
background: var(--clinical-white);
border-radius: 6px;
padding: 4px;
}
.edit-btn {
position: absolute;
top: 8px;
right: 8px;
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 4px;
border-radius: 4px;
}
.edit-btn:hover { background: var(--border-color); }
/* --- Camera --- */
.camera-placeholder {
border: 2px dashed var(--border-color);
border-radius: 12px;
height: 140px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
color: var(--text-secondary);
font-size: 13px;
cursor: pointer;
transition: border-color 0.2s;
}
.camera-placeholder:hover { border-color: var(--green-primary); }
#camera-preview,
#photo-preview {
width: 100%;
max-height: 180px;
object-fit: cover;
border-radius: 12px;
display: none;
}
#camera-preview.visible,
#photo-preview.visible { display: block; }
.camera-btn-row {
display: flex;
gap: 8px;
margin-top: 12px;
}
.camera-btn-row button {
flex: 1;
padding: 8px 12px;
border-radius: 8px;
border: 1px solid var(--border-color);
background: var(--clinical-white);
font-size: 13px;
cursor: pointer;
font-weight: 500;
font-family: inherit;
transition: background 0.2s;
}
.camera-btn-row button:hover { background: var(--green-light); }
.capture-btn {
width: 100%;
padding: 10px;
margin-top: 8px;
border-radius: 8px;
border: none;
background: var(--green-primary);
color: white;
font-size: 14px;
font-weight: 500;
cursor: pointer;
font-family: inherit;
}
.description-box {
display: none;
background: var(--off-white);
border-radius: 10px;
padding: 12px;
font-size: 13px;
line-height: 1.5;
color: var(--text-secondary);
margin-top: 12px;
}
.description-box.visible { display: block; }
/* --- Triage Button --- */
.triage-btn {
display: block;
margin: 20px auto 0;
width: 100%;
max-width: 320px;
padding: 14px 24px;
background: var(--green-dark);
color: white;
border: none;
border-radius: 12px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: background 0.2s, transform 0.1s;
}
.triage-btn:hover:not(:disabled) {
background: var(--green-primary);
transform: translateY(-1px);
}
.triage-btn:disabled {
background: var(--border-color);
color: var(--text-secondary);
cursor: not-allowed;
}
/* --- Output Section --- */
.output-section {
margin-top: 24px;
display: none;
}
.output-section.visible { display: block; }
/* --- Triage Card --- */
.triage-card {
background: var(--clinical-white);
border-radius: 16px;
padding: 24px;
box-shadow: 0 2px 12px var(--shadow);
margin-bottom: 16px;
border-left: 4px solid var(--border-color);
transition: border-color 0.3s;
}
.triage-card[data-severity="1"],
.triage-card[data-severity="2"] { border-left-color: var(--severity-1); }
.triage-card[data-severity="3"] { border-left-color: var(--severity-3); }
.triage-card[data-severity="4"] { border-left-color: var(--severity-4); }
.triage-card[data-severity="5"] { border-left-color: var(--severity-5); }
/* Triage Card Inner Styles */
.triage-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 16px;
}
.condition-name {
margin: 0;
font-size: 18px;
font-weight: 600;
line-height: 1.3;
flex: 1;
}
.severity-badge {
display: inline-block;
padding: 4px 10px;
border-radius: 8px;
font-size: 12px;
font-weight: 600;
color: white;
white-space: nowrap;
}
/* Severity Meter */
.meter-container { margin: 16px 0; }
.meter-label {
font-size: 12px;
font-weight: 500;
color: var(--text-secondary);
margin-bottom: 6px;
}
.severity-meter {
width: 100%;
height: 8px;
background: var(--border-color);
border-radius: 4px;
overflow: hidden;
}
.meter-fill {
height: 100%;
width: 0%;
border-radius: 4px;
transition: width 0.8s ease-out;
}
.severity-labels {
display: flex;
justify-content: space-between;
font-size: 11px;
color: var(--text-secondary);
margin-top: 4px;
}
/* Actions List */
.actions-section { margin: 16px 0; }
.actions-section h3 {
font-size: 14px;
font-weight: 600;
margin: 0 0 10px 0;
color: var(--text-primary);
}
.action-list {
list-style: none;
padding: 0;
margin: 0;
}
.action-list li {
padding: 8px 0;
border-bottom: 1px solid var(--border-color);
font-size: 14px;
line-height: 1.5;
display: flex;
align-items: flex-start;
gap: 8px;
opacity: 0;
transform: translateY(8px);
transition: opacity 0.3s ease, transform 0.3s ease;
}
.action-list li.visible {
opacity: 1;
transform: translateY(0);
}
.action-list li:last-child { border-bottom: none; }
.action-check {
flex-shrink: 0;
color: var(--severity-1);
margin-top: 2px;
}
/* Referral Banner */
.referral-banner {
background: #FFF3E0;
border: 1px solid #FFB74D;
border-radius: 10px;
padding: 12px 16px;
font-size: 14px;
display: flex;
gap: 10px;
align-items: flex-start;
margin: 16px 0;
}
.referral-text strong {
display: block;
margin-bottom: 4px;
color: #E65100;
}
.referral-text p {
margin: 0;
color: #BF360C;
font-size: 13px;
line-height: 1.5;
}
/* Followup & Confidence */
.followup-row,
.confidence-row {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
color: var(--text-secondary);
margin-top: 8px;
}
.confidence-low { color: var(--severity-5); font-weight: 600; }
.confidence-medium { color: var(--severity-3); font-weight: 600; }
.confidence-high { color: var(--severity-1); font-weight: 600; }
/* --- Audio Section --- */
.audio-section { margin-top: 16px; }
.audio-row {
display: flex;
gap: 12px;
}
@media (max-width: 600px) {
.audio-row { flex-direction: column; }
}
.audio-player {
flex: 1;
background: var(--off-white);
border-radius: 10px;
padding: 12px;
display: flex;
align-items: center;
gap: 10px;
}
.audio-player-label {
font-size: 12px;
font-weight: 500;
color: var(--text-secondary);
white-space: nowrap;
}
.play-btn {
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--green-primary);
border: none;
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: background 0.2s;
}
.play-btn:hover { background: var(--green-dark); }
.progress-bar {
flex: 1;
height: 4px;
background: var(--border-color);
border-radius: 2px;
cursor: pointer;
position: relative;
min-width: 40px;
}
.progress-fill {
height: 100%;
background: var(--green-primary);
border-radius: 2px;
width: 0%;
transition: width 0.1s linear;
}
.time-display {
font-size: 11px;
color: var(--text-secondary);
font-variant-numeric: tabular-nums;
min-width: 30px;
text-align: right;
}
.audio-player audio { display: none; }
/* --- Reset Button --- */
.reset-btn {
display: block;
margin: 16px auto 0;
padding: 10px 24px;
background: transparent;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 14px;
cursor: pointer;
font-family: inherit;
color: var(--text-secondary);
transition: background 0.2s;
}
.reset-btn:hover { background: var(--off-white); }
/* --- Footer --- */
.footer {
text-align: center;
padding: 24px 16px;
font-size: 12px;
color: var(--text-secondary);
line-height: 1.6;
border-top: 1px solid var(--border-color);
margin-top: 24px;
}
/* --- Loading Spinner --- */
.spinner {
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid var(--border-color);
border-top-color: var(--green-primary);
border-radius: 50%;
animation: spin 0.6s linear infinite;
vertical-align: middle;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* --- Loading Skeleton --- */
.skeleton-bar {
height: 14px;
background: linear-gradient(90deg, var(--border-color) 25%, var(--off-white) 50%, var(--border-color) 75%);
background-size: 200% 100%;
animation: shimmer 1.2s infinite;
border-radius: 6px;
margin-bottom: 10px;
}
.skeleton-bar:nth-child(2) { width: 80%; }
.skeleton-bar:nth-child(3) { width: 60%; }
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}