<?xml version="1.0" encoding="UTF-8"?>
<window type="dialog">
    <defaultcontrol always="true">50</defaultcontrol>
    
    <!-- Transparent Background - No Overlay -->
    <!-- Window Animation: Slide In/Out from Right (Matches AI Chat Sidebar) -->
    <animation effect="slide" start="600,0" end="0,0" time="400" tween="cubic" easing="out">WindowOpen</animation>
    <animation effect="slide" start="0,0" end="600,0" time="300" tween="cubic" easing="in">WindowClose</animation>
    
    <controls>
        <!-- Full Height Sidebar Group (Right Side) -->
        <control type="group">
            <left>1320</left> <!-- 1920 - 600 -->
            <top>0</top>
            <width>600</width>
            <height>1080</height>
            
            <!-- Slide Animation (From Right) -->
            <animation effect="slide" start="600,0" end="0,0" time="400" tween="cubic" easing="out">WindowOpen</animation>
            <animation effect="slide" start="0,0" end="600,0" time="400" tween="cubic" easing="out">WindowClose</animation>

            <!-- Sidebar Background (Dark Semi-Transparent) -->
            <control type="image">
                <left>0</left> <top>0</top> <width>600</width> <height>1080</height>
                <texture colordiffuse="F2101010">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
            </control>

            <!-- Header -->
            <control type="label">
                <left>30</left> <top>60</top> <width>540</width> <height>40</height>
                <label>Výběr streamu</label>
                <font>font30_title</font>
                <textcolor>button_focus</textcolor>
            </control>
            
            <control type="label">
                <left>30</left> <top>100</top> <width>540</width> <height>30</height>
                <label>$INFO[Window.Property(WCS.Search.Info)]</label>
                <font>font12</font>
                <textcolor>grey</textcolor>
            </control>

            <!-- List (Streams) -->
            <control type="list" id="50">
                <left>0</left> <top>140</top> <width>600</width> <height>900</height>
                <onup>100</onup>
                <ondown>50</ondown>
                <onleft>Back</onleft> <!-- Standard Back action -->
                <onright>60</onright>
                <orientation>vertical</orientation>
                <scrolltime>200</scrolltime>
                <pagecontrol>60</pagecontrol>
                
                <itemlayout height="45" width="600">
                    <!-- Safe Visibility Density: Quality | Dubbing | Filename | Size -->
                    <control type="group">
                        <left>0</left> <top>0</top> <width>600</width> <height>45</height>
                        
                        <!-- Quality Badge -->
                        <control type="label">
                            <left>10</left> <top>0</top> <width>90</width> <height>45</height>
                            <label>$INFO[ListItem.Property(quality)]</label>
                            <font>font10</font>
                            <textcolor>FFCCCCCC</textcolor>
                            <align>left</align> <aligny>center</aligny>
                            <scroll>false</scroll>
                        </control>

                        <!-- Dubbing Indicator -->
                        <control type="label">
                            <left>100</left> <top>0</top> <width>80</width> <height>45</height>
                            <label>$INFO[ListItem.Property(language)]</label>
                            <font>font10</font>
                            <textcolor>FF66DD66</textcolor>
                            <align>left</align> <aligny>center</aligny>
                            <scroll>false</scroll>
                        </control>
                        
                        <!-- Filename -->
                        <control type="label">
                            <left>185</left> <top>0</top> <width>310</width> <height>45</height>
                            <label>$INFO[ListItem.Property(filename)]</label>
                            <font>font10</font>
                            <textcolor>grey</textcolor>
                            <align>left</align> <aligny>center</aligny>
                        </control>
                        
                        <!-- Size -->
                        <control type="label">
                            <left>505</left> <top>0</top> <width>85</width> <height>45</height>
                            <label>$INFO[ListItem.Property(size_formatted)]</label>
                            <font>font10</font>
                            <textcolor>grey</textcolor>
                            <align>right</align> <aligny>center</aligny>
                            <scroll>false</scroll>
                        </control>
                    </control>
                </itemlayout>
                
                <focusedlayout height="45" width="600">
                     <!-- Focused Style -->
                     <control type="group">
                        
                        <!-- Focus Background -->
                        <control type="image">
                            <left>0</left><top>0</top><width>600</width><height>45</height>
                            <texture colordiffuse="10FFFFFF">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
                        </control>

                        <!-- Marker Bar -->
                        <control type="image">
                            <left>0</left> <top>0</top> <width>5</width> <height>45</height>
                            <texture colordiffuse="button_focus">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
                        </control>

                        <!-- Quality Badge -->
                        <control type="label">
                            <left>10</left> <top>0</top> <width>90</width> <height>45</height>
                            <label>$INFO[ListItem.Property(quality)]</label>
                            <font>font10</font>
                            <textcolor>white</textcolor>
                            <align>left</align> <aligny>center</aligny>
                            <shadowcolor>black</shadowcolor>
                            <scroll>false</scroll>
                        </control>

                        <!-- Dubbing Indicator -->
                        <control type="label">
                            <left>100</left> <top>0</top> <width>80</width> <height>45</height>
                            <label>$INFO[ListItem.Property(language)]</label>
                            <font>font10</font>
                            <textcolor>FF66DD66</textcolor>
                            <shadowcolor>black</shadowcolor>
                            <align>left</align> <aligny>center</aligny>
                            <scroll>false</scroll>
                        </control>
                        
                        <!-- Filename -->
                        <control type="label">
                            <left>185</left> <top>0</top> <width>310</width> <height>45</height>
                            <label>$INFO[ListItem.Property(filename)]</label>
                            <font>font10</font>
                            <textcolor>white</textcolor>
                            <shadowcolor>black</shadowcolor>
                            <align>left</align> <aligny>center</aligny>
                            <scroll>true</scroll>
                        </control>
                        
                        <!-- Size -->
                        <control type="label">
                            <left>505</left> <top>0</top> <width>85</width> <height>45</height>
                            <label>$INFO[ListItem.Property(size_formatted)]</label>
                            <font>font10</font>
                            <textcolor>button_focus</textcolor>
                            <align>right</align> <aligny>center</aligny>
                            <scroll>false</scroll>
                        </control>
                     </control>
                </focusedlayout>
            </control>

            <!-- Scrollbar -->
            <control type="scrollbar" id="60">
                <left>590</left> <top>140</top> <width>10</width> <height>900</height>
                <onleft>50</onleft>
                <onright>50</onright>
                <orientation>vertical</orientation>
            </control>

            <!-- Hidden Controls for Logic Compatibility -->
             <control type="button" id="100">
                <visible>true</visible>
                <left>-2000</left><top>0</top><width>10</width><height>10</height>
                <label>Play Best</label>
                <ondown>50</ondown><onright>50</onright><onleft>50</onleft><onup>50</onup>
            </control>
             <control type="button" id="101">
                <visible>true</visible>
                <left>-2000</left><top>0</top><width>10</width><height>10</height>
                <label>DL</label>
                <ondown>50</ondown><onright>50</onright><onleft>50</onleft><onup>50</onup>
            </control>
             <control type="button" id="102">
                <visible>true</visible>
                <left>-2000</left><top>0</top><width>10</width><height>10</height>
                <label>Game</label>
                <ondown>50</ondown><onright>50</onright><onleft>50</onleft><onup>50</onup>
            </control>
        </control>
    </controls>
</window>
