/* 💬 CHAT DROPDOWN STYLES - Integrated under local video */

/* Wrapper for local video + chat */
.local-video-with-chat {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Container */
.chat-dropdown-container {
    position: relative;
    width: 100%;
    z-index: 10;
    margin-top: 0;
}

/* Minimized Bar */
.chat-minimized-bar {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(15, 20, 25, 0.95));
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.2);
}

.chat-minimized-bar:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 153, 255, 0.1));
    border-color: rgba(0, 212, 255, 0.7);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.3);
}

.chat-bar-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.chat-bar-icon {
    font-size: 20px;
    line-height: 1;
}

.chat-bar-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chat-notification-badge {
    background: linear-gradient(135deg, #ff6611, #ff8833);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 0 15px rgba(255, 102, 17, 0.6);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-bar-arrow {
    font-size: 14px;
    color: rgba(0, 212, 255, 0.8);
    transition: transform 0.3s ease;
}

.chat-minimized-bar.expanded .chat-bar-arrow {
    transform: rotate(180deg);
}

/* Expanded Panel */
.chat-expanded-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 100; /* 💬 FIX: assicura che la chat sia sopra tutto */
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(15, 20, 25, 0.95));
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 212, 255, 0.2);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: top;
    transform: scaleY(0);
}

.chat-expanded-panel.open {
    max-height: 400px;
    opacity: 1;
    transform: scaleY(1);
}

/* Panel Header */
.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 153, 255, 0.05));
}

.chat-panel-header h3 {
    margin: 0;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #00d4ff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.chat-close-btn:hover {
    background: rgba(255, 102, 17, 0.3);
    border-color: rgba(255, 102, 17, 0.5);
    color: #ff6611;
    transform: rotate(90deg);
}

/* Messages Area */
.chat-messages-new {
    padding: 12px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.4) rgba(0, 0, 0, 0.2);
}

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

.chat-messages-new::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages-new::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.4);
    border-radius: 3px;
}

.chat-messages-new::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.6);
}

/* Message Bubbles */
.chat-message {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    animation: messageSlideIn 0.3s ease-out;
}

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

.chat-message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 153, 255, 0.2));
    border: 1px solid rgba(0, 212, 255, 0.4);
    color: rgba(255, 255, 255, 0.95);
}

.chat-message.received {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.15));
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: rgba(255, 255, 255, 0.95);
}

/* Typing Indicator */
.typing-indicator-new {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(0, 212, 255, 0.8);
}

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

.typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(0, 212, 255, 0.8);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

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

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

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

.typing-text {
    font-family: 'Space Grotesk', sans-serif;
    font-style: italic;
}

/* Input Container */
.chat-input-container-new {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(0, 153, 255, 0.03));
}

.chat-input-new {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input-new:focus {
    border-color: rgba(0, 212, 255, 0.6);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

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

.chat-input-new:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn-new {
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.chat-send-btn-new:hover:not(:disabled) {
    background: linear-gradient(135deg, #00ffff, #00d4ff);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.chat-send-btn-new:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-expanded-panel.open {
        max-height: 350px;
    }

    .chat-messages-new {
        max-height: 200px;
    }
}

