/* Video Player Desktop Chat Styles */

/* Chat Full View Styling */
.chat-full-container {
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.chat-full-container .chat-header {
    background: #1f1f23;
    border-bottom: 1px solid #3f3f46;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-full-container .chat-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.chat-full-container .chat-header i {
    color: #007bff;
    margin-right: 8px;
}

.chat-full-container .chat-messages-area {
    flex: 1;
    overflow: hidden;
    background: #18181b;
}

.chat-full-container .chat-messages-area .playervideouserchat {
    height: 100%;
    padding: 15px;
    margin: 0;
    background: transparent;
    border: none;
    overflow-y: auto;
}

.chat-full-container .chat-input-section {
    background: #1f1f23;
    border-top: 1px solid #3f3f46;
    padding: 15px;
    flex-shrink: 0;
}

.chat-full-container .chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-full-container .chat-input {
    flex: 1;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    color: #fff;
    padding: 12px 15px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.chat-full-container .chat-input:focus {
    outline: none;
    border-color: #007bff;
    background: #1a1a1d;
}

.chat-full-container .chat-input::placeholder {
    color: #adadb8;
}

.chat-login-prompt {
    text-align: center;
    padding: 20px;
    color: #adadb8;
}

.chat-login-prompt a {
    color: #007bff;
    text-decoration: none;
}

.chat-login-prompt a:hover {
    text-decoration: underline;
}

/* Custom scrollbar for full chat */
.chat-full-container .playervideouserchat::-webkit-scrollbar {
    width: 6px;
}

.chat-full-container .playervideouserchat::-webkit-scrollbar-track {
    background: #2a2a2d;
}

.chat-full-container .playervideouserchat::-webkit-scrollbar-thumb {
    background: #53535f;
    border-radius: 3px;
}

.chat-full-container .playervideouserchat::-webkit-scrollbar-thumb:hover {
    background: #007bff;
}

/* Video wrapper with chat */
.video-with-chat-wrapper {
    max-width: 100% !important;
    width: 100% !important;
}

/* Video scaling when chat is open */
.chat-open .video-listing video,
.streaming-chat-desktop:visible ~ * .video-listing video {
    max-height: 500px;
    object-fit: contain;
}

/* Desktop: Side-by-side layout with chat */
@media (min-width: 768px) {
    .video-with-chat-wrapper {
        display: flex;
        width: 100%;
        transition: all 0.3s ease;
    }

    /* Default state - video takes full width when chat is hidden */
    .video-listing {
        flex: 1;
        min-width: 0;
        transition: flex 0.3s ease;
    }

    /* When chat is visible - video takes 75% */
    .video-with-chat-wrapper.chat-open {
        gap: 0;
    }

    .video-with-chat-wrapper.chat-open .video-listing {
        flex: 0 0 75%;
    }

    .streaming-chat-desktop {
        flex: 0 0 25%;
        min-width: 280px;
        animation: slideInRight 0.3s ease-out;
        transition: all 0.3s ease;
    }

    .streaming-chat-desktop .streaming-chat-container {
        height: 100%;
        border-radius: 0;
        border: 1px solid #3f3f46;
        border-left: 1px solid #3f3f46;
        border-right: none;
        border-top: none;
        border-bottom: none;
        min-height: 500px;
        max-height: 600px;
    }

    /* Ensure video matches chat height */
    .video-with-chat-wrapper.chat-open {
        display: flex;
        align-items: stretch;
    }

    .video-with-chat-wrapper.chat-open .video-listing {
        display: flex;
        align-items: center;
    }

    .video-with-chat-wrapper.chat-open #myvideo-1 {
        height: 100%;
        max-height: 600px;
    }

    /* When chat is open - adjust layout below video */
    .chat-open ~ .video-player-full-content .col-md-7 {
        max-width: 75%;
        flex: 0 0 75%;
        padding-right: 15px;
    }

    .chat-open ~ .video-player-full-content .col-md-5 {
        display: block;
        max-width: 25%;
        flex: 0 0 25%;
        padding-left: 0;
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .video-with-chat-wrapper.chat-open {
        gap: 0;
    }

    .streaming-chat-desktop {
        min-width: 250px;
    }

    .streaming-chat-desktop .streaming-chat-container {
        min-height: 400px;
    }
}

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

/* Streaming Chat Styles */
.streaming-chat-area {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

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

.streaming-chat-container {
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    overflow: hidden;
    height: 500px;
    display: flex;
    flex-direction: column;
}

/* Desktop Chat Specific Styling */
@media (min-width: 768px) {
    .streaming-chat-desktop .streaming-chat-container {
        height: 100%;
        min-height: 500px;
        max-height: 600px;
    }

    .streaming-chat-desktop .chat-header {
        padding: 4px 8px;
        background: #1f1f23;
        border-bottom: 1px solid #3f3f46;
        flex-shrink: 0;
        height: 28px;
    }

    .streaming-chat-desktop .chat-title {
        font-size: 11px;
        font-weight: 600;
        color: #fff;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .streaming-chat-desktop .chat-title i {
        font-size: 12px;
    }

    .streaming-chat-desktop .chat-close-btn {
        font-size: 12px;
        padding: 2px;
    }

    .streaming-chat-desktop .chat-messages {
        flex: 1;
        overflow: hidden;
        background: #18181b;
    }

    .streaming-chat-desktop .playervideouserchat {
        height: 100%;
        padding: 4px 6px;
        overflow-y: auto;
        background: transparent;
        border: none;
        margin: 0;
    }

    .streaming-chat-desktop .chat-input-area {
        padding: 5px 8px;
        background: #1f1f23;
        border-top: 1px solid #3f3f46;
        flex-shrink: 0;
        height: 32px;
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        width: 100%;
        z-index: auto;
    }

    .streaming-chat-desktop .chat-input {
        background: #18181b;
        border: 1px solid #3f3f46;
        border-radius: 3px;
        color: #fff;
        font-size: 12px;
        padding: 3px 6px;
        height: 22px;
    }

    .streaming-chat-desktop .chat-send-btn {
        background: #007bff;
        border: none;
        border-radius: 3px;
        color: #fff;
        padding: 3px 8px;
        font-size: 11px;
        margin-left: 6px;
        height: 22px;
    }

    .streaming-chat-desktop .chat-send-btn:hover {
        background: #0056b3;
    }

    /* Compact chat message styling for desktop side chat */
    .streaming-chat-desktop .leftchat,
    .streaming-chat-desktop .rightchat {
        margin-bottom: 0;
        font-size: 11px;
    }

    .streaming-chat-desktop .chatuserimg img {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        object-fit: cover;
    }

    .streaming-chat-desktop .chatuser-content p {
        margin: 0;
        padding: 2px 5px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        font-size: 11px;
        line-height: 1.25;
        word-wrap: break-word;
    }

    .streaming-chat-desktop .rightchat .chatuser-content p {
        background: rgba(0, 123, 255, 0.2);
        border: 1px solid rgba(0, 123, 255, 0.3);
    }
}
