/* Reset and layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    overflow: auto; /* ✅ important for mobile scroll */
}


.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.main-layout {
    min-height: 100vh;
}

/* Header */
.bg-light.border-bottom {
    background-color: #ffffff !important;
    border-bottom: 1px solid #dee2e6 !important;
}

/* Chat container */
#chat-container {
    overflow-y: auto;
    flex-grow: 1;
    padding-bottom: 1rem;
}

/* Chat cards */
.user-card {
    background-color: #e7f3ff;
    border-radius: 1rem;
    border: none;
}

.assistant-card {
    background-color: #f1f3f5;
    border-radius: 1rem;
    border: none;
}

.card-body {
    padding: 1rem;
    word-wrap: break-word;
}

/* Avatars */
.avatar-badge {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    display: inline-block;
}

.user-avatar-badge {
    background-color: #007bff;
    color: #fff;
}

.assistant-avatar-badge {
    background-color: #6c757d;
    color: #fff;
}

/* Sticky Footer Bar */
.sticky-footer {
    position: sticky;
    bottom: 0;
    background-color: #ffffff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1030;
    backdrop-filter: blur(6px);
    padding: 0.5rem 1rem;
}

/* Input Styles */
.input-group > .form-control {
    border-radius: 2rem 0 0 2rem !important;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.input-group > .btn {
    border-radius: 0 2rem 2rem 0 !important;
    padding: 0.75rem 1rem;
}

/* Loading animation */
.loading-indicator {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    align-items: center;
}

.loading-indicator span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #007bff;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-indicator span:nth-child(2) { animation-delay: 0.2s; }
.loading-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error banner */
#blazor-error-ui {
    position: fixed;
    bottom: 0;
    background: #b32121;
    color: #fff;
    width: 100%;
    padding: 1rem;
    z-index: 1000;
    display: none;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    color: #fff;
    font-weight: bold;
    margin-left: 1rem;
    text-decoration: underline;
}

/* Citation */
.citation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 1050;
}
.citation-overlay.show {
    display: block;
}

/* Mobile tweaks */
@media (max-width: 768px) {
    .user-card, .assistant-card {
        font-size: 0.95rem;
        padding: 0.75rem;
    }

    .input-group > .form-control,
    .input-group > .btn {
        font-size: 1rem;
    }

    .avatar-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.6rem;
    }
}
