/**
 * Iris Chatbot - Reusable Chat Component Styles
 * Mirador del Golf - Real Estate Virtual Assistant
 */

.iris-chatbot-container {
    position: fixed;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.iris-chatbot-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.iris-chatbot-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.iris-chatbot-container.top-right {
    top: 20px;
    right: 20px;
}

.iris-chatbot-container.top-left {
    top: 20px;
    left: 20px;
}

.iris-toggle-button {
    width: 60px;
    height: 60px;
    background: #007bff;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.iris-toggle-button:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.6);
}

.iris-toggle-button.iris-active {
    background: #dc3545;
}

.iris-toggle-button.iris-active:hover {
    background: #c82333;
}

.iris-chat-window {
    position: absolute;
    width: 350px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
}

.iris-chatbot-container.bottom-right .iris-chat-window {
    bottom: 80px;
    right: 0;
}

.iris-chatbot-container.bottom-left .iris-chat-window {
    bottom: 80px;
    left: 0;
}

.iris-chatbot-container.top-right .iris-chat-window {
    top: 80px;
    right: 0;
}

.iris-chatbot-container.top-left .iris-chat-window {
    top: 80px;
    left: 0;
}

.iris-chat-window.iris-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.iris-chat-header {
    background: #1e3c72;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.iris-chat-title h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.iris-chat-title p {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
}

.iris-chat-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.iris-theme-toggle,
.iris-close-button {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.3s ease;
}

.iris-theme-toggle:hover,
.iris-close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.iris-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.iris-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: irisFadeInUp 0.3s ease;
    line-height: 1.4;
}

.iris-bot-message {
    background: #e9ecef;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.iris-user-message {
    background: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.iris-typing-indicator {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: #e9ecef;
    border-radius: 18px;
    align-self: flex-start;
    max-width: 80px;
    margin-left: 20px;
}

.iris-typing-dot {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: irisTyping 1.4s infinite ease-in-out;
}

.iris-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.iris-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.iris-chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

.iris-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
    color: #1f2937 !important; /* ensure dark text on light theme */
    background: #ffffff !important;
}

.iris-chat-input:focus {
    border-color: #007bff;
}

.iris-chat-input::placeholder {
    color: #6b7280 !important; /* slate-500 */
}

.iris-send-button {
    width: 45px;
    height: 45px;
    background: #007bff;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.iris-send-button:hover {
    background: #0056b3;
}

.iris-send-button:active {
    transform: scale(0.95);
}

.iris-special-buttons {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

.iris-special-button {
    flex: 1;
    background: #343a40;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.iris-special-button:hover {
    background: #495057;
    transform: translateY(-1px);
}

.iris-add-button {
    width: 40px;
    height: 40px;
    background: #343a40;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.iris-add-button:hover {
    background: #495057;
    transform: scale(1.1);
}

/* Dark theme */
.iris-dark-theme .iris-chat-window {
    background: #2d3748;
    color: white;
}

.iris-dark-theme .iris-chat-header {
    background: #1a202c;
}

.iris-dark-theme .iris-chat-messages {
    background: #1a202c;
}

.iris-dark-theme .iris-bot-message {
    background: #4a5568;
    color: white;
}

.iris-dark-theme .iris-chat-input-container {
    background: #2d3748;
    border-top-color: #4a5568;
}

.iris-dark-theme .iris-chat-input {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
    color: white !important;
}

.iris-dark-theme .iris-chat-input::placeholder {
    color: #a0aec0 !important;
}

.iris-dark-theme .iris-typing-indicator {
    background: #4a5568;
}

.iris-dark-theme .iris-special-buttons {
    background: #1a202c;
    border-top-color: #4a5568;
}

/* Animations */
@keyframes irisFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes irisTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 480px) {
    .iris-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        max-width: 350px;
    }
    
    .iris-chatbot-container.bottom-right,
    .iris-chatbot-container.bottom-left {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .iris-chatbot-container.bottom-right .iris-chat-window,
    .iris-chatbot-container.bottom-left .iris-chat-window {
        bottom: 80px;
        right: 0;
        left: 0;
    }
}

/* Custom scrollbar */
.iris-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.iris-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

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

/* Highlight effect */
.iris-highlight {
    outline: 3px solid #ffcc00 !important;
    outline-offset: 2px;
    transition: outline 0.3s ease;
    animation: irisPulse 1s ease-in-out;
}

@keyframes irisPulse {
    0%, 100% { outline-color: #ffcc00; }
    50% { outline-color: #ffdd44; }
}

/* Streaming message effect */
.iris-streaming {
    position: relative;
}

.iris-streaming::after {
    content: '|';
    animation: irisBlink 1s infinite;
    color: #007bff;
    font-weight: bold;
}

@keyframes irisBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Suggested replies */
.iris-suggested-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 0;
    width: 100%;
}

.iris-suggestion-button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
    line-height: 1.3;
    max-width: 100%;
    width: 100%;
    margin-bottom: 8px;
}

.iris-suggestion-button:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
}

.iris-suggestion-button:active {
    transform: translateY(0);
}

/* Notifications */
.iris-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    word-wrap: break-word;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.iris-notification-success {
    background: #28a745;
}

.iris-notification-error {
    background: #dc3545;
}

.iris-notification-info {
    background: #007bff;
}

/* Disabled state for inputs */
.iris-chat-input:disabled,
.iris-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dark theme adjustments for new elements */
.iris-dark-theme .iris-suggestion-button {
    background: #4a5568;
    border-color: #6c757d;
    color: #e9ecef;
}

.iris-dark-theme .iris-suggestion-button:hover {
    background: #5a6578;
    border-color: #007bff;
    color: #007bff;
}
