/* ============================================================
 * WATCHROOM — стилі віджету кімнат спільного перегляду
 * /templates/default/css/watchroom.css
 * ============================================================ */

.watchroom-widget {
    position: relative;
    display: inline-block;
    margin: 10px 0;
    font-family: inherit;
}

.watchroom-create-btn {
    padding: 8px 16px;
    background: #3F51B5;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}
.watchroom-create-btn:hover { background: #303F9F; }

.watchroom-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    width: 290px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
}

.watchroom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.watchroom-close {
    cursor: pointer;
    color: #999;
    font-size: 16px;
    line-height: 1;
}
.watchroom-close:hover { color: #333; }

.watchroom-action-btn {
    width: 100%;
    padding: 8px;
    margin: 6px 0;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}
.watchroom-action-btn:hover { background: #43A047; }

.watchroom-divider {
    text-align: center;
    color: #999;
    font-size: 11px;
    margin: 8px 0;
}

#watchroom-join-input {
    width: 100%;
    padding: 7px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 6px;
    text-align: center;
    text-transform: lowercase;
    font-size: 13px;
}

.watchroom-code-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}
.watchroom-code-row code {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.watchroom-code-row button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.watchroom-online {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.watchroom-host-badge {
    font-size: 12px;
    color: #FF9800;
    font-weight: bold;
    margin-bottom: 8px;
}

.watchroom-sync-banner {
    font-size: 12px;
    padding: 6px 8px;
    background: #fff3e0;
    border-left: 3px solid #FF9800;
    border-radius: 0 4px 4px 0;
    margin-bottom: 8px;
}

.watchroom-leave-btn {
    width: 100%;
    padding: 7px;
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 4px;
}
.watchroom-leave-btn:hover { background: #e53935; }

/* ── Чат ── */
.watchroom-chat {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.watchroom-chat-messages {
    height: 140px;
    overflow-y: auto;
    font-size: 12px;
    margin-bottom: 6px;
    padding: 4px;
    background: #fafafa;
    border-radius: 4px;
}

.watchroom-chat-messages .chat-msg {
    margin-bottom: 6px;
    word-break: break-word;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.watchroom-chat-messages .chat-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: #ddd;
    margin-top: 1px;
}
.watchroom-chat-messages .chat-msg-body {
    flex: 1;
    min-width: 0;
}
.watchroom-chat-messages .chat-msg .chat-user {
    font-weight: bold;
    color: #3F51B5;
}
.watchroom-chat-messages .chat-msg.chat-own .chat-user {
    color: #4CAF50;
}
.watchroom-chat-messages .chat-msg .chat-time {
    color: #aaa;
    font-size: 10px;
    margin-left: 4px;
}
.watchroom-chat-messages .chat-system {
    color: #999;
    font-style: italic;
    text-align: center;
    font-size: 11px;
}


.watchroom-chat-input-row {
    display: flex;
    gap: 4px;
}
.watchroom-chat-input-row input {
    flex: 1;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}
.watchroom-chat-input-row button {
    padding: 6px 12px;
    background: #3F51B5;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.watchroom-chat-input-row button:hover { background: #303F9F; }

/* ── Список активних кімнат (опційний блок) ── */
.watchroom-active-list {
    margin: 10px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
}
.watchroom-active-list .wal-title {
    font-weight: bold;
    margin-bottom: 6px;
}
.watchroom-active-list .wal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #fff;
    border-radius: 4px;
    margin-bottom: 4px;
}
.watchroom-active-list .wal-item button {
    padding: 4px 10px;
    background: #3F51B5;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

/* ── Мобільна адаптація ── */
@media (max-width: 480px) {
    .watchroom-panel {
        width: 90vw;
        left: 50%;
        transform: translateX(-50%);
    }
}
