<?xml version="1.0" encoding="UTF-8"?>
<window id="1150" type="dialog">
    <modality>modal</modality>
    <defaultcontrol always="true">5000</defaultcontrol> <!-- Fokus na seznam filmů -->

    <coordinates>
        <left>160</left> 
        <top>100</top>  
        <width>1600</width>
        <height>880</height> 
    </coordinates>

    <onload>ClearProperty(WCS.Collection.Name,Home)</onload>
    <onload>ClearProperty(WCS.Collection.Poster,Home)</onload>
    <onload>ClearProperty(WCS.Collection.Plot,Home)</onload>
    <onload>ClearProperty(WCS.SelectedItem.Plot,self)</onload> <!-- Vyčistit plot při načtení -->

    <animation effect="slide" start="0,1080" end="0,0" time="400" tween="cubic" easing="out">WindowOpen</animation>
    <animation effect="slide" start="0,0" end="0,1080" time="400" tween="cubic" easing="out">WindowClose</animation>

    <controls>
        <!-- Pozadí dialogu (ztmavení) -->
        <control type="image">
            <left>-160</left> 
            <top>-100</top> 
            <width>1920</width>
            <height>1080</height>
            <texture colordiffuse="F0121212">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
            <animation effect="fade" start="0" end="100" time="300">WindowOpen</animation>
            <animation effect="fade" start="100" end="0" time="300">WindowClose</animation>
        </control>

        <control type="image">
            <left>0</left>
            <top>0</top>
            <width>1600</width>
            <height>880</height> 
            <texture border="10" colordiffuse="DD232323">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
        </control>

        <!-- Horní část: Detaily kolekce -->
        <control type="group">
            <left>20</left> 
            <top>20</top>
            <width>1560</width> 
            <height>230</height>

            <!-- Plakát kolekce -->
            <control type="image">
                <left>0</left><top>0</top><width>180</width><height>230</height>
                <texture background="true" fallback="DefaultVideo.png">$INFO[Window.Property(WCS.Collection.Poster)]</texture>
                <aspectratio>keep</aspectratio>
                <bordertexture border="5" colordiffuse="40FFFFFF">special://home/addons/plugin.video.milionar/resources/media/white.png</bordertexture>
                <bordersize>5</bordersize>
            </control>

            <!-- Název a popis kolekce -->
            <control type="group">
                <left>200</left><top>0</top><width>1360</width><height>230</height>
                <control type="label">
                    <left>0</left><top>10</top><width>1360</width><height>50</height>
                    <font>font30</font><textcolor>white</textcolor><shadowcolor>black</shadowcolor>
                    <label>$INFO[Window.Property(WCS.Collection.Name)]</label>
                    <align>left</align><aligny>top</aligny>
                </control>
                <control type="textbox">
                    <left>0</left><top>70</top><width>1360</width><height>150</height>
                    <font>font13</font><textcolor>grey</textcolor>
                    <label>$INFO[Window.Property(WCS.Collection.Plot)]</label>
                    <align>justify</align>
                    <autoscroll delay="8000" time="4000" repeat="8000">true</autoscroll>
                </control>
            </control>
        </control>

        <!-- Spodní část: Vertikální seznam filmů (vlevo) a detaily (vpravo) -->
        <control type="group">
            <left>20</left>
            <top>270</top> <!-- 20 (padding) + 230 (výška horní části) + 20 (mezera) -->
            <width>1560</width>
            <height>590</height> 

            <!-- Levá část: Vertikální seznam filmů -->
            <control type="group">
                <left>0</left>
                <top>0</top>
                <width>600</width> <!-- Šířka pro seznam -->
                <height>590</height>

                <control type="list" id="5000">
                    <left>0</left>
                    <top>0</top>
                    <width>600</width>
                    <height>586</height> <!-- Původně 570 -> 580 -> 586 -->
                    <onleft>noop</onleft> 
                    <onright>6000</onright> <!-- Fokus na skupinu detailů vpravo -->
                    <onup>5000</onup> 
                    <ondown>5000</ondown> 
                    <orientation>vertical</orientation>
                    <scrolltime tween="cubic" easing="out">200</scrolltime>
                    <preloaditems>2</preloaditems>
                    <itemgap>5</itemgap>
                    <pagecontrol>5001</pagecontrol> <!-- ID scrollbaru -->

                    <itemlayout height="100" width="600">
                        <control type="image"> <!-- Malý poster -->
                            <left>10</left><top>5</top><width>60</width><height>90</height>
                            <texture background="true" fallback="DefaultVideo.png">$INFO[ListItem.Art(thumb)]</texture>
                            <aspectratio>keep</aspectratio>
                        </control>
                        <control type="label"> <!-- Název filmu -->
                            <left>85</left><top>15</top><width>495</width><height>40</height>
                            <font>font13</font><textcolor>white</textcolor>
                            <label>$INFO[ListItem.Label]</label>
                        </control>
                        <control type="label"> <!-- Rok -->
                            <left>85</left><top>55</top><width>495</width><height>30</height>
                            <font>font12</font><textcolor>grey</textcolor>
                            <label>$INFO[ListItem.Property(year)]</label>
                        </control>
                         <!-- Neviditelné tlačítko pro zachycení kliknutí -->
                        <control type="button" id="5010">
                            <left>0</left><top>0</top><width>100%</width><height>100%</height>
                            <texturefocus>-</texturefocus><texturenofocus>-</texturenofocus>
                        </control>
                    </itemlayout>

                    <focusedlayout height="100" width="600">
                        <control type="image"> <!-- Pozadí fokusu -->
                            <width>100%</width><height>100%</height>
                            <texture colordiffuse="button_focus">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
                        </control>
                        <control type="image"> <!-- Malý poster -->
                            <left>10</left><top>5</top><width>60</width><height>90</height>
                            <texture background="true" fallback="DefaultVideo.png">$INFO[ListItem.Art(thumb)]</texture>
                            <aspectratio>keep</aspectratio>
                        </control>
                        <control type="label"> <!-- Název filmu -->
                            <left>85</left><top>15</top><width>495</width><height>40</height>
                            <font>font13</font><textcolor>white</textcolor>
                            <label>$INFO[ListItem.Label]</label>
                        </control>
                        <control type="label"> <!-- Rok -->
                            <left>85</left><top>55</top><width>495</width><height>30</height>
                            <font>font12</font><textcolor>white</textcolor> <!-- Světlejší rok při fokusu -->
                            <label>$INFO[ListItem.Property(year)]</label>
                        </control>
                        <control type="button" id="5010">
                            <left>0</left><top>0</top><width>100%</width><height>100%</height>
                            <texturefocus>-</texturefocus><texturenofocus>-</texturenofocus>
                        </control>
                    </focusedlayout>
                </control>
                <control type="scrollbar" id="5001">
                    <left>585</left> <!-- U pravého okraje seznamu -->
                    <top>0</top>
                    <width>15</width>
                    <height>586</height> <!-- Původně 570 -> 580 -> 586 -->
                    <onleft>5000</onleft><onright>noop</onright>
                    <orientation>vertical</orientation>
                    <showonepage>false</showonepage>
                    <texturesliderbackground colordiffuse="40FFFFFF">...</texturesliderbackground>
                    <texturesliderbar colordiffuse="button_focus">...</texturesliderbar>
                    <texturesliderbarfocus colordiffuse="button_focus">...</texturesliderbarfocus>
                </control>
            </control>

            <!-- Pravá část: Detaily vybraného filmu -->
            <control type="group" id="6000">
                <left>620</left> <!-- 600 (šířka seznamu) + 20 (mezera) -->
                <top>0</top>
                <width>940</width> <!-- 1560 (celková šířka) - 600 - 20 -->
                <height>590</height>
                <visible>!String.IsEmpty(Container(5000).ListItem.Label)</visible> <!-- Zobrazit jen když je něco vybráno -->

                <!-- Poster vybraného filmu -->
                <control type="image">
                    <left>0</left><top>0</top>
                    <width>380</width> <!-- Změna šířky pro poměr stran -->
                    <height>586</height> <!-- Původně 570 -> 580 -> 586 -->
                    <texture background="true" fallback="DefaultVideo.png">$INFO[Container(5000).ListItem.Art(poster)]</texture>
                    <aspectratio>keep</aspectratio>
                    <bordertexture border="5" colordiffuse="30FFFFFF">special://home/addons/plugin.video.milionar/resources/media/white.png</bordertexture>
                    <bordersize>5</bordersize>
                </control>

                <!-- Metadata vedle posteru -->
                <control type="group">
                    <left>400</left> <!-- Nová pozice (380 + 20) -->
                    <top>0</top>
                    <width>540</width> <!-- Nová šířka (940 - 400) -->
                    <height>590</height>

                    <control type="label" id="6001"> <!-- Název vybraného filmu -->
                        <left>0</left><top>10</top><width>100%</width><height>40</height>
                        <font>font16_bold</font><textcolor>white</textcolor><shadowcolor>black</shadowcolor>
                        <label>$INFO[Container(5000).ListItem.Label]</label>
                        <wrapmultiline>true</wrapmultiline>
                        <onleft>5000</onleft> <!-- Zpět na seznam -->
                    </control>
                    
                    <control type="label"> <!-- Rok vydání -->
                        <left>0</left><top>55</top><width>100%</width><height>25</height>
                        <font>font12</font><textcolor>grey</textcolor>
                        <label>$INFO[Container(5000).ListItem.Property(year)]</label>
                    </control>

                    <control type="label"> <!-- Hodnocení -->
                        <left>0</left><top>85</top><width>100%</width><height>25</height>
                        <font>font12</font><textcolor>grey</textcolor>
                        <label>Hodnocení: $INFO[Container(5000).ListItem.Rating] / 10</label>
                        <visible>!String.IsEmpty(Container(5000).ListItem.Rating)</visible>
                    </control>

                    <control type="label"> <!-- Režisér -->
                        <left>0</left><top>115</top><width>100%</width><height>25</height>
                        <font>font12</font><textcolor>grey</textcolor>
                        <label>Režie: $INFO[Container(5000).ListItem.Director]</label>
                        <visible>!String.IsEmpty(Container(5000).ListItem.Director)</visible>
                    </control>

                    <control type="label"> <!-- Scenárista -->
                        <left>0</left><top>145</top><width>100%</width><height>25</height>
                        <font>font12</font><textcolor>grey</textcolor>
                        <label>Scénář: $INFO[Container(5000).ListItem.Writer]</label>
                        <visible>!String.IsEmpty(Container(5000).ListItem.Writer)</visible>
                    </control>

                    <control type="textbox" id="6002">
                        <left>0</left><top>180</top><width>100%</width><height>406</height> <!-- Původně 390 -> 400 -> 406 -->
                        <font>font12</font><textcolor>FFDDDDDD</textcolor>
                        <label>$INFO[Container(5000).ListItem.Plot]</label>
                        <align>justify</align>
                        <autoscroll delay="10000" time="5000" repeat="10000">true</autoscroll>
                        <pagecontrol>6003</pagecontrol>
                    </control>
                    <control type="scrollbar" id="6003">
                        <left>525</left> <!-- Nová pozice (540 - 15) -->
                        <top>180</top><width>15</width><height>406</height> <!-- Původně 390 -> 400 -> 406 -->
                        <onleft>6002</onleft><onright>noop</onright>
                        <orientation>vertical</orientation><showonepage>false</showonepage>
                        <texturesliderbackground colordiffuse="40FFFFFF">...</texturesliderbackground>
                        <texturesliderbar colordiffuse="button_focus">...</texturesliderbar>
                        <texturesliderbarfocus colordiffuse="button_focus">...</texturesliderbarfocus>
                    </control>
                </control>
            </control>
        </control>
    </controls>
</window> 