/* ========================================
   Master Assets Cloud - AI Chatbot Styles
   Professional Modern Design
   ======================================== */

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e4002b 0%, #b8001f 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 15px rgba(228, 0, 43, 0.4),
        0 8px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9998;
    overflow: hidden;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    border-radius: 50%;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow:
        0 6px 20px rgba(228, 0, 43, 0.5),
        0 12px 40px rgba(0, 0, 0, 0.2);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-toggle i {
    font-size: 24px;
    color: white;
    transition: all 0.3s ease;
}

.chatbot-toggle.active i.fa-robot {
    transform: rotate(180deg) scale(0);
    opacity: 0;
}

.chatbot-toggle.active i.fa-times {
    transform: rotate(0) scale(1);
    opacity: 1;
}

.chatbot-toggle i.fa-times {
    position: absolute;
    transform: rotate(-180deg) scale(0);
    opacity: 0;
}

/* Notification Badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #27ae60;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    border: 2px solid white;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 150px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chatbot-container.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #e4002b 0%, #b8001f 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.chatbot-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.chatbot-avatar i {
    font-size: 24px;
    color: white;
}

.chatbot-avatar .status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #27ae60;
    border-radius: 50%;
    border: 2px solid #e4002b;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(39, 174, 96, 0);
    }
}

.chatbot-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.chatbot-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 3px;
}

.chatbot-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-status i {
    font-size: 8px;
    color: #27ae60;
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.chatbot-header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Chat Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Message Bubble */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlide 0.3s ease forwards;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #e4002b, #b8001f);
    color: white;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.message.bot .message-bubble {
    background: white;
    color: #1a1a2e;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #e4002b, #b8001f);
    color: white;
    border-bottom-right-radius: 6px;
}

.message-time {
    font-size: 11px;
    color: #8c8c9c;
    padding: 0 5px;
}

.message.user .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 10px;
    align-self: flex-start;
    max-width: 85%;
}

.typing-indicator .message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e4002b, #b8001f);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-dots {
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    display: flex;
    gap: 5px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #e4002b;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    40% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Quick Suggestions */
.quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.suggestion-chip {
    padding: 8px 14px;
    background: #f1f3f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    color: #5a5a6e;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.suggestion-chip:hover {
    background: #e4002b;
    color: white;
    border-color: #e4002b;
    transform: translateY(-2px);
}

.suggestion-chip i {
    font-size: 11px;
}

/* Chat Input Area */
.chatbot-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chatbot-input-wrapper {
    flex: 1;
    position: relative;
}

.chatbot-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    font-size: 14px;
    color: #1a1a2e;
    background: #f8f9fc;
    outline: none;
    transition: all 0.2s ease;
    resize: none;
    max-height: 100px;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #e4002b;
    background: white;
    box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
}

.chatbot-input::placeholder {
    color: #8c8c9c;
}

.input-actions {
    position: absolute;
    right: 10px;
    bottom: 8px;
    display: flex;
    gap: 5px;
}

.input-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #8c8c9c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-action-btn:hover {
    color: #e4002b;
    background: rgba(228, 0, 43, 0.1);
}

.chatbot-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e4002b, #b8001f);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(228, 0, 43, 0.4);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

.chatbot-send-btn i {
    font-size: 16px;
    transform: translateX(1px);
}

/* Action Cards in Messages */
.action-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-card:hover {
    background: white;
    border-color: #e4002b;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.action-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(228, 0, 43, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e4002b;
}

.action-card-content {
    flex: 1;
}

.action-card-title {
    font-weight: 500;
    color: #1a1a2e;
    font-size: 13px;
}

.action-card-desc {
    font-size: 11px;
    color: #8c8c9c;
}

.action-card-arrow {
    color: #8c8c9c;
    font-size: 12px;
}

/* Asset Info Card in Chat */
.asset-info-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
}

.asset-info-header {
    background: linear-gradient(135deg, #f8f9fc, #e8eaf0);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.asset-info-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(228, 0, 43, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e4002b;
    font-size: 18px;
}

.asset-info-title {
    flex: 1;
}

.asset-info-title h4 {
    font-size: 14px;
    color: #1a1a2e;
    margin: 0;
}

.asset-info-title span {
    font-size: 11px;
    color: #e4002b;
    font-weight: 600;
}

.asset-info-body {
    padding: 12px 15px;
}

.asset-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f9;
    font-size: 13px;
}

.asset-info-row:last-child {
    border-bottom: none;
}

.asset-info-row .label {
    color: #8c8c9c;
}

.asset-info-row .value {
    color: #1a1a2e;
    font-weight: 500;
}

.asset-info-actions {
    display: flex;
    gap: 8px;
    padding: 12px 15px;
    border-top: 1px solid #e2e8f0;
}

.asset-action-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 12px;
    color: #5a5a6e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.asset-action-btn:hover {
    background: #e4002b;
    color: white;
    border-color: #e4002b;
}

/* Voice Recording Animation */
.voice-recording {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(228, 0, 43, 0.05);
    border-radius: 25px;
}

.voice-waves {
    display: flex;
    gap: 3px;
    align-items: center;
}

.voice-waves span {
    width: 3px;
    height: 20px;
    background: #e4002b;
    border-radius: 3px;
    animation: voiceWave 0.5s infinite alternate;
}

.voice-waves span:nth-child(1) {
    animation-delay: 0s;
    height: 12px;
}

.voice-waves span:nth-child(2) {
    animation-delay: 0.1s;
    height: 20px;
}

.voice-waves span:nth-child(3) {
    animation-delay: 0.2s;
    height: 16px;
}

.voice-waves span:nth-child(4) {
    animation-delay: 0.3s;
    height: 24px;
}

.voice-waves span:nth-child(5) {
    animation-delay: 0.4s;
    height: 14px;
}

@keyframes voiceWave {
    from {
        transform: scaleY(0.5);
        opacity: 0.5;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

.voice-timer {
    font-size: 14px;
    color: #e4002b;
    font-weight: 500;
}

.voice-cancel-btn {
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #e4002b;
    background: transparent;
    color: #e4002b;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-cancel-btn:hover {
    background: #e4002b;
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-container {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chatbot-container {
        background: #1a1a2e;
    }

    .chatbot-messages {
        background: #0f0f1a;
    }

    .message.bot .message-bubble {
        background: #252542;
        color: #ffffff;
    }

    .quick-suggestions {
        background: #1a1a2e;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .suggestion-chip {
        background: #252542;
        border-color: rgba(255, 255, 255, 0.1);
        color: #9ca3af;
    }

    .chatbot-input-area {
        background: #1a1a2e;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .chatbot-input {
        background: #252542;
        border-color: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .action-card {
        background: #252542;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .asset-info-card {
        background: #252542;
        border-color: rgba(255, 255, 255, 0.1);
    }
}