﻿a {
    text-decoration: none;
}

.logo {
    margin-right: 10px;
    height: 25px; /* doporučuji pevnou hodnotu místo % */
    width: auto;
    display: inline-block; /* pro jistotu */
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    margin: 0;
    background: #f2f2f2;
    overflow-x: hidden; /* avoid horizontal scrollbar */
}

.btn-3d {
    position: relative;
    flex-direction: column;
    font-family: 'Arial', sans-serif;
    transition: all 0.15s ease-in-out;
}

    .btn-3d:active {
        box-shadow: inset 4px 4px 8px rgba(0,0,0,0.25), inset -4px -4px 8px rgba(255,255,255,0.6);
        transform: translateY(2px);
    }

    .btn-3d .btn-text {
        bottom: 12px;
        font-size: 50px;
        font-weight: bold;
        color: #111;
        text-shadow: 1px 1px 0 #fff, 2px 2px 2px rgba(0,0,0,0.4);
        pointer-events: none;
        align-content: center;
        text-align: center;
    }


/* --- překrytí celé stránky --- */
.overlayFinal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* --- okno uprostřed --- */
.popup {
    background: white;
    padding: 30px 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    animation: fadeIn 0.25s ease-out;
}

    .popup h2 {
        margin-top: 0;
        margin-bottom: 20px;
    }

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btnFinal {
    padding: 10px 25px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}

    .btnFinal.yes {
        background-color: #4CAF50;
        color: white;
    }

    .btnFinal.no {
        background-color: #e74c3c;
        color: white;
    }

    .btnFinal:hover {
        transform: scale(1.05);
    }

    .btnFinal.ok {
        background-color: #4CAF50;
        color: black;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}



/* =========================================================
   BOM Table – responzivní, čitelné i na tabletu
   ========================================================= */
.resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    background-color: #FF5733; /*viditelná barva */
    opacity: 0.6; /*mírně průhledná */
}

    .resizer:hover {
        opacity: 1; /*zvýraznění při hover */
    }

#bomTable {
    width: max-content;
    font-family: Arial, sans-serif;
    table-layout: fixed; /* fixní layout – nezvětšuje se podle textu */
    min-width: 100%; /* ensures table doesn’t shrink below content */
    background-color: #fff;
    border-collapse: collapse;
    flex-direction: column;
}

    #bomTable input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    #bomTable tbody tr.selected_1 {
        background-color: #cce5ff;
    }

    #bomTable tbody tr.selected_2 {
        background-color: yellow;
    }

    #bomTable tbody tr.selected_1.selected_2 {
        background-color: #b3ffd9 !important; /*kombinovaná barva */
    }


    #bomTable tr.state-selected {
        background-color: #b4e7b4; /*zelená */
    }

    /* Hlavička tabulky */
    #bomTable thead th {
        background-color: var(--table-header);
        color: #333;
        font-weight: 600;
        padding: 10px 8px;
        text-align: center;
        box-shadow: inset 0 -2px 0 0 #FF5733; /*simulate border */

        position: sticky;
        top: 0;
        z-index: 20; /*prevent text/content from expanding column */
    }

    /* Buňky tabulky */
    #bomTable td {
        border-bottom: 1px solid #ddd;
        padding: 8px 10px;
        position: relative;
        /*white-space: nowrap;*/ /* prevent wrapping */
        overflow: hidden; /*clip overflow */
        text-overflow: ellipsis; /*show … for long content */
    }

    /*   Hover efekt */
    #bomTable tbody tr:hover {
        background-color: #ffece1;
    }

    /*   Zarovnání čísel */
    #bomTable td:nth-child(3) {
        text-align: left;
    }

/* Reakce na tablety a mobily */
@media (max-width: 1024px) {
    #bomTable {
        font-size: 13px;
    }

        #bomTable td, #bomTable th {
            padding: 6px;
        }
}

@media (max-width: 768px) {
    #bomTable {
        font-size: 12px;
    }

        #bomTable td, #bomTable th {
            padding: 5px;
        }
}

@media (max-width: 600px) {
    /*Na mobilech horizontální scroll */
    .table-wrapper {
        overflow-x: auto;
    }

    #bomTable {
        min-width: 600px;
    }
}

/* ==========================================================================
   BOOTSTRAP FOCUS OVERRIDES
   ========================================================================== */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ==========================================================================
   LAYOUT OVERRIDES FOR VIEWER PAGES
   ========================================================================== */

.container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

main {
    padding: 0 !important;
    margin: 0 !important;
}
/* ==========================================================================
   INDEX PAGE STYLES (Module List)
   ========================================================================== */
#forgeViewer {
    width: 100%;
    flex: 1;
    z-index: 1;
    position: relative; /* pro referenci absolutní pozice markeru */
}

.wrapper {
    display: flex;
    flex-direction: column;
/*    flex: 1 1 auto;*/
 /*   height: calc((var(--vh, 1vh) * 100) - var(--header-h) - 70px);*/
}

.main-layout {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 8px;
    width: 100%;
    height: calc(92vh - 60px); /* 100 % mínus výška dolních tlačítek */
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 40%;
    display: flex; /* allow children to flex */
    flex-direction: column; /* vertical layout */
    height: 100%; /* important: fill parent container */
    overflow: hidden; /* no scrolling here */

    border: 2px solid var(--accent);
    background-color: #f2f2f2;
    position: relative;
    z-index: 999;
    box-sizing: border-box;
}

.bom-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}

/*    .sidebar table {
        width: 100%;
        border-collapse: collapse;
    }

    .sidebar thead th {
        position: sticky;
        top: 0;
        background: #f0f0f0;
        z-index: 2;
    }

    .sidebar th, .sidebar td {
        padding: 4px;
        text-align: left;
    }*/

.macro-container {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 0 8px;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 9999;
    overflow: hidden;
    background-color: #f2f2f2;
}

.macro-buttons {
    width: 100%;
    height: 60px;
    padding: 10px;
    justify-content: left;
    border: 2px solid var(--accent); /* Oranžová hranice jako na obrázku */
    box-sizing: border-box;
    bottom: 0;
    left: 0;
    display: flex;
}

    .macro-buttons button {
        height: 40px; /* fixní výška tlačítka */
        min-width: 40px; /* aby tlačítka byla alespoň čtvercová */
        padding: 0 12px;
        border-radius: 4px;
        border: 1px solid var(--accent);
        background-color: white;
        cursor: pointer;
        margin: 1px;
        border: 1px solid var(--accent);
        background-color: white;
        padding: 2px 6px;
        border-radius: 4px;
    }

.content-area {
    flex: 1;
    border: 2px solid var(--accent);
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    box-sizing: border-box;
}

    .content-area .info-card {
        position: absolute;
        padding: 8px 10px;
        background: white;
        border: 1px solid rgba(0,0,0,0.6);
        border-radius: 6px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        pointer-events: auto;
        display: block;
        z-index: 99;
    }

    .content-area .selected_1 {
        background-color: #FFFF00;
        z-index: 100;
    }


.arrow-left, .arrow-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 96px;
    color: #3498db;
    cursor: pointer;
    user-select: none;
    z-index: 99;
}

.arrow-left {
    left: 16px;
}

.arrow-right {
    right: 16px;
}

/* Table Styles */
.table-responsive {
    border-radius: 5px;
    overflow: hidden;
}

.table {
    background: #fff;
    margin-bottom: 0;
}

    .table th {
        background: #eee;
        border-bottom: 1px solid #ccc;
        font-weight: 600;
    }

    .table td {
        border-bottom: 1px solid #ccc;
    }

/* Button Styles for Index Page */
.btn-viewer {
    border: 2px solid #000;
    border-radius: 5px;
    background: none;
    width: 40px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-viewer:hover {
        background: #f8f9fa;
    }

.actions-container {
    margin-top: 15px;
}

.btn-action {
    background: #fff;
    border: 1px solid #dee2e6;
    font-weight: bold;
}

    .btn-action:hover {
        background: #f8f9fa;
    }

:root {
    --accent: #e23329; /* Sipral červená*/
    --bg: #fcfcfc;
    --muted: #6b6b6b;
    --card: #ffffff;
    --maxWidth: 1200px;
    --table-header: #f79b95;
    --button-frame: #c12b23;
    --input-frame: #f1b0aa;
}

/* rám celé aplikace (okraj + bílý vnitřek) */
.app-frame {
    height: calc(var(--vh, 1vh) * 100);
    padding: 12px;
    background: var(--accent);
    box-sizing: border-box;
    overflow-x: hidden; /* optional */
}

.app-inner {
    background: white;
    border-radius: 10px;
    max-width: var(--maxWidth);
    margin: 8px auto;
    padding: 26px;
    box-sizing: border-box;
    position: relative;
}

/* hlavička: titulek + vyhledávání */
.app-header {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

    .app-header h1 {
        font-size: 36px;
        margin: 0;
        font-weight: 700;
        color: #111;
        width: 300px;
        font-family: 'Franklin Gothic Book'
    }

.search-wrap {
    flex: 1;
    margin-left: 24px;
    margin-right: 24px;
}

.search-input {
    width: 100%;
    font-size: 18px;
    padding: 10px 22px;
    border-radius: 10px;
    border: 4px solid var(--button-frame);
    outline: none;
    box-shadow: none;
    background: #fff;
    box-sizing: border-box;
    font-weight: 600;
}

    .search-input::placeholder {
        color: #9a9a9a;
    }

/* layout hlavní oblasti */
.content-row {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.left-col {
    flex: 1 1 75%;
}

.right-col {
    width: 160px;
    display: flex;
    justify-content: center;
}

/* pravý sloupec ikon */
.vertical-icons {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: center;
    padding-top: 10px;
}

.side-icon {
    width: 88px;
    height: 88px;
    background: var(--table-header);
    border: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #00000020; /* optional visible border */
    border-radius: 10%; /* ← makes the button round */
}

    .side-icon:hover {
        background: var(--input-frame-hover);
        transform: scale(1.05);
        transition: 0.15s ease;
    }

    .side-icon:focus {
        outline: none;
    }

/* tabulka: zaoblené karty */
.rounded-table {
    background: var(--card);
    border-radius: 14px;
    padding: 0; /* remove padding – padding breaks sticky */
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
    overflow: hidden; /* ensure rounded corners */
}

.table-body-scroll {
    overflow-y: auto;
    overflow-x: hidden; /* horizontal scroll optional */
    box-sizing: content-box;
}

.modules-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

    .modules-table thead th,
    .modules-table tbody td {
        text-align: center; /* horizontal center */
        vertical-align: middle; /* vertical center */
        padding: 18px 16px;
        font-size: 18px;
        font-weight: 600;
        border-bottom: 1px solid #e6e6e6;
        color: #222;
    }

    .modules-table thead th {
        background: var(--table-header);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .modules-table tbody tr:last-child td {
        border-bottom: none;
    }

.table-inner {
    padding: 0px; /* safe padding that doesn't break sticky headers */
}

.text-center {
    text-align: center;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 36px;
    border-radius: 10px;
    text-decoration: none;
    transition: background .15s;
}

    .icon-btn:hover {
        background: #fbfbfb;
    }

.actions-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 14px;
}

.btn-outline {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-weight: 600;
}

.muted {
    color: var(--muted);
}


/* Oblíbené */
.favorites h3 {
    font-size: 22px;
    margin: 28px 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.star {
    color: #ffd54a;
    font-size: 30px;
    line-height: 1;
    margin-right: 6px;
}

.underline {
    height: 4px;
    background: var(--accent);
    width: 80%;
    border-radius: 4px;
    margin-bottom: 14px;
}

.small-margin-top {
    margin-top: 14px;
}

/* Responsivita */
@media (max-width: 1000px) {
    .right-col {
        width: 120px;
    }

    .search-input {
        padding: 14px;
        font-size: 16px;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 720px) {
    .content-row {
        flex-direction: column;
    }

    .right-col {
        width: 100%;
        order: 2;
        margin-top: 18px;
    }

    .vertical-icons {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        padding: 0 10px;
    }

    .app-inner {
        padding: 18px;
    }

    .app-header h1 {
        font-size: 28px;
    }

    .search-wrap {
        margin: 0;
        width: 100%;
    }

    .qr-modal {
        position: fixed;
        inset: 0;
        z-index: 1050;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .qr-modal-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.5);
    }

    .qr-modal-content {
        position: relative;
        z-index: 2;
        background: #fff;
        padding: 16px;
        border-radius: 8px;
        width: 95%;
        max-width: 480px;
        box-shadow: 0 6px 24px rgba(0,0,0,0.2);
    }

    .qr-close-btn {
        position: absolute;
        right: 8px;
        top: 8px;
        border: 0;
        background: transparent;
        font-size: 1.2rem;
        cursor: pointer;
    }
}

#qrModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#qrBox {
    width: min(560px, 95vw);
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

#qrVideo {
    width: 100%;
    height: auto;
    background: #000;
    border-radius: 6px;
}

#qrControls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

#qrMsg {
    font-size: 0.9rem;
    color: #333;
    margin-top: 8px;
    word-break: break-word;
}

#qrClose {
    position: absolute;
    right: 8px;
    top: 8px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}

#qrFile {
    display: none;
}

.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 5rem;
    color: rgba(255, 0, 0, 0.12); /* subtle */
    user-select: none;
    pointer-events: none;
    font-weight: 900;
    z-index: 9999;
    white-space: nowrap;
}