/**
 * ========================================
 * GALAXY MEDIA - LIVE CHAT STYLES
 * Additional CSS for Chat System
 * Version: 3.0.7 - Clean (no size overrides)
 * ========================================
 */

/* ========================================
   CHAT FLOAT BUTTON
   Size controlled by Tailwind classes in HTML
   ======================================== */

#chat-float-btn {
    /* No width/height - controlled by Tailwind */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

#chat-float-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.5);
}

#chat-float-btn:active {
    transform: scale(0.95);
}

#chat-float-btn i {
    /* No font-size - controlled by Tailwind text-lg/xl/2xl/3xl */
}

/* Unread Badge on Float Button */
#chat-unread-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

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

#chat-popup-container {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    width: 620px;
    height: 560px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    animation: chatPopupSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop: Position at top-right */
@media (min-width: 1280px) {
    #chat-popup-container {
        top: 5rem;
        bottom: auto;
        right: 1.5rem;
        max-height: calc(100vh - 6rem);
    }
}

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

#chat-popup-container.hidden {
    display: none !important;
}

/* ========================================
   CHAT LIST SIDEBAR (Admin)
   ======================================== */

#chat-list-sidebar {
    /* 240px width - balanced for desktop */
    width: 240px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* ========================================
   CHAT INPUT & SEND BUTTON
   ======================================== */

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

#chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#chat-send-btn:active {
    transform: scale(0.95);
}

#chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#chat-send-btn i {
    font-size: 1rem;
}

/* ========================================
   BACK BUTTON (Admin only)
   ======================================== */

/* Force hide back button by default - will be shown for admin mobile via JS */
#chat-back-to-list {
    display: none !important;
}

/* Admin mobile: back button will be shown via inline style (style.display = 'flex') */
/* User: always hidden via JS + this CSS backup */

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 640px) {
    #chat-popup-container {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: 100%;
        max-height: 100%;
    }
    
    #chat-list-sidebar {
        width: 160px;
    }
    
    #chat-send-btn {
        width: 40px;
        height: 40px;
    }
}

/* Tablet (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    #chat-popup-container {
        width: 380px;
        height: 550px;
    }
    
    #chat-list-sidebar {
        width: 180px;
    }
}

/* Desktop Large (1025px - 1599px) */
@media (min-width: 1025px) and (max-width: 1599px) {
    #chat-popup-container {
        width: 620px;
        height: 650px;
    }
}

/* Desktop XL (≥1600px) */
@media (min-width: 1600px) {
    #chat-popup-container {
        width: 720px;
        height: 700px;
    }
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    #chat-float-btn,
    #chat-popup-container {
        display: none !important;
    }
}
