/**
 * Audit Chatbot Styles
 * Version: 2.0
 */

.audit-chatbot {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f5f7;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.audit-chatbot .chat-header {
    background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.audit-chatbot .chat-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.audit-chatbot .chat-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.audit-chatbot .chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(108, 123, 149, 0.08) 0%, rgba(139, 157, 195, 0.06) 25%, rgba(168, 200, 236, 0.04) 50%, rgba(240, 244, 248, 0.05) 75%, rgba(248, 250, 252, 0.03) 100%);
}

.audit-chatbot .welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.audit-chatbot .welcome-message p {
    color: #1d1d1f;
    margin-bottom: 16px;
    line-height: 1.5;
}

.audit-chatbot .start-button {
    background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.audit-chatbot .start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.audit-chatbot .message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
}

.audit-chatbot .message.user {
    justify-content: flex-end;
}

.audit-chatbot .message.bot {
    justify-content: flex-start;
}

.audit-chatbot .message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.audit-chatbot .message.user .message-content {
    background: #007aff;
    color: white;
    border-bottom-right-radius: 4px;
}

.audit-chatbot .message.bot .message-content {
    background: #F4FAFF;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom-left-radius: 4px;
}

.audit-chatbot .message-time {
    font-size: 11px;
    color: #86868b;
    margin-top: 4px;
    text-align: right;
}

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

.audit-chatbot .chat-input-container {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.audit-chatbot .chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.audit-chatbot .chat-input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.audit-chatbot .send-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 20px;
    background: #007aff;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.audit-chatbot .send-button:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.audit-chatbot .send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.audit-chatbot .loading {
    padding: 16px 20px;
    text-align: center;
}

.audit-chatbot .typing-indicator {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.audit-chatbot .typing-dot {
    width: 8px;
    height: 8px;
    background: #007aff;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.audit-chatbot .typing-dot:nth-child(1) { animation-delay: -0.32s; }
.audit-chatbot .typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Calendar Overlay Styles */
.audit-chatbot .calendar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    box-sizing: border-box;
}

.audit-chatbot .calendar-overlay.show {
    display: flex;
    animation: fadeInCalendar 0.5s ease-in-out forwards;
}

@keyframes fadeInCalendar {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.audit-chatbot .calendar-overlay .calendar-header {
    text-align: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.audit-chatbot .calendar-overlay .calendar-header h4 {
    color: #1d1d1f;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.audit-chatbot .calendar-overlay .calendar-header p {
    color: #86868b;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

.audit-chatbot .calendar-iframe-container {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.audit-chatbot .calendar-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
    min-height: 500px;
}

.audit-chatbot .calendar-close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    z-index: 10;
}

.audit-chatbot .calendar-close-button:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .audit-chatbot .chat-messages {
        padding: 16px;
    }
    
    .audit-chatbot .message-content {
        max-width: 85%;
    }
    
    .audit-chatbot .chat-input-container {
        padding: 12px 16px;
    }

    .audit-chatbot .calendar-overlay {
        padding: 10px;
    }

    .audit-chatbot .calendar-overlay .calendar-header h4 {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .audit-chatbot .calendar-overlay .calendar-header p {
        font-size: 12px;
    }

    .audit-chatbot .calendar-close-button {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .audit-chatbot .calendar-iframe-container iframe {
        min-height: 400px;
    }
}

/* Dark theme variant */
.audit-chatbot.dark {
    background: #1c1c1e;
    color: #ffffff;
}

.audit-chatbot.dark .chat-messages {
    background: linear-gradient(135deg, rgba(28, 28, 30, 0.8) 0%, rgba(44, 44, 46, 0.6) 100%);
}

.audit-chatbot.dark .message.bot .message-content {
    background: #2c2c2e;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.audit-chatbot.dark .chat-input-container {
    background: rgba(28, 28, 30, 0.8);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.audit-chatbot.dark .chat-input {
    background: rgba(44, 44, 46, 0.9);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.audit-chatbot.dark .chat-input:focus {
    border-color: #007aff;
}
