html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}



/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5e6060;
    --primary-gradient: linear-gradient(135deg, #232c1c 0%, #abaaaa 100%);
    --secondary-color: #f093fb;
    --accent-color: #abaaaa;
    --success-color: #43e97b;
    --warning-color: #fa709a;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #abaaaa 0%, #232c1c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 10%;
    right: 30%;
    animation-delay: 1s;
}

.shape-5 {
    width: 40px;
    height: 40px;
    top: 40%;
    left: 60%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* Main Container */
.app-container {
    width: 100%;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
    position: relative;
}

.chat-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header */
.chat-header {
    background: var(--primary-gradient);
    padding: 20px 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

    .chat-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
        opacity: 0.3;
    }

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.bot-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.avatar-ring {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.header-text {
    flex: 1;
}

    .header-text h1 {
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 4px;
    }

.status-text {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

    .action-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-secondary);
    scroll-behavior: smooth;
}

    .chat-messages::-webkit-scrollbar {
        width: 6px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: transparent;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }

        .chat-messages::-webkit-scrollbar-thumb:hover {
            background: var(--text-light);
        }

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: messageSlideIn 0.5s ease forwards;
}

.message-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes messageSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.user-avatar {
    background: var(--accent-color);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    border: 1px solid var(--border-color);
}

.user-bubble {
    background: var(--primary-gradient);
    color: white;
    margin-left: auto;
}

.message-bubble p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

.welcome-message {
    opacity: 1;
    transform: translateY(0);
}

/* Input Area */
.chat-input-area {
    background: white;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.input-form {
    margin-bottom: 16px;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

    .input-wrapper:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

#user-input {
    width: 100%;
    min-height: 48px;
    max-height: 120px;
    padding: 12px 16px;
    padding-right: 80px;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: inherit;
}

    #user-input::placeholder {
        color: var(--text-light);
    }

.input-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
}

.input-action-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

    .input-action-btn:hover {
        background: var(--bg-tertiary);
        color: var(--text-secondary);
    }

.send-btn {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: var(--shadow-md);
}

    .send-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    .send-btn:active {
        transform: translateY(0);
    }

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

    .quick-action-btn:hover {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .quick-action-btn i {
        font-size: 10px;
    }

/* Loading Overlay */
.loading-overlay {
  position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

    .loading-overlay.loading-visible {
        opacity: 1;
        visibility: visible;
    }

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

    .spinner-ring:nth-child(2) {
        width: 80%;
        height: 80%;
        top: 10%;
        left: 10%;
        border-top-color: var(--secondary-color);
        animation-delay: 0.2s;
    }

    .spinner-ring:nth-child(3) {
        width: 60%;
        height: 60%;
        top: 20%;
        left: 20%;
        border-top-color: var(--accent-color);
        animation-delay: 0.4s;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        height: 100vh;
        max-height: none;
        padding: 0;
    }

    .chat-container {
        border-radius: 0;
        height: 100vh;
    }

    .chat-header {
        padding: 16px 20px;
    }

    .chat-messages {
        padding: 16px 20px;
    }

    .chat-input-area {
        padding: 16px 20px;
    }

    .message-content {
        max-width: 85%;
    }

    .quick-actions {
        justify-content: center;
    }

    .quick-action-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-content {
        gap: 12px;
    }

    .bot-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .header-text h1 {
        font-size: 18px;
    }

    .status-text {
        font-size: 12px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .message-bubble {
        padding: 10px 14px;
    }

        .message-bubble p {
            font-size: 13px;
        }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.action-btn:focus,
.input-action-btn:focus,
.send-btn:focus,
.quick-action-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #181c24;
        --bg-secondary: #23283a;
        --bg-tertiary: #23283a;
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --text-light: #a0aec0;
        --border-color: #353b4a;
        --primary-gradient: linear-gradient(135deg, #abaaaa 0%, #232c1c 100%);
        --accent-color: #4facfe;
    }

    /*    body {
        background: linear-gradient(135deg, #abaaaa 0%, #232c1c 100%);
        color: var(--text-primary);
    }*/

    .chat-container {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
    }

    .chat-header {
        background: var(--primary-gradient);
        color: var(--text-primary);
    }

    .chat-messages {
        background: var(--bg-secondary);
    }

    .message-bubble {
        background: #23283a;
        color: #f7fafc;
        border: 1px solid var(--border-color);
    }

    .user-bubble {
        background: var(--primary-gradient);
        color: #fff;
    }

    .message-time {
        color: #a0aec0;
    }

    .input-wrapper {
        background: var(--bg-tertiary);
        border: 2px solid var(--border-color);
    }

    #user-input {
        background: transparent;
        color: #f7fafc;
    }

        #user-input::placeholder {
            color: #a0aec0;
        }

    .chat-input-area {
        background: #1a1e29;
        border-top: 1px solid var(--border-color);
    }

    .quick-action-btn {
        background: #23283a;
        color: #e2e8f0;
        border: 1px solid var(--border-color);
    }

        .quick-action-btn:hover {
            background: var(--primary-gradient);
            color: #fff;
            border-color: var(--primary-color);
        }

    .send-btn {
        background: var(--primary-gradient);
        color: #fff;
    }

    .input-action-btn {
        color: #a0aec0;
    }

        .input-action-btn:hover {
            background: #23283a;
            color: #e2e8f0;
        }

    .loading-overlay p {
        color: #fff;
    }
}
/* Spinner container */
.spinner {
    width: 64px;
    height: 64px;
    border: 6px solid transparent;
    border-top: 6px solid #232c1c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

    /* Spinner inner glow effect */
    .spinner::before {
        content: "";
        position: absolute;
        top: 6px;
        left: 6px;
        right: 6px;
        bottom: 6px;
        border-radius: 50%;
        border: 6px solid transparent;
        border-bottom: 6px solid #abaaaa;
        animation: spinReverse 1.5s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}
.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}