<?xml version="1.0" encoding="UTF-8"?>
<window>
    <!-- Default focus na tlačítko Přehrát -->
    <defaultcontrol>5000</defaultcontrol>
    <onload>ClearProperty(WCS.Details.HasTrailer,Home)</onload>
    <onload>Control.SetFocus(5000)</onload>
    <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>
        <!-- Neviditelné button pro zachování kompatibility -->
        <control type="button" id="5001">
            <width>1</width>
            <height>1</height>
            <left>-2000</left>
            <top>-2000</top>
            <visible>false</visible>
        </control>
        <!-- Fanart pozadí -->
        <control type="image">
            <left>0</left>
            <top>0</top>
            <width>1920</width>
            <height>1080</height>
            <texture background="true">$INFO[Window.Property(WCS.Details.Fanart)]</texture>
            <aspectratio>scale</aspectratio>
        </control>
        <!-- Ztmavení pozadí -->
        <control type="image">
            <left>0</left>
            <top>0</top>
            <width>1920</width>
            <height>1080</height>
            <texture colordiffuse="A0000000">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
        </control>
        <!-- Poster Group -->
        <control type="group" id="poster_group">
            <left>50</left> <top>200</top> <width>300</width> <height>450</height>
            <control type="image">
                <left>0</left> <top>0</top> <width>300</width> <height>450</height>
                <texture background="true">$INFO[Window.Property(WCS.Details.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>
            <animation effect="slide" start="-400,0" end="0,0" time="300" tween="cubic" easing="out">WindowOpen</animation>
            <animation effect="slide" start="0,0" end="-400,0" time="300" tween="cubic" easing="in">WindowClose</animation>
        </control>

        <!-- Info Group -->
        <control type="group" id="info_group">
            <left>380</left> <top>200</top> <width>1490</width> <height>310</height>
            <!-- Title + Year -->
            <control type="label">
                <left>0</left> <top>0</top> <width>1490</width> <height>60</height>
                <font>font60</font> <textcolor>white</textcolor> <shadowcolor>black</shadowcolor>
                <label>$INFO[Window.Property(WCS.Details.Title)] ($INFO[Window.Property(WCS.Details.Year)])</label>
            </control>
            <!-- Rating / Runtime / Certification -->
            <control type="grouplist">
                <left>0</left> <top>110</top> <width>1490</width> <height>33</height>
                <orientation>horizontal</orientation> <itemgap>15</itemgap> <usecontrolcoords>true</usecontrolcoords>
                <!-- Hodnocení -->
                <control type="label">
                    <width>auto</width>
                    <height>30</height>
                    <font>font13</font>
                    <textcolor>white</textcolor>
                    <label>$INFO[Window.Property(WCS.Details.Rating)]</label>
                    <visible>!String.IsEmpty(Window.Property(WCS.Details.Rating))</visible>
                </control>
                <!-- Délka / Počet epizod pro seriály -->
                <control type="label">
                    <width>auto</width>
                    <height>30</height>
                    <font>font13</font>
                    <textcolor>white</textcolor>
                    <label>$INFO[Window.Property(WCS.Details.Runtime)]</label>
                    <visible>!String.IsEmpty(Window.Property(WCS.Details.Runtime))</visible>
                </control>
                <!-- Certifikace -->
                <control type="label">
                     <width>auto</width>
                     <height>30</height>
                     <font>font13</font>
                     <textcolor>grey</textcolor>
                     <label>$INFO[Window.Property(WCS.Details.Certification)]</label>
                     <visible>!String.IsEmpty(Window.Property(WCS.Details.Certification))</visible>
                </control>
                <!-- Status pro seriály -->
                <control type="label">
                     <width>auto</width>
                     <height>30</height>
                     <font>font13</font>
                     <textcolor>grey</textcolor>
                     <label>$INFO[Window.Property(WCS.Details.Status)]</label>
                     <visible>!String.IsEmpty(Window.Property(WCS.Details.Status))</visible>
                </control>
            </control>
            <!-- Tagline pod titulem -->
            <control type="label">
                <left>0</left> <top>73</top> <width>1490</width> <height>36</height>
                <font>font16_italic</font> <textcolor>FFB0B0B0</textcolor>
                <label>$INFO[Window.Property(WCS.Details.Tagline)]</label>
                <visible>!String.IsEmpty(Window.Property(WCS.Details.Tagline))</visible>
            </control>
            <!-- Metadata horizontálně -->
            <control type="grouplist" id="4000">
                <left>0</left> <top>312</top> <width>1490</width> <height>36</height>
                <orientation>horizontal</orientation> <itemgap>25</itemgap> <usecontrolcoords>true</usecontrolcoords>
                <!-- Žánr -->
                <control type="label">
                    <width>auto</width> <height>30</height> <font>font10</font> <textcolor>FFAAAAAA</textcolor>
                    <label>$INFO[Window.Property(WCS.Details.Genre)]</label>
                    <visible>!String.IsEmpty(Window.Property(WCS.Details.Genre))</visible>
                </control>
                <!-- Režie pro filmy -->
                <control type="label">
                    <width>auto</width> <height>30</height> <font>font10</font> <textcolor>FFAAAAAA</textcolor>
                    <label>$INFO[Window.Property(WCS.Details.Director)]</label>
                    <visible>!String.IsEmpty(Window.Property(WCS.Details.Director)) + String.IsEqual(Window.Property(WCS.Details.MediaType),movie)</visible>
                </control>
                <!-- Tvůrci pro seriály -->
                <control type="label">
                    <width>auto</width> <height>30</height> <font>font10</font> <textcolor>FFAAAAAA</textcolor>
                    <label>$INFO[Window.Property(WCS.Details.Creators)]</label>
                    <visible>!String.IsEmpty(Window.Property(WCS.Details.Creators)) + String.IsEqual(Window.Property(WCS.Details.MediaType),tv)</visible>
                </control>
                <!-- Scénář -->
                <control type="label">
                    <width>auto</width> <height>30</height> <font>font10</font> <textcolor>FFAAAAAA</textcolor>
                    <label>$INFO[Window.Property(WCS.Details.Writer)]</label>
                    <visible>!String.IsEmpty(Window.Property(WCS.Details.Writer))</visible>
                </control>
                <!-- Studio -->
                <control type="label">
                    <width>auto</width> <height>30</height> <font>font10</font> <textcolor>FFAAAAAA</textcolor>
                    <label>Studio: $INFO[Window.Property(WCS.Details.Studio)]</label>
                    <visible>!String.IsEmpty(Window.Property(WCS.Details.Studio))</visible>
                </control>
            </control>
            <animation effect="slide" start="1540,0" end="0,0" time="300" delay="100" tween="cubic" easing="out">WindowOpen</animation>
            <animation effect="slide" start="0,0" end="1540,0" time="300" delay="100" tween="cubic" easing="in">WindowClose</animation>
        </control>

        <!-- Actions Group -->
        <control type="group" id="actions_group">
            <left>380</left> <top>508</top> <width>1490</width> <height>142</height>
            <control type="list" id="5000">
                <left>0</left>
                <top>48</top> <!-- Pozice, kde byla původně group s tlačítky -->
                <width>1490</width>
                <height>90</height>
                <onleft>5000</onleft>
                <onright>5000</onright>
                <onup>4000</onup>
                <ondown>400</ondown>
                <align>center</align>
                <orientation>horizontal</orientation>
                <scrolltime tween="quadratic">200</scrolltime>
                <itemlayout height="90" width="245">
                    <control type="image">
                        <top>0</top>
                        <width>240</width>
                        <height>90</height>
                        <texture border="21" colordiffuse="90232323">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
                    </control>
                    <control type="image">
                        <top>10</top>
                        <left>102</left>
                        <width>36</width>
                        <height>36</height>
                        <texture>$INFO[ListItem.Icon]</texture>
                        <aspectratio>keep</aspectratio>
                    </control>
                    <control type="label">
                        <top>50</top>
                        <left>10</left>
                        <width>220</width>
                        <height>30</height>
                        <align>center</align>
                        <aligny>center</aligny>
                        <font>font12</font>
                        <textcolor>white</textcolor>
                        <label>$INFO[ListItem.Label]</label>
                    </control>
                </itemlayout>
                <focusedlayout height="90" width="245">
                    <control type="image">
                        <top>0</top>
                        <width>240</width>
                        <height>90</height>
                        <texture border="21" colordiffuse="90232323">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
                        <visible>!Control.HasFocus(5000)</visible>
                    </control>
                    <control type="image">
                        <top>0</top>
                        <width>240</width>
                        <height>90</height>
                        <texture border="21" colordiffuse="button_focus">special://home/addons/plugin.video.milionar/resources/media/white.png</texture>
                        <visible>Control.HasFocus(5000)</visible>
                    </control>
                    <control type="image">
                        <top>10</top>
                        <left>102</left>
                        <width>36</width>
                        <height>36</height>
                        <texture>$INFO[ListItem.Icon]</texture>
                        <aspectratio>keep</aspectratio>
                    </control>
                    <control type="label">
                        <top>50</top>
                        <left>10</left>
                        <width>220</width>
                        <height>30</height>
                        <align>center</align>
                        <aligny>center</aligny>
                        <font>font12</font>
                        <textcolor>white</textcolor>
                        <label>$INFO[ListItem.Label]</label>
                    </control>
                    <control type="image">
                        <left>0</left>
                        <top>0</top>
                        <width>240</width>
                        <height>90</height>
                        <bordersize>8</bordersize>
                        <bordertexture colordiffuse="button_focus">colors/white.png</bordertexture>
                        <animation effect="slide" start="0,20" end="0,0" time="200" tween="cubic" easing="out" reversible="true">Focus</animation>
                        <animation effect="slide" start="0,0" end="0,20" time="200" tween="cubic" easing="out" reversible="true">UnFocus</animation>
                    </control>
                </focusedlayout>
                <content>
                    <!-- Tlačítko Přehrát - POUZE PRO FILMY -->
                    <item>
                        <label>Přehrát</label>
                        <icon>icons/infodialogs/play.png</icon>
                        <onclick>Control.SetFocus(5001)</onclick>
                        <onclick>SendClick(5001)</onclick>
                        <id>5001</id>
                        <visible>String.IsEqual(Window.Property(WCS.Details.MediaType),movie)</visible>
                    </item>
                    <!-- Tlačítko Hrát hru - PRO FILMY I SERIÁLY -->
                    <item>
                        <label>Hrát hru</label>
                        <icon>special://home/addons/plugin.video.milionar/resources/media/icons/Games.png</icon>
                        <onclick condition="String.IsEqual(Window.Property(WCS.Details.MediaType),movie)">RunPlugin(plugin://plugin.video.milionar?action=milionar_game&amp;tmdb_id=$INFO[Window.Property(WCS.Details.ID)]&amp;title=$INFO[Window.Property(WCS.Details.Title)]&amp;fanart=$INFO[Window.Property(WCS.Details.Fanart)])</onclick>
                        <onclick condition="String.IsEqual(Window.Property(WCS.Details.MediaType),tv)">RunPlugin(plugin://plugin.video.milionar?action=milionar_game&amp;tmdb_id=$INFO[Window.Property(WCS.Details.ID)]&amp;title=$INFO[Window.Property(WCS.Details.Title)]&amp;fanart=$INFO[Window.Property(WCS.Details.Fanart)]&amp;media_type=tv)</onclick>
                        <id>5015</id>
                    </item>
                    <!-- Tlačítko Přidat do seznamu - PRO FILMY -->
                    <item>
                        <label>Moje filmy</label>
                        <icon>icons/infodialogs/record.png</icon>
                        <onclick>RunPlugin(plugin://plugin.video.milionar?action=tmdb_add_movie_to_list&amp;tmdb_id=$INFO[Window.Property(WCS.Details.ID)]&amp;title=$INFO[Window.Property(WCS.Details.Title)])</onclick>
                        <id>5002</id>
                        <visible>String.IsEqual(Window.Property(WCS.Details.MediaType),movie)</visible>
                    </item>
                    <!-- Tlačítko Přidat do seznamu - PRO SERIÁLY -->
                    <item>
                        <label>Moje seriály</label>
                        <icon>special://home/addons/plugin.video.milionar/resources/media/icons/TVShows.png</icon>
                        <onclick>RunPlugin(plugin://plugin.video.milionar?action=tmdb_add_series_to_list&amp;tmdb_id=$INFO[Window.Property(WCS.Details.ID)]&amp;name=$INFO[Window.Property(WCS.Details.Title)])</onclick>
                        <id>5002</id>
                        <visible>String.IsEqual(Window.Property(WCS.Details.MediaType),tv)</visible>
                    </item>
                    <!-- Tlačítko Přidat do knihovny Kodi - RŮZNĚ PRO FILMY A SERIÁLY -->
                    <item>
                        <label>Knihovna Kodi</label>
                        <icon>icons/infodialogs/install.png</icon>
                        <onclick condition="String.IsEqual(Window.Property(WCS.Details.MediaType),movie)">RunPlugin(plugin://plugin.video.milionar?action=check_library_settings_and_add&amp;media_type=movie&amp;movie_id=$INFO[Window.Property(WCS.Details.ID)])</onclick>
                        <onclick condition="String.IsEqual(Window.Property(WCS.Details.MediaType),tv)">RunPlugin(plugin://plugin.video.milionar?action=check_library_settings_and_add&amp;media_type=series&amp;series_id=$INFO[Window.Property(WCS.Details.ID)])</onclick>
                        <id>5003</id>
                        <visible>!String.IsEqual(Window.Property(WCS.Details.SkinMilionar),1)</visible>
                    </item>
                    <!-- Tlačítko Režisér - POUZE PRO FILMY -->
                    <item>
                        <label>Režisér</label>
                        <icon>icons/infodialogs/director.png</icon>
                        <id>5004</id>
                        <onclick>RunPlugin(plugin://plugin.video.milionar?action=display_director_dialog&amp;director_id=$INFO[Window.Property(WCS.Details.DirectorID)]&amp;director_name=$INFO[Window.Property(WCS.Details.Director)])</onclick>
                        <visible>!String.IsEmpty(Window.Property(WCS.Details.DirectorID)) + String.IsEqual(Window.Property(WCS.Details.MediaType),movie)</visible>
                    </item>
                    <!-- Tlačítko Tvůrci - POUZE PRO SERIÁLY -->
                    <item>
                        <label>Tvůrci</label>
                        <icon>icons/infodialogs/director.png</icon>
                        <id>5008</id>
                        <onclick>RunPlugin(plugin://plugin.video.milionar?action=display_series_creators_dialog&amp;tmdb_id=$INFO[Window.Property(WCS.Details.ID)]&amp;title=$INFO[Window.Property(WCS.Details.Title)])</onclick>
                        <visible>!String.IsEmpty(Window.Property(WCS.Details.Creators)) + String.IsEqual(Window.Property(WCS.Details.MediaType),tv)</visible>
                    </item>
                    <!-- Tlačítko Kolekce - POUZE PRO FILMY -->
                    <item>
                        <label>Kolekce</label>
                        <icon>icons/infodialogs/set.png</icon>
                        <id>5005</id>
                        <onclick>RunPlugin(plugin://plugin.video.milionar?action=display_collection_dialog&amp;collection_id=$INFO[Window.Property(WCS.Details.CollectionID)])</onclick>
                        <visible>!String.IsEmpty(Window.Property(WCS.Details.CollectionID)) + String.IsEqual(Window.Property(WCS.Details.MediaType),movie)</visible>
                    </item>
                    <!-- Tlačítko Podobné - RŮZNĚ PRO FILMY A SERIÁLY -->
                    <item>
                        <label condition="String.IsEqual(Window.Property(WCS.Details.MediaType),movie)">Podobné</label>
                        <label condition="String.IsEqual(Window.Property(WCS.Details.MediaType),tv)">Podobné</label>
                        <icon>icons/infodialogs/similar.png</icon>
                        <id>5007</id>
                        <onclick condition="String.IsEqual(Window.Property(WCS.Details.MediaType),movie)">RunPlugin(plugin://plugin.video.milionar?action=display_similar_movies_dialog&amp;tmdb_id=$INFO[Window.Property(WCS.Details.ID)]&amp;original_title=$INFO[Window.Property(WCS.Details.Title)])</onclick>
                        <onclick condition="String.IsEqual(Window.Property(WCS.Details.MediaType),tv)">RunPlugin(plugin://plugin.video.milionar?action=display_similar_series_dialog&amp;tmdb_id=$INFO[Window.Property(WCS.Details.ID)]&amp;original_title=$INFO[Window.Property(WCS.Details.Title)])</onclick>
                        <visible>!String.IsEmpty(Window.Property(WCS.Details.ID))</visible>
                    </item>
                </content>
            </control>
            <animation effect="slide" start="0,800" end="0,0" time="300" delay="200" tween="cubic" easing="out">WindowOpen</animation>
            <animation effect="slide" start="0,0" end="0,800" time="300" delay="200" tween="cubic" easing="in">WindowClose</animation>
        </control>

        <!-- Plot Group -->
        <control type="group" id="plot_group">
            <left>50</left> <top>680</top> <width>850</width> <height>350</height>
            <control type="textbox" id="400">
                <left>20</left>
                <top>4</top>
                <width>810</width> <!-- 1050 - 2*20 pro odsazení -->
                <height>342</height> <!-- 350 - 2*20 pro odsazení -->
                <label>$INFO[Window.Property(WCS.Details.Plot)]</label>
                <font>font13</font>
                <textcolor>FFDDDDDD</textcolor>
                <align>justify</align>
                <autoscroll delay="10000" time="5000" repeat="10000">true</autoscroll>
                <pagecontrol>401</pagecontrol> <!-- ID pro scrollbar -->
                <onup>5000</onup> <!-- Nahoru na tlačítka -->
                <ondown>50</ondown> <!-- Dolů na herce -->
                <onleft>400</onleft> <!-- Zůstat -->
                <onright>50</onright> <!-- Doprava na herce místo na metadata -->
            </control>
            <control type="scrollbar" id="401">
                <left>860</left>
                <top>0</top>
                <width>10</width>
                <height>350</height>
                <onleft>400</onleft>
                <onright>50</onright>
                <onup>401</onup>
                <ondown>401</ondown>
                <orientation>vertical</orientation>
                <showonepage>false</showonepage>
                <texturesliderbackground>-</texturesliderbackground>
                <texturesliderbar colordiffuse="40FFFFFF">special://home/addons/plugin.video.milionar/resources/media/white.png</texturesliderbar>
                <texturesliderbarfocus colordiffuse="button_focus">special://home/addons/plugin.video.milionar/resources/media/white.png</texturesliderbarfocus>
            </control>
            <animation effect="slide" start="-900,0" end="0,0" time="300" delay="300" tween="cubic" easing="out">WindowOpen</animation>
            <animation effect="slide" start="0,0" end="-900,0" time="300" delay="300" tween="cubic" easing="in">WindowClose</animation>
        </control>

        <!-- Actors Group -->
        <control type="group" id="actors_group">
            <left>920</left> <top>680</top> <width>920</width> <height>350</height>
            <control type="panel" id="50">
                <left>0</left>
                <top>0</top> <!-- Posunuto na začátek sekce, původní metadata zde již nejsou -->
                <width>920</width>
                <height>350</height> <!-- Zvětšená výška, využívá celý prostor -->
                <onup>5000</onup> <!-- Nahoru na tlačítka -->
                <ondown>5000</ondown> <!-- Dolů zpět na tlačítka -->
                <onleft>401</onleft> <!-- Doleva na scrollbar plotu -->
                <onright>50</onright> <!-- Cyklování -->
                <orientation>horizontal</orientation>
                <scrolltime>200</scrolltime>
                <itemgap>5</itemgap> <!-- Jen malá mezera mezi herci -->
                <!-- Layout pro herce (větší) -->
                <itemlayout height="343" width="243">
                     <control type="group">
                         <left>0</left>
                         <top>0</top>
                         <!-- Obrázek herce -->
                        <control type="image">
                             <left>0</left>
                             <top>0</top>
                             <width>238</width>
                             <height>276</height>
                             <texture background="true">$INFO[ListItem.Icon]</texture>
                             <aspectratio>keep</aspectratio>
                             <bordertexture border="3" colordiffuse="40000000">special://home/addons/plugin.video.milionar/resources/media/white.png</bordertexture>
                             <bordersize>4</bordersize>
                         </control>
                         <!-- Jméno herce -->
                         <control type="label">
                             <left>0</left>
                             <top>286</top>
                             <width>238</width>
                             <height>28</height>
                             <font>font12</font>
                             <textcolor>white</textcolor>
                             <align>center</align>
                             <label>$INFO[ListItem.Label]</label>
                         </control>
                         <!-- Jméno postavy -->
                         <control type="label">
                             <left>0</left>
                             <top>314</top>
                             <width>238</width>
                             <height>24</height>
                             <font>font10</font>
                             <textcolor>lightgrey</textcolor>
                             <align>center</align>
                             <label>$INFO[ListItem.Label2]</label>
                         </control>
                     </control>
                </itemlayout>
                <focusedlayout height="343" width="243">
                     <control type="group">
                         <left>0</left>
                         <top>0</top>
                        <!-- Obrázek herce -->
                        <control type="image">
                             <left>0</left>
                             <top>0</top>
                             <width>238</width>
                             <height>276</height>
                             <texture background="true">$INFO[ListItem.Icon]</texture>
                             <aspectratio>keep</aspectratio>
                             <bordertexture border="5" colordiffuse="button_focus">special://home/addons/plugin.video.milionar/resources/media/white.png</bordertexture>
                             <bordersize>4</bordersize>
                         </control>
                        <!-- Jméno herce -->
                         <control type="label">
                             <left>0</left>
                             <top>286</top>
                             <width>238</width>
                             <height>28</height>
                             <font>font12</font>
                             <textcolor>button_focus</textcolor>
                             <align>center</align>
                             <label>$INFO[ListItem.Label]</label>
                         </control>
                         <!-- Jméno postavy -->
                         <control type="label">
                             <left>0</left>
                             <top>314</top>
                             <width>238</width>
                             <height>24</height>
                             <font>font10</font>
                             <textcolor>lightgrey</textcolor>
                             <align>center</align>
                             <label>$INFO[ListItem.Label2]</label>
                         </control>
                     </control>
                     <control type="button">
                         <left>0</left>
                         <top>0</top>
                         <width>238</width>
                         <height>343</height>
                         <texturefocus>-</texturefocus>
                         <texturenofocus>-</texturenofocus>
                         <onclick>RunPlugin(plugin://plugin.video.milionar?action=display_actor_dialog&amp;actor_id=$INFO[ListItem.Property(tmdb_id)]&amp;actor_name=$INFO[ListItem.Label])</onclick>
                     </control>
                </focusedlayout>
            </control> <!-- Konec panel 50 -->
            <animation effect="slide" start="1540,0" end="0,0" time="300" delay="400" tween="cubic" easing="out">WindowOpen</animation>
            <animation effect="slide" start="0,0" end="1540,0" time="300" delay="400" tween="cubic" easing="in">WindowClose</animation>
        </control>
    </controls>
</window> 