/**
 * AI Chatbot Styles for INT Creative
 * Modern, responsive design with smooth animations
 */

/* ===== CHATBOT CONTAINER ===== */
.ai-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

/* ===== CHAT TOGGLE BUTTON ===== */
.chat-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--accent-moss) 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(11, 61, 46, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 40px rgba(11, 61, 46, 0.4);
}

.chat-toggle:active {
    transform: translateY(0) scale(0.98);
}

.chat-icon {
    position: relative;
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.chat-toggle:hover .chat-icon {
    transform: scale(1.1);
}

.chat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--soft-copper);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(11, 61, 46, 0.3);
    animation: chatPulse 2s infinite;
    pointer-events: none;
}

@keyframes chatPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* ===== CHAT WINDOW ===== */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(11, 61, 46, 0.1);
    overflow: hidden;
}

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

.ai-chatbot.chat-open .chat-toggle {
    transform: rotate(45deg);
}

/* ===== CHAT HEADER ===== */
.chat-header {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--accent-moss) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

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

.ai-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ai-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: statusBlink 2s infinite;
}

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

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== CHAT MESSAGES ===== */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--background-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--sage-green);
    border-radius: 2px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--accent-moss) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--sage-green);
    color: var(--deep-charcoal);
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(11, 61, 46, 0.08);
}

.user-message .message-content {
    background: var(--forest-green);
    color: white;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
    color: inherit;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.quick-action {
    background: var(--warm-beige);
    border: 1px solid var(--sage-green);
    color: var(--forest-green);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-action:hover {
    background: var(--forest-green);
    color: white;
    transform: translateY(-1px);
}

/* ===== MESSAGE ACTIONS ===== */
.message-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--accent-moss);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: var(--forest-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 61, 46, 0.3);
}

.action-btn.primary {
    background: var(--soft-copper);
}

.action-btn.primary:hover {
    background: var(--gold-ochre);
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: none;
    padding: 12px 20px;
    background: white;
    margin: 8px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sage-green);
    margin: 0 2px;
    animation: typingDots 1.5s infinite;
}

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

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

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

/* ===== CHAT INPUT AREA ===== */
.chat-input-area {
    padding: 16px 20px 20px;
    background: white;
    border-top: 1px solid rgba(11, 61, 46, 0.1);
}

.chat-input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    border: 2px solid var(--sage-green);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
    background: var(--background-light);
    color: var(--deep-charcoal);
    font-family: inherit;
}

#chat-input:focus {
    border-color: var(--forest-green);
    background: white;
}

#chat-input::placeholder {
    color: var(--sage-green);
}

#chat-send {
    background: var(--forest-green);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#chat-send:hover {
    background: var(--accent-moss);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 61, 46, 0.3);
}

#chat-send:active {
    transform: translateY(0);
}

/* ===== SUGGESTIONS ===== */
.chat-suggestions {
    margin-top: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.suggestion {
    padding: 8px 12px;
    background: var(--warm-beige);
    border: 1px solid var(--sage-green);
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--forest-green);
}

.suggestion:hover {
    background: var(--forest-green);
    color: white;
}

.suggestion:last-child {
    margin-bottom: 0;
}

/* ===== CONSULTATION MODAL ===== */
.consultation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--sage-green);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: var(--forest-green);
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--sage-green);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--forest-green);
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 6px;
    color: var(--forest-green);
    font-weight: 500;
    font-size: 14px;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--sage-green);
    border-radius: 8px;
    font-size: 14px;
    color: var(--deep-charcoal);
    background: var(--background-light);
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    border-color: var(--forest-green);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(11, 61, 46, 0.1);
}

.modal-body .btn-primary {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--accent-moss) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 8px;
}

.modal-body .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(11, 61, 46, 0.3);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .ai-chatbot {
        bottom: 16px;
        right: 16px;
    }
    
    .chat-window {
        width: calc(100vw - 32px);
        max-width: 380px;
        height: 70vh;
        max-height: 600px;
        bottom: 90px;
        right: 0;
    }
    
    .chat-toggle {
        width: 56px;
        height: 56px;
    }
    
    .chat-icon {
        font-size: 22px;
    }
    
    .consultation-modal {
        padding: 16px;
    }
    
    .modal-content {
        margin: 0;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 16px);
        height: 80vh;
        bottom: 80px;
        right: 8px;
        left: 8px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .quick-actions {
        gap: 6px;
    }
    
    .quick-action {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ===== ACCESSIBILITY ===== */
.chat-toggle:focus,
.chat-close:focus,
#chat-send:focus,
.quick-action:focus,
.action-btn:focus {
    outline: 3px solid var(--accent-moss);
    outline-offset: 2px;
}

.chat-window[aria-hidden="true"] {
    display: none;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .chat-window {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .chat-messages {
        background: #1a1a1a;
    }
    
    .message-content {
        background: #2a2a2a;
        color: #e5e5e5;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .typing-indicator {
        background: #2a2a2a;
    }
    
    .chat-input-area {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    #chat-input {
        background: #2a2a2a;
        color: #e5e5e5;
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    #chat-input::placeholder {
        color: #888;
    }
    
    .modal-content {
        background: #1a1a1a;
        color: #e5e5e5;
    }
    
    .modal-body input,
    .modal-body select,
    .modal-body textarea {
        background: #2a2a2a;
        color: #e5e5e5;
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* ===== ANIMATIONS FOR BETTER UX ===== */
.ai-chatbot * {
    box-sizing: border-box;
}

.chat-window {
    will-change: transform, opacity;
}

.message {
    will-change: transform, opacity;
}

/* Smooth scrollbar for better experience */
.chat-messages {
    scroll-behavior: smooth;
} 