/* Dog Emotions - Monolithic Flask App Styles */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 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);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-color);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 24px;
}

.upload-area {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.upload-content p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.upload-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.upload-buttons .btn {
    flex: 1;
}

/* Camera Section */
.camera-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.camera-section video {
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    background: #000;
}

.camera-buttons {
    display: flex;
    gap: 12px;
}

.camera-buttons .btn {
    flex: 1;
}

/* Preview Section */
.preview-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.preview-section img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    object-fit: contain;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 48px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result Section */
.result-section {
    margin-bottom: 24px;
}

.result-image-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-image-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.result-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
}

.emotion-result {
    text-align: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.emotion-emoji {
    font-size: 4rem;
    display: block;
    margin-bottom: 8px;
}

.emotion-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.emotion-confidence {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Probabilities */
.probabilities {
    margin-bottom: 20px;
}

.probability-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.probability-label {
    width: 80px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.probability-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
}

.probability-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #818cf8);
    border-radius: 12px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: fit-content;
}

.probability-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.probability-item.top .probability-bar {
    background: linear-gradient(90deg, var(--success-color), #4ade80);
}

/* Feedback Section */
.feedback-section,
.correction-section,
.feedback-thanks {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.feedback-section p,
.correction-section p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.feedback-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.emotion-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.emotion-options .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.feedback-thanks p {
    color: var(--success-color);
    font-weight: 500;
}

/* Stats Section */
.stats-section {
    margin-bottom: 24px;
}

.stats-section .btn-outline {
    width: 100%;
    margin-bottom: 16px;
}

.stats-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    text-align: center;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    text-align: center;
}

.error-message .error-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.error-message p {
    margin: 4px 0;
}

.error-message .error-hint {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    header h1 {
        font-size: 2rem;
    }

    .upload-buttons {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .feedback-buttons {
        flex-direction: column;
    }

    .emotion-options .btn {
        width: 100%;
    }
}
