﻿@import url('lib/tailwindcss/dist/preflight.css');

/* Light Theme (default) */
:root {
    --bg-primary: #f4f4f4;
    --bg-secondary: rgb(225, 227, 233);
    --bg-card: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-primary: #e5e7eb;
    --msg-user-bg: rgb(182, 215, 232);
    --msg-user-text: #1F2937;
}

/* Dark Theme */
html.dark {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
    --border-primary: #4b5563;
    --msg-user-bg: #3b5998;
    --msg-user-text: #f9fafb;
}

    html.dark,
    html.dark .main-background-gradient {
        background: linear-gradient(to bottom, #111827, #1f2937 25rem);
    }

        html.dark body {
            color: var(--text-primary);
        }

html {
    min-height: 100vh;
}

html, .main-background-gradient {
    background: linear-gradient(to bottom, rgb(225 227 233), #f4f4f4 25rem);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html::after {
    content: '';
    background-image: linear-gradient(to right, #3a4ed5, #3acfd5 15%, #d53abf 85%, red);
    width: 100%;
    height: 2px;
    position: fixed;
    top: 0;
}

h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 600;
}

    h1:focus {
        outline: none;
    }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaG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yNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.btn-default {
    display: flex;
    padding: 0.25rem 0.75rem;
    gap: 0.25rem;
    align-items: center;
    border-radius: 0.25rem;
    border: 1px solid #9CA3AF;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    background-color: #D1D5DB;
}

    .btn-default:hover {
        background-color: #E5E7EB;
    }

.btn-subtle {
    display: flex;
    padding: 0.25rem 0.75rem;
    gap: 0.25rem;
    align-items: center;
    border-radius: 0.25rem;
    border: 1px solid #D1D5DB;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

    .btn-subtle:hover {
        border-color: #93C5FD;
        background-color: #DBEAFE;
    }

.page-width {
    max-width: 1024px;
    margin: auto;
}

/* Verification Styles */
.verification-container {
    margin: 1rem 0;
    padding: 0 1rem;
}

.verify-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .verify-button:hover:not(:disabled) {
        background-color: #2563eb;
    }

    .verify-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.verify-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.verification-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid;
}

.verification-good {
    background-color: #f0fdf4;
    border-color: #22c55e;
}

.verification-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
}

.verification-bad {
    background-color: #fef2f2;
    border-color: #ef4444;
}

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

    .verification-header h4 {
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
    }

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
}

    .close-button:hover {
        opacity: 1;
    }

.verification-scores {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.score-item {
    display: flex;
    flex-direction: column;
}

.score-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.verification-explanation {
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.verification-assessment {
    font-size: 0.875rem;
    text-align: center;
}



/* Dark theme verification styles */
html.dark .verification-good {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #f9fafb;
}

html.dark .verification-warning {
    background-color: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f9fafb;
}

html.dark .verification-bad {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f9fafb;
}

html.dark .verification-header h4 {
    color: #f9fafb;
}

html.dark .close-button {
    color: #f9fafb;
}

html.dark .score-label {
    color: #d1d5db;
}

html.dark .score-value {
    color: #f9fafb;
}

html.dark .verification-explanation {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

html.dark .verification-assessment {
    color: #d1d5db;
}

.assistant-message-wrapper {
    border: 3px solid transparent;
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

    .assistant-message-wrapper.verified-good {
        border-color: #22c55e;
        background-color: rgba(34, 197, 94, 0.05);
    }

    .assistant-message-wrapper.verified-warning {
        border-color: #f59e0b;
        background-color: rgba(245, 158, 11, 0.05);
    }

    .assistant-message-wrapper.verified-bad {
        border-color: #ef4444;
        background-color: rgba(239, 68, 68, 0.05);
    }

/* Badge de v�rification dans le header */
.assistant-message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.verification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.badge-good {
    background-color: #22c55e;
    color: white;
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.3);
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.badge-bad {
    background-color: #ef4444;
    color: white;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}



/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

    .theme-toggle:hover {
        background-color: var(--bg-card);
    }

    /* Show moon in light mode, sun in dark mode */
    .theme-toggle .sun-icon {
        display: none;
    }

html.dark .theme-toggle .moon-icon {
    display: none;
}

html.dark .theme-toggle .sun-icon {
    display: block;
}


/* ===== MESSAGE FEEDBACK BUTTONS ===== */
.message-feedback {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.feedback-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .feedback-button svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .feedback-button:hover:not(:disabled):not(.active) {
        background-color: #f3f4f6;
        border-color: #9ca3af;
        color: #374151;
    }

    .feedback-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    /* ✅ ÉTAT ACTIF - Rouge avec texte blanc */
    .feedback-button.active {
        background-color: #dc2626 !important;
        border-color: #dc2626 !important;
        color: white !important;
    }

        .feedback-button.active svg {
            fill: white !important;
            stroke: white !important;
        }

        .feedback-button.active:hover:not(:disabled) {
            background-color: #b91c1c !important;
            border-color: #b91c1c !important;
            color: white !important;
        }

/* ===== INCORRECT BADGE ===== */
.incorrect-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    background-color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 10px;
    margin-left: 8px;
}

    .incorrect-badge .incorrect-icon {
        width: 12px;
        height: 12px;
        fill: white;
    }

/* Dark mode */
[data-theme="dark"] .feedback-button {
    color: #9ca3af;
    background-color: #1f2937;
    border-color: #4b5563;
}

    [data-theme="dark"] .feedback-button:hover:not(:disabled):not(.active) {
        background-color: #374151;
        border-color: #6b7280;
        color: #f3f4f6;
    }

    [data-theme="dark"] .feedback-button.active {
        background-color: #dc2626 !important;
        border-color: #dc2626 !important;
        color: white !important;
    }

        [data-theme="dark"] .feedback-button.active:hover:not(:disabled) {
            background-color: #b91c1c !important;
            border-color: #b91c1c !important;
            color: white !important;
        }

[data-theme="dark"] .message-feedback {
    border-top-color: #374151;
}