/* css/style.css */

/* === 1. DEFINICE FONTU (Glyphicons Halflings) === */
@font-face {
    font-family: 'Glyphicons Halflings';
    src: url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),
         url('../fonts/glyphicons-halflings-regular.woff') format('woff'),
         url('../fonts/glyphicons-halflings-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* === 2. PROMĚNNÉ === */
:root {
    /* Tyto hodnoty budou přepsány inline stylem z PHP, 
       ale nastavíme defaultní modrou pro jistotu */
    --theme-main: #3333CC;
    --theme-light: #dceaf7;
    --left-col-width: 170px;
}

/* === ZÁKLAD === */
* { box-sizing: border-box; }
html, body { 
    height: 100%; margin: 0; padding: 0; 
    background: #d4d0c8 url('../images/background.gif'); 
    font-family: Tahoma, Verdana, sans-serif; 
    font-size: 9pt; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
}

/* === HLAVNÍ STRUKTURA HLAVIČKY === */
#header-container { width: 100%; flex-shrink: 0; display: flex; flex-direction: column; }
#header-top-split { display: flex; width: 100%; }
.left-column-fixed { width: var(--left-col-width); min-width: var(--left-col-width); border-right: none; margin-right: 0px; }

/* === LOGO === */
.logo-box { background-color: transparent; position: relative; height: 32px; }
.mainmenu_logo_img {
    position: absolute;
    top: 18px;
    left: 1px;
    border: 0;
    display: block;
    margin: 0 auto;
    max-width: 120px;
    height: auto;
    z-index: 10;
    border-bottom: 1px solid var(--theme-main);
}

.header-right-content { flex-grow: 1; display: flex; flex-direction: column; background: transparent; }

/* === ŘÁDEK 1 (User + Lvl1 Menu) === */
.row-top { height: 32px; border-bottom: 1px solid #999; position: relative; }

.user-info { 
    position: absolute; left: 10px; bottom: 6px; 
    font-weight: normal; color: var(--theme-main); 
    font-size: 9pt; white-space: nowrap; 
}

.logout-icon { color: #888; text-decoration: none; font-weight: bold; margin-left: 8px; font-size: 10pt; cursor: pointer; font-family: Arial, sans-serif; }
.logout-icon:hover { color: #cc0000; }

.nav-items-wrapper { float: right; padding-right: 5px; margin-top: 8px; }
.nav-item { 
    display: inline-block; padding: 5px 9px; margin-left: 1px; 
    font-weight: bold; font-size: 9pt; text-decoration: none; 
    border-top-left-radius: 2px; border-top-right-radius: 2px; 
    background-color: transparent; vertical-align: bottom; color: black; 
}
.nav-items-wrapper a,
.nav-item,
.nav-item:visited,
.nav-item:active {
    text-decoration: none;
}
.nav-item:hover { text-decoration: underline; }
.nav-item.no-underline:hover { text-decoration: none; }
.nav-item.active-dynamic { 
    background-color: var(--theme-main) !important; 
    color: white !important; 
    text-decoration: none !important;
}
.nav-item.active-dynamic:hover { text-decoration: none !important; }

/* === ŘÁDEK 2 (Lvl2 Moduly) === */
.row-modules { 
    height: 24px; display: flex; align-items: center; 
    background-color: var(--theme-main); 
    color: white; 
}
.mod-link { 
    color: white; margin-left: 12px; font-weight: bold; 
    font-size: 9pt; text-decoration: none; cursor: pointer; 
}
.mod-link.active { text-decoration: none; font-weight: bold; }

/* === ŘÁDEK 3 (Info lišta) === */
.row-info-full { height: 24px; display: flex; align-items: center; width: 100%; }
.info-left-spacer { 
    display: flex; align-items: center; padding: 0 2px; 
    background-color: var(--theme-light); 
    border-bottom: 1px solid #888; height: 100%; 
}
.info-right-content { 
    flex-grow: 1; background-color: var(--theme-light); 
    border-bottom: 2px; color: var(--theme-main); 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 5px; height: 100%; 
}
.info-menu a { margin-left: 10px; color: #666; font-size: 9pt; cursor: pointer; font-weight: normal; text-decoration: none; }
.info-menu a.active { color: var(--theme-main); font-weight: bold; text-decoration: none; }

/* === TĚLO (Sidebar + Workspace) === */
#body-section { flex-grow: 1; display: flex; width: 100%; overflow: hidden; padding-top: 4px; }
#sidebar-panel { height: 100%; background: transparent; display: flex; flex-direction: column; }
#workspace-panel { flex-grow: 1; height: 100%; display: flex; flex-direction: column; background: transparent; overflow: hidden; }

/* === KOMPONENTY (Sidebar) === */
.sb-filter { width: 100%; height: 20px; border: 1px solid var(--theme-main); font-size: 9pt; margin: 0; margin-bottom: 4px; }
.sidebar-flex { display: flex; flex-direction: column; height: 100%; padding: 0 2px; }
.sb-group { border: 1px solid #999; background: white; margin-bottom: 4px; flex-shrink: 0; }
.sb-group-title { background-color: #f0f0f0; border-bottom: 1px solid #ccc; padding: 3px 4px; font-size: 9pt; cursor: pointer; display: flex; justify-content: space-between; }

.sched-wrap { overflow-y: auto; background-color: var(--theme-light); }
.sched-table { width: 100%; border-collapse: collapse; }
.sched-table td { font-size: 9px; padding: 0 2px; border-bottom: 1px solid white; }
.t-time { width: 30px; text-align: right; color: #444; padding-right: 3px; }
.bar-green { background: #ccffcc; border: 1px solid #99cc99; display: block; height: 12px; line-height: 12px; padding-left: 2px; }
.bar-pink { background: #ffccff; border: 1px solid #cc99cc; display: block; height: 12px; }
.bar-cyan { background: #ccffff; border: 1px solid #99cccc; display: block; height: 12px; }

/* === KOMPONENTY (Workspace) === */
.pat-bar { background-color: var(--theme-main); color: white; height: 20px; line-height: 20px; padding: 0 5px; font-weight: bold; display: flex; justify-content: space-between; font-size: 9pt; flex-shrink: 0; }
.tabs-row { height: 26px; background: transparent; padding-left: 10px; display: flex; align-items: flex-end; border-bottom: 1px solid #999; flex-shrink: 0; margin-top: 5px; }
.tab-item { padding: 4px 12px; background: var(--theme-light); border: 1px solid #999; border-bottom: none; margin-right: 2px; position: relative; top: 1px; cursor: pointer; color: var(--theme-main); font-size: 9pt; }
.tab-item.active { background: white; font-weight: bold; border-bottom: 1px solid white; z-index: 5; }
.form-body { background: white; padding: 15px; flex-grow: 1; overflow: auto; border: 1px solid #999; border-top: none; margin-right: 5px; margin-bottom: 5px; }
.doc-head { color: var(--theme-main); font-weight: bold; border-bottom: 1px dotted #999; margin-bottom: 10px; padding-bottom: 2px; font-size: 10pt; }

/* === FORMULÁŘOVÉ PRVKY === */
.textbox { border: 1px solid var(--theme-main); font-family: Tahoma; font-size: 9pt; padding: 2px; }
.button { border: 1px solid #003c74; background: #e0e0e0; font-weight: bold; cursor: pointer; padding: 4px 15px; font-family: Tahoma; font-size: 9pt; }
.btn-theme { background: var(--theme-main); color: white; border-color: black; }
.btn-red { background: #cc0000; color: white; border-color: black; }
.frm-row { display: flex; align-items: center; margin-bottom: 6px; }
.frm-lbl { width: 110px; text-align: right; font-weight: bold; padding-right: 10px; font-size: 9pt; }
.frm-val { flex-grow: 1; font-size: 9pt; }
.opt { margin-right: 15px; display: inline-flex; align-items: center; }

/* X_COMBO */
.x_combo { display: inline-block; position: relative; background: white; border: 1px solid var(--theme-main); height: 22px; width: 200px; cursor: pointer; }
.x_combo_box { display: flex; height: 100%; align-items: center; }
.x_combo_input { flex-grow: 1; border: none; padding: 2px 4px; font-size: 9pt; }
.x_combo_img { position: absolute; top: 0; right: 0; width: 12px; height: 12px; padding-top: 3px; }

/* Pracoviste v hlavicce nema mit horni/dolni ramecek */
.lvl2-wp-combo { border-top: 0 !important; border-bottom: 0 !important; height: 20px; }
.lvl2-wp-combo .x_combo_box { height: 20px; border-top: 0 !important; border-bottom: 0 !important; }
.lvl2-wp-combo .x_combo_input { border-top: 0 !important; border-bottom: 0 !important; }

/* UPRAVENÁ ŠIPKA POMOCÍ FONTU */
.x_arrow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none; /* Zrušíme CSS trojúhelník */
    
    font-family: 'Glyphicons Halflings';
    font-size: 8px; /* Velikost ikony */
    color: #999;
    font-style: normal;
    font-weight: normal;
    line-height: 12px; /* Vycentrování */
    text-align: center;
}

/* Vložení znaku šipky */
.x_arrow::before {
    content: "\e252";
}

.x_combo_list { display: none; position: absolute; top: 21px; left: -1px; width: 100%; border: 1px solid var(--theme-main); background: white; z-index: 999; list-style: none; padding: 0; margin: 0; }
.x_combo_list li { padding: 2px 4px; }
.x_combo_list li:hover { background: var(--theme-main); color: white; }

/* X_COMBOBOX (select) */
select.x_combo {
    border: 1px solid var(--theme-main);
    background: #fff;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 9pt;
    padding: 2px 4px;
    height: 22px;
    line-height: 18px;
    padding-right: 22px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #666 50%),
        linear-gradient(135deg, #666 50%, transparent 50%),
        linear-gradient(to right, #ccc, #ccc);
    background-position:
        calc(100% - 10px) 8px,
        calc(100% - 5px) 8px,
        calc(100% - 18px) 3px;
    background-size: 5px 5px, 5px 5px, 1px 14px;
    background-repeat: no-repeat;
}

/* === TABULKY DAT (GRID) === */
.data-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    background-color: white;
}

.data-grid th {
    /* Hlavička tabulky převezme barvu aktuálního modulu */
    background-color: var(--theme-main); 
    color: white;
    text-align: left;
    padding: 4px 6px;
    font-weight: bold;
    border-right: 1px solid rgba(255,255,255,0.3);
}

.data-grid td {
    padding: 3px 6px;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #eee;
    color: black;
    cursor: default;
}

/* Hover efekt na řádek - podbarví se světlou barvou modulu */
.data-grid tr:hover td {
    background-color: var(--theme-light); 
    color: black;
}

/* Filtr panel nad tabulkou */
.filter-panel {
    background-color: #f0f0f0;
    border-bottom: 1px solid #999;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 10px; /* Mezery mezi prvky */
}

.filter-label {
    font-weight: bold;
    font-size: 9pt;
    margin-right: 5px;
}
/* Odkaz uvnitř data-gridu (místo tlačítka) */
.grid-link {
    color: #3333CC; /* Zlatokop modrá */
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.grid-link:hover {
    text-decoration: underline;
    color: #cc0000; /* Při najetí zčervená */
}
/* Ikona popelnice */
.icon-trash {
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    font-size: 10pt;
    line-height: 1;
    cursor: pointer;
    color: #cc0000; /* Červená */
}
/* Ikona pracoviště v LVL2 comboboxu */
.wp-icon {
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    font-size: 10pt;
    color: var(--theme-main);
    margin-right: 6px;
    line-height: 1;
}

/* znak „list“ */
.wp-icon::before {
    content: "\e012";
}
.icon-trash::before {
    content: "\e020"; /* Kód znaku popelnice */
}
.icon-trash:hover {
    color: red;
    text-shadow: 0 0 2px #ffaaaa;
}
/* Průhledné pozadí pod kartami */
.tabs-row {
    background-color: transparent !important;
    border-bottom: 1px solid #999;
}

/* ŠÍŘKY */
.logo-col {
    width: 122px;
    min-width: 122px;
}

.sidebar-col {
    width: 177px;
    min-width: 177px;
}

/* Lvl1 – barvy podle modulu */
.nav-item {
    color: inherit;
}
.nav-item[class*="type-"] {
    font-weight: bold;
}
/* === LVL3 RÁMEČEK PODLE MODULU === */
.row-info-full {
    border-bottom: 1px solid var(--theme-main);
}

.info-right-content {
    border-left: 1px solid var(--theme-main);
    border-right: 1px solid var(--theme-main);
}
/* === X_COMBO V LVL2 === */
.lvl2-wp-combo {
    height: 24px;
    background: var(--theme-light) !important;
    border: 1px solid var(--theme-main) !important;
    border-bottom: none !important;
    color: var(--theme-main);
    font-weight: bold;
    font-size: 9pt;
    margin-left: 0px;
}

.lvl2-wp-combo .x_combo_box {
    color: var(--theme-main);
}

.lvl2-wp-combo .x_combo_input {
    color: var(--theme-main);
}

.lvl2-wp-combo .x_arrow {
    color: var(--theme-main);
}

.lvl2-wp-combo .x_combo_list {
    background: white;
    border: 1px solid var(--theme-main);
    color: black;
    top: 22px;
}
