/**
 * DEX CHAT - STYLING
 * 
 * Moderne chat interface met:
 * - Smooth animations
 * - Typing indicator
 * - Responsive design
 * - Purple branding (matching XtremeOffice)
 */

/* ====================================================================
   CHAT BUTTON (in header)
   ==================================================================== */

.dex-chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dex-chat-button:hover {
    transform: scale(2.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.dex-chat-button img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
}

.dex-chat-button.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(102, 126, 234, 0.8); }
    100% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4); }
}

/* ====================================================================
   CHAT POPUP
   ==================================================================== */

.dex-chat-popup {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    overflow: hidden;
}

.dex-chat-popup.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ====================================================================
   HEADER
   ==================================================================== */

.dex-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 20px 20px 0 0;
}

.dex-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.dex-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dex-chat-title {
    flex: 1;
}

.dex-chat-title h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.dex-chat-status {
    margin: 5px 0 0 0;
    font-size: 0.85em;
    opacity: 0.9;
}

.dex-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

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

/* ====================================================================
   MESSAGES AREA
   ==================================================================== */

.dex-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

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

.dex-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

/* ====================================================================
   MESSAGES
   ==================================================================== */

.dex-message {
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.dex-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.dex-message-user {
    flex-direction: row-reverse;
}

.dex-message-assistant {
    flex-direction: row;
}

.dex-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.dex-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dex-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95em;
    line-height: 1.5;
    word-wrap: break-word;
}

.dex-message-user .dex-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.dex-message-assistant .dex-message-content {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.dex-message-system {
    justify-content: center;
}

.dex-message-system .dex-message-content {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    font-size: 0.85em;
    text-align: center;
    max-width: 90%;
}

/* ====================================================================
   TYPING INDICATOR
   ==================================================================== */

.dex-chat-typing {
    display: flex;
    gap: 10px;
    padding: 0 20px 10px 20px;
    background: #f9fafb;
}

.dex-chat-typing span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* ====================================================================
   PRODUCT LINKS
   ==================================================================== */

.dex-product-links {
    margin-top: 10px;
}

.dex-product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.dex-product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: block;
}

.dex-product-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.dex-product-brand {
    font-size: 0.8em;
    color: #6b7280;
    margin-bottom: 4px;
}

.dex-product-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.dex-product-price {
    color: #667eea;
    font-weight: 700;
    font-size: 1em;
}

/* ====================================================================
   INPUT AREA
   ==================================================================== */

.dex-chat-input-wrapper {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.dex-chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 0.95em;
    outline: none;
    transition: all 0.2s;
}

.dex-chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dex-chat-input::placeholder {
    color: #9ca3af;
}

.dex-chat-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dex-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.dex-chat-send:active {
    transform: scale(0.95);
}

/* ====================================================================
   FOOTER
   ==================================================================== */

.dex-chat-footer {
    padding: 10px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #6b7280;
    font-size: 0.85em;
    border-radius: 0 0 20px 20px;
}

/* ====================================================================
   BANNED SCREEN
   ==================================================================== */

.dex-banned-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    height: 100%;
}

.dex-banned-avatar {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.dex-banned-screen h3 {
    color: #dc2626;
    margin-bottom: 15px;
}

.dex-banned-screen p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 10px;
}

.dex-banned-screen a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.dex-banned-screen a:hover {
    text-decoration: underline;
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */

@media (max-width: 768px) {
    .dex-chat-popup {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .dex-chat-popup.open {
        transform: none;
    }
    
    .dex-chat-header {
        border-radius: 0;
    }
    
    .dex-chat-button {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    
    .dex-chat-button img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .dex-message-content {
        max-width: 85%;
        font-size: 0.9em;
    }
}

/* ====================================================================
   ANIMATIONS
   ==================================================================== */

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

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

/* Smooth scrollbar voor Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
