/* Timestamp Display */
.timestamp-display {
    background: #f1f5f9;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Ensemble Badge Enhancement */
.model-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .model-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}/* ============================================
   Brain Tumor Classification - Complete CSS
   Medical-Grade Professional Design
   ============================================ */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ============================================
   Header Section
   ============================================ */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header-content .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.header-content .logo svg {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-top: 8px;
    font-weight: 300;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    padding: 50px 40px;
}

/* ============================================
   Upload Section
   ============================================ */
.upload-section {
    margin-bottom: 50px;
}

.upload-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.upload-card h2 {
    font-size: 1.75rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    font-weight: 600;
}

.upload-area {
    position: relative;
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #f8fafc;
    transform: translateY(-2px);
}

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

.upload-placeholder svg {
    color: var(--primary);
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.upload-placeholder p {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-placeholder span {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.image-preview {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 450px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: var(--shadow);
}

.remove-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    line-height: 1;
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ============================================
   Model Selection
   ============================================ */
.model-selection {
    margin-bottom: 25px;
}

.model-selection label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.model-selection select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1.05rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.model-selection select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.model-selection select:hover {
    border-color: var(--primary);
}

/* ============================================
   Predict Button
   ============================================ */
.predict-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.predict-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(102, 126, 234, 0.4);
}

.predict-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.predict-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Results Section
   ============================================ */
.results-section {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 35px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
}

.model-badge {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.result-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.result-card h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   Prediction Badge (Color-coded by type)
   ============================================ */
.prediction-badge {
    text-align: center;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.prediction-badge:hover {
    transform: scale(1.02);
}

.prediction-badge.glioma {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.prediction-badge.meningioma {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.prediction-badge.pituitary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.prediction-badge.notumor {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.prediction-label {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: capitalize;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.confidence-text {
    display: block;
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 500;
}

/* ============================================
   Confidence Bar
   ============================================ */
.confidence-bar {
    width: 100%;
    height: 14px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.8s ease;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* ============================================
   Chart Styling
   ============================================ */
#probabilityChart {
    max-height: 300px;
}

/* ============================================
   Image Comparison
   ============================================ */
.image-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 25px;
    align-items: center;
    margin-bottom: 35px;
    padding: 30px;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.comparison-item {
    text-align: center;
}

.comparison-item h4 {
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 600;
}

.comparison-item img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    object-fit: contain;
}

.comparison-arrow {
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: bold;
}

.result-display {
    background: white;
    padding: 35px;
    border-radius: 12px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.result-display svg {
    width: 90px;
    height: 90px;
    margin-bottom: 18px;
}

.result-display p {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: capitalize;
    margin-bottom: 5px;
}

.result-display span {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ============================================
   Disclaimer
   ============================================ */
.disclaimer {
    background: #fef3c7;
    border-left: 5px solid var(--warning);
    padding: 20px 25px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #92400e;
    line-height: 1.6;
}

.disclaimer strong {
    font-weight: 700;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-primary);
    padding: 25px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-top: 1px solid var(--border);
}

/* ============================================
   Responsive Design - Mobile & Tablet
   ============================================ */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 15px;
    }

    .header {
        padding: 25px 20px;
    }

    .header-content h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .main-content {
        padding: 30px 20px;
    }

    .upload-card {
        padding: 25px 20px;
    }

    .upload-area {
        padding: 35px 20px;
        min-height: 280px;
    }

    .upload-placeholder p {
        font-size: 1.1rem;
    }

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

    .results-header h2 {
        font-size: 1.5rem;
    }

    .image-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .comparison-arrow {
        transform: rotate(90deg);
        font-size: 2rem;
    }

    .prediction-label {
        font-size: 1.4rem;
    }

    .predict-btn {
        font-size: 1.05rem;
        padding: 18px;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }

    .upload-card h2 {
        font-size: 1.4rem;
    }

    .result-card {
        padding: 20px;
    }

    .prediction-badge {
        padding: 20px;
    }

    .result-display {
        padding: 25px;
        min-height: 180px;
    }

    .result-display svg {
        width: 70px;
        height: 70px;
    }
}

/* ============================================
   Print Styles (for medical records)
   ============================================ */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
    }

    .header {
        background: white;
        color: black;
        border-bottom: 2px solid black;
    }

    .upload-section,
    .predict-btn,
    .footer {
        display: none;
    }

    .results-section {
        display: block !important;
    }
}
