itsluckysharma01's picture
Upload 57 files
b5f303c verified
/* CSS Variables for mobile viewport fix */
:root {
--vh: 1vh;
}
/* Mobile-specific body classes */
.mobile-device {
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.ios-device {
-webkit-overflow-scrolling: touch;
}
/* Tooltip styles for unsupported features */
.tooltip {
position: absolute;
bottom: -30px;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 5px 10px;
border-radius: 4px;
font-size: 0.8rem;
white-space: nowrap;
z-index: 1000;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
.method-card:hover .tooltip {
opacity: 1;
}
/* Reset and Base Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
line-height: 1.6;
color: #333;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
/* Header */
.header {
text-align: center;
margin-bottom: 30px;
color: white;
}
.header-content {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 20px;
padding: 30px;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.logo-icon {
font-size: 4rem;
margin-bottom: 15px;
color: #4ade80;
}
.header h1 {
font-size: 2.5rem;
margin-bottom: 10px;
font-weight: 700;
}
.header p {
font-size: 1.1rem;
opacity: 0.9;
margin-bottom: 15px;
}
.alert {
padding: 15px;
border-radius: 10px;
margin-top: 15px;
display: flex;
align-items: center;
gap: 10px;
}
.alert-error {
background: rgba(239, 68, 68, 0.2);
border: 1px solid rgba(239, 68, 68, 0.3);
color: #fee2e2;
}
/* Main Content */
.main-content {
background: white;
border-radius: 20px;
padding: 40px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
margin-bottom: 30px;
position: relative;
}
/* Upload Methods */
.upload-methods {
display: flex;
gap: 20px;
margin-bottom: 30px;
justify-content: center;
}
.method-card {
flex: 1;
max-width: 200px;
padding: 25px;
border: 2px solid #e2e8f0;
border-radius: 15px;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
background: #f8fafc;
}
.method-card:hover {
border-color: #667eea;
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}
.method-card.active {
border-color: #667eea;
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
}
.method-card i {
font-size: 2.5rem;
margin-bottom: 10px;
color: #667eea;
}
.method-card.active i {
color: white;
}
.method-card h3 {
margin-bottom: 5px;
font-size: 1.2rem;
}
.method-card p {
font-size: 0.9rem;
opacity: 0.8;
}
/* Upload Section */
.upload-area {
border: 3px dashed #cbd5e1;
border-radius: 15px;
padding: 60px 20px;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
background: #f8fafc;
}
.upload-area:hover, .upload-area.dragover {
border-color: #667eea;
background: #f0f9ff;
transform: translateY(-2px);
}
.upload-icon {
font-size: 4rem;
margin-bottom: 20px;
color: #667eea;
}
.upload-content h3 {
font-size: 1.5rem;
margin-bottom: 10px;
color: #1e293b;
}
.browse-text {
color: #667eea;
text-decoration: underline;
cursor: pointer;
}
.supported-formats {
margin-top: 15px;
color: #94a3b8;
}
/* Camera Section */
.camera-container {
text-align: center;
padding: 20px;
border: 2px dashed #cbd5e1;
border-radius: 15px;
background: #f8fafc;
}
#video {
max-width: 100%;
max-height: 400px;
border-radius: 10px;
margin-bottom: 20px;
}
.camera-controls {
display: flex;
gap: 15px;
justify-content: center;
flex-wrap: wrap;
}
/* Image Preview */
.image-preview {
text-align: center;
margin-top: 30px;
}
.image-preview img {
max-width: 100%;
max-height: 400px;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
margin-bottom: 20px;
}
.image-actions {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 20px;
flex-wrap: wrap;
}
/* Buttons */
.btn {
padding: 12px 25px;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
gap: 8px;
text-decoration: none;
white-space: nowrap;
}
.btn-predict {
background: linear-gradient(135deg, #4ade80, #22c55e);
color: white;
}
.btn-predict:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}
.btn-primary {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}
.btn-camera {
background: linear-gradient(135deg, #f59e0b, #d97706);
color: white;
}
.btn-camera:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}
.btn-capture {
background: linear-gradient(135deg, #ef4444, #dc2626);
color: white;
}
.btn-capture:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
}
.btn-secondary {
background: #e2e8f0;
color: #475569;
}
.btn-secondary:hover {
background: #cbd5e1;
transform: translateY(-2px);
}
/* Loading */
.loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.95);
display: flex;
justify-content: center;
align-items: center;
border-radius: 20px;
z-index: 1000;
}
.loading-content {
text-align: center;
color: #667eea;
}
.spinner {
width: 50px;
height: 50px;
border: 4px solid #e2e8f0;
border-top: 4px solid #667eea;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 20px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Results Section */
.results-section {
margin-top: 40px;
}
.results-section h2 {
color: #1e293b;
margin-bottom: 30px;
font-size: 2rem;
display: flex;
align-items: center;
gap: 15px;
}
/* Analyzed Image Display */
.analyzed-image {
background: #f8fafc;
border-radius: 15px;
padding: 25px;
margin-bottom: 30px;
text-align: center;
}
.analyzed-image h3 {
color: #1e293b;
margin-bottom: 20px;
font-size: 1.4rem;
}
.analyzed-image-container {
display: flex;
justify-content: center;
align-items: center;
}
.analyzed-img {
max-width: 100%;
max-height: 300px;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
border: 3px solid #e2e8f0;
}
.prediction-card {
background: linear-gradient(135deg, #f8fafc, #e2e8f0);
border-radius: 15px;
padding: 30px;
margin-bottom: 30px;
border: 1px solid #e2e8f0;
}
.prediction-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
flex-wrap: wrap;
gap: 15px;
}
.confidence-badge {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
padding: 8px 20px;
border-radius: 20px;
font-weight: 700;
font-size: 1.1rem;
}
.prediction-result {
display: flex;
align-items: center;
gap: 20px;
flex-wrap: wrap;
}
.disease-icon {
font-size: 3rem;
color: #667eea;
background: rgba(102, 126, 234, 0.1);
padding: 20px;
border-radius: 50%;
flex-shrink: 0;
}
.disease-info h4 {
font-size: 1.8rem;
color: #1e293b;
margin-bottom: 10px;
}
.disease-info p {
color: #64748b;
font-size: 1.1rem;
margin-bottom: 8px;
}
.timestamp {
color: #94a3b8;
font-size: 0.9rem;
}
/* Detailed Analysis */
.detailed-analysis {
background: #f8fafc;
border-radius: 15px;
padding: 30px;
margin-bottom: 30px;
}
.detailed-analysis h3 {
color: #1e293b;
margin-bottom: 20px;
font-size: 1.3rem;
}
.probability-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
padding: 15px;
background: white;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.probability-label {
font-weight: 600;
color: #1e293b;
flex: 1;
min-width: 120px;
}
.probability-bar {
flex: 2;
height: 8px;
background: #e2e8f0;
border-radius: 4px;
margin: 0 15px;
overflow: hidden;
min-width: 100px;
}
.probability-fill {
height: 100%;
border-radius: 4px;
transition: width 0.5s ease;
}
.probability-value {
font-weight: 700;
color: #1e293b;
min-width: 50px;
text-align: right;
}
/* Recommendations */
.recommendations {
background: linear-gradient(135deg, #fef3c7, #fed7aa);
border-radius: 15px;
padding: 30px;
border-left: 5px solid #f59e0b;
margin-bottom: 30px;
}
.recommendations h3 {
color: #92400e;
margin-bottom: 20px;
font-size: 1.3rem;
display: flex;
align-items: center;
gap: 10px;
}
.recommendation-item {
background: rgba(255, 255, 255, 0.7);
padding: 15px;
border-radius: 10px;
margin-bottom: 10px;
border-left: 3px solid #f59e0b;
display: flex;
align-items: flex-start;
gap: 10px;
}
.recommendation-item i {
color: #f59e0b;
margin-top: 2px;
flex-shrink: 0;
}
.recommendation-item span {
color: #78350f;
line-height: 1.5;
}
/* Result Actions */
.result-actions {
display: flex;
gap: 15px;
justify-content: center;
flex-wrap: wrap;
align-items: flex-start;
}
.download-group {
margin-top: 20px;
padding: 20px;
background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
border-radius: 12px;
border: 1px solid #e2e8f0;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
}
.download-group::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
animation: shimmer 2s infinite;
}
@keyframes shimmer {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
.download-help {
font-size: 14px;
margin-bottom: 5px;
padding: 12px 16px;
border-radius: 8px;
display: flex;
align-items: center;
gap: 10px;
font-weight: 500;
border: 1px solid;
transition: all 0.3s ease;
text-align: center;
max-width: 300px;
line-height: 1.4;
}
.download-help.supported {
background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
color: #065f46;
border-color: #10b981;
}
.download-help.supported .help-icon {
color: #10b981;
}
.download-help.not-supported {
background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
color: #6b7280;
border-color: #d1d5db;
}
.download-help.not-supported .help-icon {
color: #9ca3af;
}
.help-icon {
font-size: 16px;
display: flex;
align-items: center;
}
.download-help i {
color: inherit;
font-size: 1rem;
}
#downloadResultBtn {
width: 100%;
max-width: 300px;
padding: 15px 20px;
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
color: white;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
position: relative;
overflow: hidden;
}
#downloadResultBtn:hover:not(:disabled) {
background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
transform: translateY(-2px);
}
#downloadResultBtn:active {
transform: translateY(0);
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
#downloadResultBtn:disabled {
opacity: 0.7;
cursor: not-allowed;
transform: none;
}
#downloadResultBtn.folder-supported {
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
#downloadResultBtn.folder-supported:hover:not(:disabled) {
background: linear-gradient(135deg, #059669 0%, #047857 100%);
box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
#downloadResultBtn .fas.fa-folder-open {
margin-right: 0;
}
/* Footer */
.footer {
text-align: center;
color: white;
opacity: 0.9;
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 15px;
}
.status-indicator {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.9rem;
}
.status-good {
color: #4ade80;
}
.status-error {
color: #ef4444;
}
/* Touch and Mobile Specific Styles */
.upload-area,
.method-card,
.btn,
.browse-text {
-webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
touch-action: manipulation;
}
/* Improve touch targets for mobile */
@media (max-width: 768px) {
.btn {
min-height: 44px; /* Apple's recommended minimum touch target */
display: flex;
align-items: center;
justify-content: center;
}
.method-card {
min-height: 120px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.upload-area {
min-height: 150px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.browse-text {
padding: 8px 12px;
border-radius: 4px;
background: rgba(102, 126, 234, 0.1);
margin: 0 4px;
}
/* Larger touch targets for camera controls */
.camera-controls .btn {
min-height: 50px;
font-size: 1rem;
}
/* Better spacing for recommendation items */
.recommendation-item {
min-height: 50px;
display: flex;
align-items: center;
}
/* Improve probability item touch area */
.probability-item {
min-height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}
}
/* Prevent zoom on input focus for iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
input[type="file"] {
font-size: 16px;
}
}
/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.analyzed-img,
.image-preview img,
#video {
image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges;
}
}
/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
.header-content {
padding: 15px;
}
.logo-icon {
font-size: 2rem;
margin-bottom: 5px;
}
.header h1 {
font-size: 1.8rem;
margin-bottom: 5px;
}
.header p {
font-size: 0.9rem;
margin-bottom: 10px;
}
.main-content {
padding: 15px;
}
.upload-methods {
flex-direction: row;
justify-content: center;
gap: 20px;
}
.method-card {
max-width: 200px;
padding: 12px;
}
.upload-area {
padding: 25px 15px;
}
#video {
max-height: 200px;
}
.image-preview img,
.analyzed-img {
max-height: 200px;
}
}
/* Print styles for results */
@media print {
.header,
.upload-methods,
.upload-section,
.camera-section,
.image-preview,
.loading-overlay,
.result-actions,
.footer {
display: none !important;
}
.main-content {
box-shadow: none;
border: 1px solid #000;
}
.results-section {
display: block !important;
}
body {
background: white;
color: black;
}
}
/* Responsive Design */
/* Large tablets and small desktops */
@media (max-width: 1024px) {
.container {
padding: 15px;
}
.header-content {
padding: 25px;
}
.main-content {
padding: 30px;
}
.upload-methods {
gap: 15px;
}
.method-card {
padding: 20px;
}
}
/* Tablets */
@media (max-width: 768px) {
.container {
padding: 10px;
}
.header h1 {
font-size: 2rem;
}
.header p {
font-size: 1rem;
}
.logo-icon {
font-size: 3rem;
}
.header-content {
padding: 20px;
}
.main-content {
padding: 20px;
margin-bottom: 20px;
}
.upload-methods {
flex-direction: column;
align-items: center;
gap: 15px;
}
.method-card {
max-width: 280px;
width: 100%;
}
.method-card i {
font-size: 2rem;
}
.upload-area {
padding: 40px 15px;
}
.upload-icon {
font-size: 3rem;
}
.upload-content h3 {
font-size: 1.3rem;
}
.camera-container {
padding: 15px;
}
#video {
max-height: 300px;
}
.image-preview img {
max-height: 300px;
}
.prediction-header {
flex-direction: column;
text-align: center;
gap: 10px;
}
.prediction-result {
flex-direction: column;
text-align: center;
gap: 15px;
}
.disease-icon {
font-size: 2.5rem;
padding: 15px;
align-self: center;
}
.disease-info h4 {
font-size: 1.5rem;
}
.probability-item {
flex-direction: column;
gap: 10px;
text-align: center;
padding: 12px;
}
.probability-bar {
width: 100%;
margin: 0;
height: 6px;
}
.analyzed-img {
max-height: 250px;
}
.detailed-analysis,
.recommendations {
padding: 20px;
}
.recommendation-item {
padding: 12px;
flex-direction: column;
text-align: center;
gap: 8px;
}
.camera-controls {
flex-direction: column;
align-items: center;
gap: 10px;
}
.image-actions,
.result-actions {
flex-direction: column;
align-items: center;
gap: 10px;
}
.btn {
width: 100%;
max-width: 250px;
padding: 12px 20px;
font-size: 0.95rem;
}
.footer {
flex-direction: column;
text-align: center;
gap: 10px;
padding: 15px;
}
}
/* Mobile phones */
@media (max-width: 480px) {
.container {
padding: 8px;
}
.header h1 {
font-size: 1.8rem;
margin-bottom: 8px;
}
.header p {
font-size: 0.95rem;
margin-bottom: 10px;
}
.logo-icon {
font-size: 2.5rem;
margin-bottom: 10px;
}
.header-content {
padding: 15px;
margin-bottom: 20px;
}
.main-content {
padding: 15px;
border-radius: 15px;
}
.upload-methods {
gap: 12px;
}
.method-card {
max-width: 100%;
padding: 15px;
}
.method-card h3 {
font-size: 1.1rem;
}
.method-card p {
font-size: 0.85rem;
}
.method-card i {
font-size: 1.8rem;
margin-bottom: 8px;
}
.upload-area {
padding: 30px 10px;
border-radius: 12px;
}
.upload-icon {
font-size: 2.5rem;
margin-bottom: 15px;
}
.upload-content h3 {
font-size: 1.2rem;
margin-bottom: 8px;
}
.upload-content p {
font-size: 0.9rem;
}
.supported-formats {
font-size: 0.8rem;
}
.camera-container {
padding: 12px;
}
#video {
max-height: 250px;
border-radius: 8px;
}
.image-preview img {
max-height: 250px;
}
.results-section h2 {
font-size: 1.6rem;
margin-bottom: 20px;
}
.prediction-card,
.detailed-analysis,
.recommendations {
padding: 15px;
margin-bottom: 20px;
border-radius: 12px;
}
.prediction-header h3 {
font-size: 1.1rem;
}
.confidence-badge {
padding: 6px 15px;
font-size: 1rem;
border-radius: 15px;
}
.disease-icon {
font-size: 2rem;
padding: 12px;
}
.disease-info h4 {
font-size: 1.3rem;
margin-bottom: 8px;
}
.disease-info p {
font-size: 1rem;
}
.detailed-analysis h3,
.recommendations h3 {
font-size: 1.2rem;
margin-bottom: 15px;
}
.probability-item {
padding: 10px;
border-radius: 8px;
margin-bottom: 10px;
}
.probability-label {
font-size: 0.9rem;
min-width: auto;
}
.probability-bar {
height: 5px;
min-width: 80px;
}
.probability-value {
font-size: 0.9rem;
min-width: 40px;
}
.analyzed-image {
padding: 15px;
margin-bottom: 20px;
}
.analyzed-image h3 {
font-size: 1.2rem;
margin-bottom: 15px;
}
.analyzed-img {
max-height: 200px;
border-width: 2px;
}
.recommendation-item {
padding: 10px;
border-radius: 8px;
margin-bottom: 8px;
font-size: 0.9rem;
}
.recommendation-item i {
font-size: 0.9rem;
}
.btn {
padding: 10px 15px;
font-size: 0.9rem;
border-radius: 6px;
}
.camera-controls {
gap: 8px;
}
.image-actions,
.result-actions {
gap: 8px;
}
.loading-overlay {
border-radius: 15px;
}
.spinner {
width: 40px;
height: 40px;
margin-bottom: 15px;
}
.loading-content p {
font-size: 1rem;
margin-bottom: 5px;
}
.loading-content small {
font-size: 0.85rem;
}
.footer {
padding: 12px;
font-size: 0.85rem;
}
.status-indicator {
font-size: 0.8rem;
}
}
/* Very small screens */
@media (max-width: 320px) {
.container {
padding: 5px;
}
.header h1 {
font-size: 1.6rem;
}
.logo-icon {
font-size: 2rem;
}
.main-content {
padding: 12px;
}
.upload-area {
padding: 20px 8px;
}
.upload-content h3 {
font-size: 1.1rem;
}
.btn {
padding: 8px 12px;
font-size: 0.85rem;
max-width: 200px;
}
.prediction-card,
.detailed-analysis,
.recommendations,
.analyzed-image {
padding: 12px;
}
.disease-info h4 {
font-size: 1.2rem;
}
.analyzed-img {
max-height: 180px;
}
}
/* Utility Classes */
.fade-in {
animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.text-center {
text-align: center;
}
.hidden {
display: none !important;
}