/* ============================================
   FLOATING CHAT (Facebook Style)
   ============================================ */

/* Hide the old left sidebar chat on all devices */
.left-sidebar {
    display: none !important;
}

/* Floating Chat Button (Bottom Right) */
.floating-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3898dd 0%, #2980b9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(56, 152, 221, 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
    border: 3px solid white;
}

.floating-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(56, 152, 221, 0.6);
}

.floating-chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Notification Badge */
.chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Floating Chat Window */
.floating-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.floating-chat-window.open {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Window Header */
.floating-chat-header {
    background: linear-gradient(135deg, #3898dd 0%, #2980b9 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.floating-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-chat-title {
    font-weight: 600;
    font-size: 15px;
}

.floating-chat-online {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.floating-chat-online-dot {
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.floating-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 18px;
    line-height: 1;
}

.floating-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Area */
.floating-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
}

/* Custom Scrollbar */
.floating-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.floating-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.floating-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.floating-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Chat Message Bubble */
.floating-chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.floating-chat-msg img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.floating-chat-msg-content {
    background: white;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 70%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.floating-chat-msg-username {
    font-weight: 600;
    font-size: 12px;
    color: #3898dd;
    margin-bottom: 4px;
}

.floating-chat-msg-text {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    word-wrap: break-word;
}

.floating-chat-msg-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

/* Loading State */
.floating-chat-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 13px;
}

/* Chat Input Area */
.floating-chat-input-area {
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: center;
}

.floating-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.floating-chat-input:focus {
    border-color: #3898dd;
}

.floating-chat-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.floating-chat-send-btn {
    background: #3898dd;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.floating-chat-send-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: scale(1.05);
}

.floating-chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.floating-chat-send-btn svg {
    width: 18px;
    height: 18px;
}

/* Login Prompt */
.floating-chat-login {
    padding: 30px 20px;
    text-align: center;
}

.floating-chat-login p {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.floating-chat-login-btn {
    background: #3898dd;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.floating-chat-login-btn:hover {
    background: #2980b9;
}

/* Cooldown Text */
.floating-chat-cooldown {
    font-size: 11px;
    color: #ff4444;
    padding: 4px 12px;
    text-align: center;
}

/* ============================================
   RESPONSIVE - MOBILE & TABLET
   ============================================ */

/* Mobile (Portrait) */
@media (max-width: 600px) {
    .floating-chat-button {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
    }
    
    .floating-chat-button svg {
        width: 24px;
        height: 24px;
    }
    
    .floating-chat-window {
        width: calc(100vw - 32px);
        max-width: 400px;
        bottom: 80px;
        right: 16px;
        max-height: 500px;
    }
    
    .floating-chat-messages {
        max-height: 350px;
    }
}

/* Tablet */
@media (min-width: 601px) and (max-width: 900px) {
    .floating-chat-window {
        width: 340px;
        bottom: 85px;
    }
}

/* Desktop Large */
@media (min-width: 1400px) {
    .floating-chat-window {
        width: 380px;
        max-height: 600px;
    }
    
    .floating-chat-messages {
        max-height: 450px;
    }
}

/* Landscape Mobile */
@media (max-width: 900px) and (orientation: landscape) {
    .floating-chat-window {
        max-height: 350px;
    }
    
    .floating-chat-messages {
        max-height: 220px;
    }
}

/* Adjust main layout since we removed left sidebar */
@media (min-width: 769px) {
    .layout {
        justify-content: center;
    }
    
    .feed {
        max-width: 600px;
    }
}