:root {
    --primary-color: #8a2123;
    --primary-hover: #6a1618;
    --secondary-color: #d9a01c;
    --secondary-hover: #b8860b;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --gradient-primary: linear-gradient(135deg, #8a2123 0%, #6a1618 100%);
    --gradient-gold: linear-gradient(135deg, #fcd34d 0%, #d9a01c 100%);

    --shadow-sm: 0 2px 4px rgba(138, 33, 35, 0.04);
    --shadow-md: 0 8px 16px rgba(138, 33, 35, 0.06);
    --shadow-lg: 0 15px 35px -5px rgba(138, 33, 35, 0.1);
    --shadow-glow: 0 0 20px rgba(217, 160, 28, 0.25);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color) !important;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ANIMATED DOTS BACKGROUND & CANVAS */
.dots-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
}

.bg-dots-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background-image: 
        radial-gradient(rgba(138, 33, 35, 0.13) 1.5px, transparent 1.5px),
        radial-gradient(rgba(217, 160, 28, 0.12) 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    opacity: 0.7;
    animation: dotsDrift 45s linear infinite;
}

@keyframes dotsDrift {
    0% {
        background-position: 0 0, 15px 15px;
    }
    100% {
        background-position: 30px 30px, 45px 45px;
    }
}

.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(217, 160, 28, 0.4) 0%, rgba(217, 160, 28, 0) 70%);
    top: -200px;
    left: -100px;
}

.blob-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(138, 33, 35, 0.3) 0%, rgba(138, 33, 35, 0) 70%);
    bottom: -300px;
    right: -200px;
    animation-delay: -5s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0) 70%);
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 30px) scale(1.1);
    }

    100% {
        transform: translate(-30px, -50px) scale(0.9);
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.modern-header {
    background: transparent;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.brand-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.brand-divider {
    color: #cbd5e1;
    font-weight: 300;
    margin: 0 0.35rem;
}

.brand-tag {
    color: #8a2123;
    font-weight: 600;
}

.card {
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 36px;
    background-color: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    overflow: hidden;
    position: relative;
    z-index: 2;
    height: 520px !important;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(138, 33, 35, 0.15);
}

.card-body {
    padding: 1.5rem !important;
}

.btn {
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(138, 33, 35, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #6a1618 0%, #4a0f11 100%);
    box-shadow: 0 8px 25px rgba(138, 33, 35, 0.4);
    transform: translateY(-2px);
    color: white;
}

.btn-outline-danger {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-danger:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    background-color: rgba(248, 250, 252, 0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drop-zone:hover,
.drop-zone.dragover {
    background-color: rgba(217, 160, 28, 0.05);
    border-color: var(--secondary-color);
    box-shadow: inset 0 0 0 4px rgba(217, 160, 28, 0.1);
}

.drop-zone i {
    color: var(--primary-color);
    transition: color 0.3s ease;
}



.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f4f6f8;
    background-image: radial-gradient(rgba(138, 33, 35, 0.15) 1.5px, transparent 1.5px), radial-gradient(rgba(217, 160, 28, 0.1) 1px, transparent 1px);
    background-size: 50px 50px, 40px 40px;
    background-position: 0 0, 25px 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-logo {
    width: 150px;
    height: 150px;
    animation: spin 3s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.chat-box {
    overflow-y: auto;
    flex: 1 1 auto;
    max-height: 350px;
    padding: 1.25rem;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

#doc-list {
    overflow-y: auto;
    max-height: 270px;
}

/* CUSTOM SCROLLBAR FOR CHAT AND DOC LIST */
.chat-box::-webkit-scrollbar,
#doc-list::-webkit-scrollbar {
    width: 6px;
}

.chat-box::-webkit-scrollbar-track,
#doc-list::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.6);
    border-radius: 8px;
}

.chat-box::-webkit-scrollbar-thumb,
#doc-list::-webkit-scrollbar-thumb {
    background: rgba(138, 33, 35, 0.35);
    border-radius: 8px;
}

.chat-box::-webkit-scrollbar-thumb:hover,
#doc-list::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 33, 35, 0.65);
}

.chat-bubble {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
}

.chat-bubble.user {
    align-items: flex-end;
}

.chat-bubble.assistant {
    align-items: flex-start;
}

.chat-bubble-content {
    max-width: 85%;
    padding: 0.65rem 1rem;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.chat-bubble.user .chat-bubble-content {
    background: var(--gradient-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(138, 33, 35, 0.15);
}

.chat-bubble.assistant .chat-bubble-content {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.chat-bubble-content h1,
.chat-bubble-content h2,
.chat-bubble-content h3,
.chat-bubble-content h4 {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    margin-top: 0.6rem !important;
    margin-bottom: 0.3rem !important;
    color: #8a2123 !important;
    line-height: 1.3 !important;
}

.chat-bubble-content h5,
.chat-bubble-content h6 {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.25rem !important;
    color: #1e293b !important;
}

.chat-bubble-content ul,
.chat-bubble-content ol {
    margin-bottom: 0.4rem;
    padding-left: 1.2rem;
}

.chat-bubble-content p {
    margin-bottom: 0.4rem;
}

/* TYPING INDICATOR DOTS */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background-color: #8a2123;
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* MIC LISTENING ANIMATION */
.mic-listening {
    color: #ef4444 !important;
    animation: micPulse 1.2s infinite ease-in-out;
}

@keyframes micPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.25);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.powered-by {
    text-align: center;
    margin-top: 3.5rem !important;
    margin-bottom: 2.5rem !important;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.powered-by a {
    color: #d9a01c !important;
    font-weight: 700;
    text-decoration: none;
}

.powered-by a:hover {
    text-decoration: underline;
}

/* INPUT CONTAINER & NO BLUE FOCUS LINE */
.input-container {
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    border-radius: 50px !important;
}

.input-container:focus-within {
    border-color: rgba(138, 33, 35, 0.4) !important;
    box-shadow: 0 0 15px rgba(138, 33, 35, 0.12) !important;
}

#user-query-input:focus, #btn-voice-input:focus, #btn-send-query:focus {
    box-shadow: none !important;
    outline: none !important;
    border-color: transparent !important;
}

/* CUSTOM ELEGANT SEND BUTTON */
.btn-send-custom {
    background: linear-gradient(135deg, #8a2123 0%, #6a1618 100%) !important;
    border: none !important;
    padding: 0.6rem 1.6rem !important;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    border-radius: 50px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(138, 33, 35, 0.2) !important;
}

.btn-send-custom:hover {
    background: linear-gradient(135deg, #6a1618 0%, #4a0f11 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(138, 33, 35, 0.35) !important;
    color: white !important;
}

/* MODAL STACKING & CLARITY */
.modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}

.modal {
    z-index: 1060 !important;
}

.modal-dialog {
    z-index: 1065 !important;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}