/* ============================================
   CINEBITE AI CHATBOT STYLES
   Cinema-Optimized Dark Theme
   ============================================ */

/* ============================================
   CHAT BUTTON (Floating)
   ============================================ */
.cinebite-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4169E1, #1E90FF);
    border-radius: 50%;
    box-shadow:
        0 4px 20px rgba(65, 105, 225, 0.4),
        0 0 0 0 rgba(65, 105, 225, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: chatButtonPulse 2s ease-in-out infinite;
    border: none;
}

@keyframes chatButtonPulse {
    0%, 100% {
        box-shadow:
            0 4px 20px rgba(65, 105, 225, 0.4),
            0 0 0 0 rgba(65, 105, 225, 0.5);
    }
    50% {
        box-shadow:
            0 4px 30px rgba(65, 105, 225, 0.6),
            0 0 0 15px rgba(65, 105, 225, 0);
    }
}

.cinebite-chat-button:hover {
    transform: scale(1.1);
    box-shadow:
        0 6px 30px rgba(65, 105, 225, 0.6),
        0 0 0 0 rgba(65, 105, 225, 0.5);
}

.cinebite-chat-button:active {
    transform: scale(0.95);
}

.chat-button-icon {
    font-size: 28px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.cinebite-chat-button.active .chat-button-icon {
    transform: rotate(180deg);
}

/* Notification Badge */
.chat-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #FF4757, #FF6B81);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.5);
    animation: badgePop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   CHAT WINDOW
   ============================================ */
.cinebite-chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: linear-gradient(180deg, #0A1128 0%, #1C2541 100%);
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cinebite-chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ============================================
   CHAT HEADER
   ============================================ */
.chat-header {
    background: linear-gradient(135deg, #4169E1, #1E90FF);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #FFFFFF, #E8ECEF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.chat-header-info {
    flex: 1;
}

.chat-bot-name {
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 2px 0;
    letter-spacing: -0.2px;
}

.chat-bot-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #4ADE80;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 4px rgba(74, 222, 128, 0);
    }
}

.chat-close-button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-close-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* ============================================
   CHAT MESSAGES
   ============================================ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #0A1128;
    scrollbar-width: thin;
    scrollbar-color: rgba(65, 105, 225, 0.3) transparent;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(65, 105, 225, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(65, 105, 225, 0.5);
}

/* Message Bubble */
.chat-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease-out;
    max-width: 85%;
}

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

.chat-message.user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4169E1, #1E90FF);
    box-shadow: 0 2px 8px rgba(65, 105, 225, 0.3);
}

.chat-message.user .message-avatar {
    background: linear-gradient(135deg, #FFFFFF, #E8ECEF);
}

.message-content {
    flex: 1;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #FFFFFF;
    word-wrap: break-word;
}

.chat-message.bot .message-bubble {
    background: linear-gradient(135deg, #1C2541, #2D3E5F);
    border: 1px solid rgba(65, 105, 225, 0.2);
    border-bottom-left-radius: 4px;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #4169E1, #1E90FF);
    border-bottom-right-radius: 4px;
    text-align: right;
}

.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    padding: 0 4px;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.typing-indicator {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1C2541, #2D3E5F);
    border: 1px solid rgba(65, 105, 225, 0.2);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: fit-content;
    animation: messageSlideIn 0.3s ease-out;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #4169E1;
    border-radius: 50%;
    animation: typingDotBounce 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDotBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ============================================
   QUICK REPLY BUTTONS
   ============================================ */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    animation: messageSlideIn 0.3s ease-out;
}

.quick-reply-button {
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.15), rgba(30, 144, 255, 0.1));
    border: 1px solid rgba(65, 105, 225, 0.3);
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-reply-button:hover {
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.3), rgba(30, 144, 255, 0.2));
    border-color: rgba(65, 105, 225, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

.quick-reply-button:active {
    transform: translateY(0);
}

/* ============================================
   CHAT INPUT
   ============================================ */
.chat-input-container {
    padding: 16px 20px;
    background: #1C2541;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: rgba(10, 17, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-input:focus {
    background: rgba(10, 17, 40, 0.8);
    border-color: rgba(65, 105, 225, 0.5);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

.chat-send-button {
    background: linear-gradient(135deg, #4169E1, #1E90FF);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

.chat-send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(65, 105, 225, 0.4);
}

.chat-send-button:active:not(:disabled) {
    transform: translateY(0);
}

.chat-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   WELCOME SCREEN
   ============================================ */
.welcome-screen {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease-out;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: welcomeBounce 2s ease-in-out infinite;
}

@keyframes welcomeBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 12px 0;
}

.welcome-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.welcome-action-button {
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.2), rgba(30, 144, 255, 0.15));
    border: 1px solid rgba(65, 105, 225, 0.3);
    color: #FFFFFF;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.welcome-action-button:hover {
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.3), rgba(30, 144, 255, 0.25));
    border-color: rgba(65, 105, 225, 0.5);
    transform: translateX(4px);
}

.welcome-action-button span:first-child {
    font-size: 20px;
}

/* ============================================
   POWERED BY FOOTER
   ============================================ */
.chat-footer {
    padding: 12px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.powered-by {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.powered-by a {
    color: #4169E1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.powered-by a:hover {
    color: #1E90FF;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .cinebite-chat-window {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .cinebite-chat-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .chat-button-icon {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .chat-message {
        max-width: 90%;
    }

    .quick-reply-button {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.cinebite-chat-button:focus-visible,
.quick-reply-button:focus-visible,
.chat-send-button:focus-visible,
.chat-close-button:focus-visible,
.welcome-action-button:focus-visible {
    outline: 3px solid rgba(65, 105, 225, 0.5);
    outline-offset: 2px;
}

.chat-input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.3);
}
