/* Chatbot Styles */
.chat-float {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    color: white;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.4);
}

.chat-float:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 198, 255, 0.6);
}

.chat-window {
    position: fixed;
    top: 20px;
    right: 30px;
    bottom: 20px;
    width: 360px;
    height: auto;
    background: #ffffff;
    color: #0f172a;
    border-radius: 24px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
    max-height: calc(100vh - 40px);
}

.chat-header {
    background: #2563eb;
    color: white;
    padding: 16px 20px;
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 18px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
}

.message-wrapper {
    display: flex;
    width: 100%;
}

.message-wrapper.user {
    justify-content: flex-end;
}

.message-wrapper.bot,
.message-wrapper.admin,
.message-wrapper.system {
    justify-content: flex-start;
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.92rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.bot-message {
    background: #eef2ff;
    color: #1e293b;
    align-self: flex-start;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.user-message {
    background: #2563eb;
    color: #ffffff;
    align-self: flex-end;
    border: 1px solid rgba(37, 99, 235, 0.4);
}

.admin-message {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    align-self: flex-end;
    border: 1px solid rgba(34, 197, 94, 0.8);
    position: relative;
    margin-top: 15px;
    /* Space for name */
}

.message-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
    display: block;
}

.bot-message-wrapper,
.admin-message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 80%;
    align-self: flex-end;
}

.user-message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 80%;
    align-self: flex-start;
}

/* Welcome Chips */
.chat-options {
    display: none;
}

.chat-options-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.question-chip {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    background: linear-gradient(135deg, #0f76f2 0%, #2563eb 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #f8fafc;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    white-space: normal;
    text-align: center;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.18);
}

.question-chip:hover {
    background: linear-gradient(135deg, #2563eb 0%, #0f76f2 100%);
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.26);
}

.question-chip:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.28);
}

.question-chip.representative-chip {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #f0fdf4;
}

.question-chip.representative-chip:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 18px 32px rgba(16, 185, 129, 0.3);
}

.message.question-card {
    max-width: 100%;
}

.question-card {
    background: #eef4ff;
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 24px;
    padding: 18px 18px 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.question-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.question-card-subtitle {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 14px;
}

.question-chip-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-option {
    animation: fadeInUp 0.3s ease;
}

.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    gap: 10px;
    align-items: center;
    background: #ffffff;
}

#chat-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 0.95rem;
    outline: none;
}

#chat-input::placeholder {
    color: rgba(15, 23, 42, 0.45);
}

#chat-input:focus {
    border-color: #00C6FF;
    box-shadow: 0 0 0 2px rgba(0, 198, 255, 0.2);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 198, 255, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100vw - 40px);
        top: 20px;
        right: 20px;
        bottom: 20px;
        height: auto;
        max-height: calc(100vh - 40px);
        border-radius: 18px;
    }

    .chat-float {
        bottom: 80px;
        right: 20px;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 198, 255, 0.5);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 198, 255, 0.7);
}

.chat-option {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}