/* app/static/css/style.css */
/* Updated: 2025-12-17 - Full screen redesign */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --success-color: #059669;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #0a0e27 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--gray-800);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    display: none;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #0f172a 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #0a0e27 100%);
    backdrop-filter: blur(20px);
    color: white;
    padding: 3rem 2rem;
    border-bottom: 2px solid rgba(59, 130, 246, 0.6);
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.header-content {
    width: 100%;
    margin: 0;
    padding: 0 2rem;
    text-align: center;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.title .icon {
    font-size: 2.75rem;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.6));
}

.subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.status-healthy {
    color: var(--success-color);
    font-weight: 600;
}

.status-error {
    color: var(--danger-color);
    font-weight: 600;
}

.status-loading {
    color: var(--warning-color);
    font-weight: 600;
}

/* Main Content */
.main-content {
    padding: 3rem 2rem;
    flex: 1;
    overflow-y: auto;
    background: transparent;
    width: 100%;
    margin: 0;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #60a5fa;
    margin-bottom: 0.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.section-header p {
    color: #a0c4ff;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Upload Section */
.upload-section {
    width: 100%;
}

.upload-container {
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.1) 0%, rgba(72, 209, 204, 0.05) 100%);
    border-radius: 20px;
    padding: 3rem;
    border: 2px solid rgba(59, 130, 246, 0.5);
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 100%;
    backdrop-filter: blur(10px);
}

.upload-area {
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    transform: translateY(-2px);
}

.upload-area.dragover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.6) 0%, rgba(99, 102, 241, 0.4) 100%);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.7), inset 0 0 20px rgba(59, 130, 246, 0.2);
    transform: scale(1.02);
}

.upload-area.dragover .upload-content {
    color: white;
}

.upload-content {
    text-align: center;
    padding: 3rem 2rem;
    transition: all 0.3s ease;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-area:hover .upload-icon {
    opacity: 1;
    transform: scale(1.1);
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #e0f2fe;
    font-weight: 700;
}

.upload-content p {
    color: #a0c4ff;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.upload-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.feature {
    background: rgba(59, 130, 246, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Action Buttons */
.action-buttons {
    text-align: center;
    margin-top: 2rem;
}

.predict-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 35px rgba(59, 130, 246, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.predict-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
}

.predict-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--border-radius);
    margin: 2rem 0;
    border: 2px solid #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-300);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    color: #0f172a;
    font-weight: 600;
}

.loading-note {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Error Message */
.error-container {
    margin: 1rem 0;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* Results Section */
.result-section {
    margin-top: 2rem;
    width: 100%;
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
    width: 100%;
}

@media (max-width: 768px) {
    .results-container {
        grid-template-columns: 1fr;
    }
}

.preview-section,
.prediction-section {
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.08) 0%, rgba(72, 209, 204, 0.04) 100%);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.preview-section h3,
.prediction-section h3 {
    margin-bottom: 1rem;
    color: #60a5fa;
    font-size: 1.3rem;
    font-weight: 700;
}

/* Image Preview */
.image-preview {
    text-align: center;
}

.image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.image-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

/* Prediction Results */
.result-card {
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.1) 0%, rgba(72, 209, 204, 0.05) 100%);
    padding: 2rem;
    border-radius: 20px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.result-header {
    margin-bottom: 1rem;
}

.result-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
    font-weight: 700;
}

.tb-result h3 {
    color: #dc2626;
}

.normal-result h3 {
    color: #059669;
}

.confidence-score {
    font-size: 1.1rem;
    color: #475569;
    font-weight: 600;
}

.result-details {
    background: #e0f2fe;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    border-left: 3px solid #3b82f6;
}

.result-details p {
    margin-bottom: 0.5rem;
    color: #0f172a;
    font-weight: 500;
}

.tb-text {
    color: var(--danger-color);
    font-weight: 600;
}

.normal-text {
    color: var(--success-color);
    font-weight: 600;
}

.confidence-high {
    color: var(--success-color);
    font-weight: 600;
}

.confidence-medium {
    color: var(--warning-color);
    font-weight: 600;
}

.confidence-low {
    color: var(--danger-color);
    font-weight: 600;
}

/* Confidence Meter */
.confidence-container {
    margin-top: 1.5rem;
}

.confidence-meter {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
}

.confidence-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.confidence-bar {
    background: var(--gray-300);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.confidence-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
    position: relative;
}

.confidence-fill.high {
    background: linear-gradient(90deg, var(--success-color), #10b981);
}

.confidence-fill.medium {
    background: linear-gradient(90deg, var(--warning-color), #f59e0b);
}

.confidence-fill.low {
    background: linear-gradient(90deg, var(--danger-color), #ef4444);
}

.confidence-value {
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 700;
    color: #0f172a;
}

/* Medical Disclaimer */
.disclaimer-container {
    margin-top: 2rem;
}

.disclaimer {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.disclaimer.warning {
    background: #fef3c7;
    border-left-color: #d97706;
    color: #92400e;
    font-weight: 500;
}

.disclaimer.info {
    background: #dbeafe;
    border-left-color: #3b82f6;
    color: #0c4a6e;
    font-weight: 500;
}

.disclaimer h4 {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Info Section */
.info-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
    width: 100%;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.info-card {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.1) 0%, rgba(72, 209, 204, 0.05) 100%);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    transition: all 0.4s ease;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.info-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.2);
}

.info-card h4 {
    margin-bottom: 0.5rem;
    color: #60a5fa;
    font-weight: 700;
}

.info-card p {
    color: #a0c4ff;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(26, 26, 46, 0.95) 100%);
    backdrop-filter: blur(20px);
    color: white;
    border-top: 2px solid rgba(59, 130, 246, 0.6);
    box-shadow: 0 -20px 60px rgba(59, 130, 246, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
}

.footer-content {
    width: 100%;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #60a5fa;
    font-weight: 700;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    color: #a0c4ff;
}

.footer-section p {
    color: #a0c4ff;
    line-height: 1.6;
}

.medical-warning {
    background: rgba(239, 68, 68, 0.15);
    padding: 1rem;
    border-radius: 15px;
    border-left: 4px solid #ef4444;
    font-size: 0.9rem;
    color: #fca5a5;
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    padding: 1.5rem 2rem;
    text-align: center;
    color: #7dd3fc;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .title {
        font-size: 2rem;
    }

    .upload-content {
        padding: 2rem 1rem;
    }

    .upload-features {
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Print Styles */
@media print {

    .header,
    .upload-section,
    .action-buttons,
    .footer {
        display: none;
    }

    .result-section {
        margin-top: 0;
    }

    .results-container {
        grid-template-columns: 1fr;
    }
}