Crime-Detect / static /style.css
Noumankhan2005's picture
Deploying optimized Flask app with TFLite and modular JS
57b27d0 verified
:root {
/* Color Palette */
--bg-dark: #1a1a2e;
--text-light: #e0e0e0;
--text-inactive: #b0b0d0;
--text-highlight: #c9c9f0;
--text-white: #ffffff;
--container-bg: rgba(45, 45, 70, 0.4);
--navbar-bg: rgba(60, 60, 90, 0.5);
--card-bg: rgba(60, 60, 90, 0.5);
--chart-bg: rgba(40, 40, 60, 0.7);
--hover-bg: rgba(90, 90, 120, 0.3);
--active-gradient: linear-gradient(135deg, rgba(80, 80, 150, 0.7), rgba(120, 120, 200, 0.7));
--border-color-translucent: rgba(255, 255, 255, 0.18);
--border-color-light: rgba(255, 255, 255, 0.1);
--border-color-active: rgba(255, 255, 255, 0.3);
--shadow-color-dark: rgba(0, 0, 0, 0.37);
--shadow-color-medium: rgba(0, 0, 0, 0.2);
--shadow-color-light: rgba(0, 0, 0, 0.25);
--shadow-color-inset: rgba(0, 0, 0, 0.5);
--glow-color: rgba(100, 100, 255, 0.3);
--glow-color-hover: rgba(100, 100, 255, 0.5);
--glow-color-active: rgba(100, 100, 255, 0.8);
--glow-color-active-inset: rgba(100, 100, 255, 0.6);
--glow-color-header: rgba(100, 100, 255, 0.4);
--risk-low: #4CAF50;
--risk-moderate: #FFC107;
--risk-high: #F44336;
--loader-secondary: rgba(255, 255, 255, 0.3);
--loader-primary: #3498db;
/* Sizing & Radius */
--border-radius-main: 15px;
--border-radius-card: 10px;
--border-radius-nav: 8px;
--blur-intensity: 10px;
}
/* General Body Styles for Dark Theme */
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
background-color: var(--bg-dark);
color: var(--text-light);
line-height: 1.6;
display: flex;
justify-content: center;
align-items: flex-start;
min-height: 100vh;
box-sizing: border-box;
}
/* Main Container for Layout */
.container {
width: 90%;
max-width: 1200px;
margin: 20px auto;
padding: 20px;
background: var(--container-bg);
border-radius: var(--border-radius-main);
box-shadow: 0 8px 32px 0 var(--shadow-color-dark);
backdrop-filter: blur(var(--blur-intensity));
-webkit-backdrop-filter: blur(var(--blur-intensity));
border: 1px solid var(--border-color-translucent);
display: flex;
flex-direction: column;
gap: 20px;
}
/* Navigation Bar Styling with Glassmorphism */
.navbar {
display: flex;
justify-content: center;
gap: 15px;
padding: 15px 20px;
background: var(--navbar-bg);
border-radius: var(--border-radius-card);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border: 1px solid var(--border-color-light);
box-shadow: 0 4px 15px var(--shadow-color-medium);
}
.nav-item {
background-color: transparent;
border: none;
padding: 10px 20px;
color: var(--text-inactive);
font-size: 1.1em;
font-weight: 500;
cursor: pointer;
border-radius: var(--border-radius-nav);
transition: all 0.3s ease-in-out;
text-shadow: 0 0 5px var(--glow-color);
}
.nav-item:hover {
color: var(--text-white);
background-color: var(--hover-bg);
box-shadow: 0 0 10px var(--glow-color-hover);
transform: translateY(-2px);
}
.nav-item.active {
color: var(--text-white);
background: var(--active-gradient);
box-shadow: 0 0 15px var(--glow-color-active), 0 0 20px var(--glow-color-active-inset) inset;
border: 1px solid var(--border-color-active);
pointer-events: none;
}
/* Content Sections Styling */
.content-section {
background: var(--container-bg);
border-radius: var(--border-radius-card);
padding: 25px;
box-shadow: 0 4px 20px var(--shadow-color-light);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border: 1px solid rgba(255, 255, 255, 0.15);
transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, height 0.5s ease-in-out;
display: none;
flex-direction: column;
gap: 20px;
}
.content-section.active {
display: flex;
opacity: 1;
height: auto;
overflow: visible;
transform: translateY(0);
}
.content-section.hidden {
display: none;
opacity: 0;
height: 0;
overflow: hidden;
transform: translateY(20px);
}
.content-section h2 {
color: var(--text-highlight);
margin-top: 0;
margin-bottom: 20px;
font-size: 1.8em;
text-align: center;
text-shadow: 0 0 8px var(--glow-color-header);
}
/* Map Placeholder */
#map {
width: 100%;
height: 650px;
background-color: #333; /* Fallback */
border-radius: var(--border-radius-nav);
margin-bottom: 20px;
border: 1px solid var(--border-color-light);
box-shadow: inset 0 0 10px var(--shadow-color-inset);
}
/* Analysis Card Container */
#analysis-card-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
}
.analysis-card {
background: var(--card-bg);
border-radius: var(--border-radius-card);
padding: 20px;
border: 1px solid var(--border-color-light);
box-shadow: 0 4px 15px var(--shadow-color-medium);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
display: flex;
flex-direction: column;
gap: 10px;
opacity: 0;
transform: translateY(20px);
animation: cardReveal 0.6s ease-out forwards;
}
@keyframes cardReveal {
to {
opacity: 1;
transform: translateY(0);
}
}
.analysis-card h3,
.analysis-card h4,
.analysis-card h5 {
color: var(--text-highlight);
margin-bottom: 5px;
}
.analysis-card p {
font-size: 0.95em;
}
.analysis-card.loading {
text-align: center;
align-items: center;
}
/* Loader animation */
.loader {
border: 4px solid var(--loader-secondary);
border-top: 4px solid var(--loader-primary);
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 1s linear infinite;
margin: 10px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.analysis-card.error {
background-color: rgba(255, 0, 0, 0.3);
border-color: rgba(255, 0, 0, 0.5);
}
.risk-level-low {
color: var(--risk-low);
font-weight: bold;
text-shadow: 0 0 5px var(--risk-low);
}
.risk-level-moderate {
color: var(--risk-moderate);
font-weight: bold;
text-shadow: 0 0 5px var(--risk-moderate);
}
.risk-level-high {
color: var(--risk-high);
font-weight: bold;
text-shadow: 0 0 5px var(--risk-high);
}
.chart-container {
position: relative;
height: 250px;
width: 100%;
margin-top: 15px;
margin-bottom: 15px;
background: var(--chart-bg);
border-radius: var(--border-radius-nav);
padding: 10px;
box-sizing: border-box;
transition: box-shadow 0.3s ease-in-out;
}
.chart-container:hover {
box-shadow: 0 0 15px var(--glow-color);
}
.chart-canvas {
display: block;
max-width: 100%;
max-height: 100%;
}
/* Analytics Dashboard Specifics */
#analytics-dashboard {
min-height: 300px;
background: rgba(60, 60, 90, 0.3);
border-radius: var(--border-radius-nav);
padding: 20px;
border: 1px solid var(--border-color-light);
box-shadow: inset 0 0 10px var(--shadow-color-inset);
display: flex;
flex-direction: column;
gap: 20px;
}
.chart-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
}
.model-explanation-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
}
.analytics-card-placeholder {
text-align: center;
padding: 50px;
}
.analytics-chart.large-chart {
height: 350px;
}
/* Responsive Design */
@media (max-width: 768px) {
.container {
width: 95%;
margin: 10px auto;
padding: 15px;
}
.navbar {
flex-direction: column;
gap: 10px;
}
.nav-item {
width: 100%;
text-align: center;
}
.content-section h2 {
font-size: 1.5em;
}
#analysis-card-container,
.chart-row,
.model-explanation-container {
grid-template-columns: 1fr;
}
}
@media (max-width: 480px) {
.nav-item {
font-size: 1em;
padding: 8px 15px;
}
.content-section {
padding: 15px;
}
}