/* Public Styles for WC Agora Live Stream */

.agora-livestream-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.livestream-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Video Container */
.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

#agora-video-player {
    width: 100%;
    height: 100%;
}

.stream-info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    z-index: 10;
}

.stream-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.live {
    background: #ff0000;
    color: #fff;
    animation: pulse 2s infinite;
}

.status-badge.scheduled {
    background: #ffa500;
    color: #fff;
}

.status-badge.ended {
    background: #666;
    color: #fff;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.stream-title {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.video-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.control-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.control-btn .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* Chat Container */
.chat-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 400px;
}

.chat-header {
    padding: 15px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 8px 12px;
    background: #f7f7f7;
    border-radius: 6px;
    animation: slideIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.host {
    background: #e7f3ff;
    border-left: 3px solid #2271b1;
}

.chat-username {
    font-weight: 600;
    color: #2271b1;
    font-size: 13px;
    margin-right: 5px;
}

.chat-message.host .chat-username {
    color: #d63638;
}

.chat-text {
    color: #333;
    font-size: 14px;
    word-wrap: break-word;
}

.chat-timestamp {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#send-chat-btn {
    padding: 8px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

#send-chat-btn:hover {
    background: #135e96;
}

.login-prompt {
    text-align: center;
    margin: 0;
    padding: 10px;
}

.login-prompt a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

/* Products Sidebar */
.products-sidebar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.products-list {
    padding: 15px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s;
}

.product-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-image {
    margin-bottom: 10px;
    text-align: center;
}

.product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.product-info {
    text-align: center;
}

.product-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.product-price {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #2271b1;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-actions .button {
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.view-product-btn {
    background: #f7f7f7;
    color: #333;
    border: 1px solid #ddd;
}

.view-product-btn:hover {
    background: #efefef;
}

.add-to-cart-btn {
    background: #2271b1;
    color: #fff;
}

.add-to-cart-btn:hover {
    background: #135e96;
}

.like-btn {
    background: #fff;
    color: #d63638;
    border: 1px solid #d63638;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.like-btn:hover {
    background: #d63638;
    color: #fff;
}

.like-btn.liked {
    background: #d63638;
    color: #fff;
}

.like-btn .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.no-products {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Loading */
.stream-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #fff;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .agora-livestream-container {
        grid-template-columns: 1fr;
    }

    .products-sidebar {
        max-width: 100%;
    }

    .products-list {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .agora-livestream-container {
        padding: 10px;
        gap: 10px;
    }

    .stream-title {
        font-size: 18px;
    }

    .product-actions {
        flex-direction: column;
    }

    .chat-container {
        height: 300px;
    }
}