/* Modern Chat UI with Purple Theme */
:root {
    --primary-color: #8B3DFF;
    --primary-light: #A363D9;
    --primary-dark: #7B2FFF;
    --accent-color: #32CD32;
    --text-primary: #212121;
    --text-secondary: #757575;
    --background-light: #FFFFFF;
    --background-gray: #F8F7FC;
    --border-color: #E8E5F5;
}

/* Chat Message Styles */
.message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-in-out;
}

.message.user {
    align-self: flex-end;
}

.message.bot {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.bot .message-content {
    background: white;
    color: var(--text-primary);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.message.bot:hover:before {
    transform: scale(1.1);
}

.message.bot:before {
    content: '';
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    left: -45px;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(139, 61, 255, 0.2);
    border: 2px solid white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z'/%3E%3C/svg%3E");
    background-size: 20px;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.message.bot .message-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 0 5px;
    opacity: 0.8;
}

.message.user .message-time {
    text-align: right;
}

.message.bot .message-time {
    text-align: left;
}

.bot-tag {
    background-color: #e9ecef;
    color: #6c757d;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    text-transform: uppercase;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active Navigation Styles */
.nav-item.active {
    background-color: #4a3fb5;
}

/* Message Input Focus Styles */
.chat-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 61, 255, 0.1);
}

/* Scrollbar Styles */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c8c8c8;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Header Styles */
.chat-header {
    padding: 16px 20px;
    background: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(139, 61, 255, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon i {
    color: white;
    font-size: 16px;
}

.header-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.header-actions button {
    background: none;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.header-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-actions i {
    font-size: 16px;
}

/* Tab Styles */
.chat-tabs {
    display: flex;
    background: var(--background-gray);
    padding: 10px;
    gap: 10px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Content Styles */
.chat-content {
    display: none;
    flex-direction: column;
    height: calc(100% - 120px);
    position: relative;
}

.chat-content.active {
    display: flex;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Input Styles */
.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 61, 255, 0.1);
}

.chat-input button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.chat-input button i {
    font-size: 18px;
    color: white;
}

/* Live Agent Tab */
#liveAgentTab {
    background: var(--background-gray);
}

.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.coming-soon i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.coming-soon h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 18px;
}

.coming-soon p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* PDF Card Styles */
.pdf-card {
    background: #ffffff;
    border: 1px solid #e0e0f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.pdf-card:hover {
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.1);
    transform: translateY(-1px);
}

.pdf-info {
    flex: 1;
    margin-right: 16px;
}

.pdf-card h3 {
    color: #6c5ce7;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.meta-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.meta-label {
    color: #888;
}

.meta-value {
    color: #444;
}

.meta-downloads {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.meta-downloads i {
    font-size: 12px;
    color: #6c5ce7;
}

.pdf-actions {
    flex-shrink: 0;
}

.download-btn {
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #5649c9;
    transform: translateY(-1px);
}

.download-btn i {
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-content {
        height: calc(100% - 110px);
    }

    .chat-input {
        padding: 12px;
    }

    .message {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 14px 16px;
    }

    .header-icon {
        width: 28px;
        height: 28px;
    }

    .header-title {
        font-size: 15px;
    }

    .chat-input input {
        font-size: 16px;
        padding: 10px 14px;
    }

    .chat-input button {
        width: 38px;
        height: 38px;
    }

    .chat-input button i {
        font-size: 16px;
    }
}

/* Typing Indicator */
.message.bot.typing .message-content {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 40px;
    padding: 12px;
}

.message.bot.typing .message-content::before,
.message.bot.typing .message-content::after {
    content: '.';
    animation: typing 1.4s infinite;
    font-size: 20px;
    line-height: 0;
    margin-top: -3px;
}

.message.bot.typing .message-content::after {
    animation-delay: .7s;
}

@keyframes typing {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Bot Icon */
.bot-icon {
    position: fixed;
    bottom: 20px;
    right: 24px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(139, 61, 255, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bot-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(139, 61, 255, 0.35);
}

.bot-icon i {
    color: white;
    font-size: 24px;
}

/* Message Types */
.message.bot.warning .message-content {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.message.bot.error .message-content {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.message.bot.warning .message-time,
.message.bot.error .message-time {
    color: #6c757d;
}

/* Disabled input state */
.chat-input input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    color: #6c757d;
}

.chat-input button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}