/* AI Image Analyzer - ML Demo Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #06b6d4;
    --dark: #1e293b;
    --light: #f1f5f9;
    --success: #10b981;
    --text: #334155;
    --border: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Demo Banner */
.demo-banner {
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    color: white;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Main */
main {
    padding: 3rem 0;
}

/* Upload Section */
.upload-section {
    margin-bottom: 3rem;
}

.upload-area {
    background: white;
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #faf5ff;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: #faf5ff;
    transform: scale(1.02);
}

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

.upload-area h2 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text);
    margin-bottom: 1.5rem;
}

.upload-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

/* Sample Images */
.sample-images {
    margin-top: 2rem;
    text-align: center;
}

.sample-images h3 {
    color: var(--dark);
    margin-bottom: 1rem;
}

.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.sample-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.sample-img:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* Results Section */
.results-section {
    margin: 3rem 0;
}

.analysis-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.image-container,
.detections-panel {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.image-container h3,
.detections-panel h3 {
    color: var(--dark);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.canvas-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

#canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.secondary-btn {
    width: 100%;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: #0891b2;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem 1rem;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Detections List */
.detections-list {
    max-height: 400px;
    overflow-y: auto;
}

.detection-item {
    padding: 1rem;
    margin-bottom: 0.8rem;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.detection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.detection-name {
    font-weight: 700;
    color: var(--dark);
    font-size: 1.1rem;
}

.confidence-badge {
    background: var(--success);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.confidence-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

/* Stats Panel */
.stats-panel {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #faf5ff, #f0f9ff);
    border-radius: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text);
    font-weight: 500;
}

.stat-value {
    color: var(--dark);
    font-weight: 700;
}

/* Info Section */
.info-section {
    margin: 4rem 0;
    text-align: center;
}

.info-section h2 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.info-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-card p {
    color: var(--text);
    line-height: 1.7;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

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

    .upload-area {
        padding: 3rem 1.5rem;
    }

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