html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.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 #f73f00;
}

/* Oranžové CTA tlačítka podle design pravidel */
.btn-primary {
    background-color: #f73f00; /* coquelicot */
    border-color: #db541a; /* flame */
    color: white;
}

.btn-primary:hover {
    background-color: #db541a; /* flame */
    border-color: #e96b1e; /* spanishOrange */
}

.btn-primary:focus, .btn-primary.focus {
    box-shadow: 0 0 0 0.2rem rgba(247, 63, 0, 0.5);
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background-color: #e96b1e; /* spanishOrange */
    border-color: #db541a; /* flame */
}

/* Outline primary tlačítka pro grafy */
.btn-outline-primary {
    color: #f73f00; /* coquelicot */
    border-color: #f73f00;
}

.btn-outline-primary:hover {
    color: white;
    background-color: #f73f00;
    border-color: #f73f00;
}

.btn-outline-primary:focus, .btn-outline-primary.focus {
    box-shadow: 0 0 0 0.2rem rgba(247, 63, 0, 0.5);
}

.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active {
    color: white;
    background-color: #f73f00;
    border-color: #f73f00;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    /* žádný margin-bottom ani padding-bottom */
}

.flex-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-left: 32px;
    padding-right: 32px;
}
@media (max-width: 768px) {
    .flex-main {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Responsivní úpravy pro grafy na malých obrazovkách */
    #chartControls {
        flex-wrap: wrap;
        gap: 4px !important;
    }
    
    #chartControls label {
        font-size: 0.875rem;
    }
    
    #chartControls .btn {
        min-width: 32px;
    }
}

main {
    flex-grow: 1;
    padding-bottom: 24px;
}

aside {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    align-self: flex-start;
    background-color: white; /* zachováno pro vizuální oddělení */
    border-right: 1px solid #e0e0e0;
    /* ostatní vlastnosti zůstanou */
}

    /* Zvýšení velikosti písma v boèním panelu */
    aside .nav-link {
        font-size: 1.1rem;
    }

/* Styl aktivní karty (odkaz) */
.nav-link.active {
    background-color: rgb(245, 215, 200); /* Svìtle tlumená oranžová */
    color: #333; /* Mírnì tmavší text pro jemnìjší kontrast */
    font-weight: normal; /* Zrušili jsme tuèné písmo */
}

/* Hover efekt na ostatní karty */
.nav-link:hover {
    background-color: #f5f5f5; /* svìtle šedá */
    color: #000;
}

/* Standardní styl odkazu */
.nav-link {
    color: #555; /* tmavì šedý text */
    border-radius: 4px;
    padding: 8px 12px;
}

/* Zarovnání prvního <li> s dolním okrajem horní lišty */
aside ul.nav {
    margin-top: -1px; /* Posun celé navigace o 1px nahoru */
}

li.nav-item:first-child {
    margin-top: calc(1rem - 1px); /* Pøesné zarovnání s lištou */
}

.text-orange {
    color: #f73f00; /* coquelicot podle design pravidel */
    font-weight: bold;
    padding: 0.5rem 1rem;
    display: block;
    transition: width 0.3s, transform 0.3s;
}

.sidebar-collapsed aside {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.sidebar-collapsed aside .nav-link span {
    display: none;
}

.sidebar-collapsed .text-orange {
    text-align: center;
}

.brand-short {
    display: none;
}
.sidebar-collapsed .brand-full {
    display: none;
}
.sidebar-collapsed .brand-short {
    display: inline;
}

.sidebar-collapsed .nav-link {
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}
.sidebar-collapsed .nav-link i {
    margin-right: 0 !important;
}

@media (max-width: 768px) {
    aside {
        display: none;
    }
}


#sidebarToggle {
    z-index: 1100;
    font-size: 0.9rem;
    color: #6c757d;
    border: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
}
#sidebarToggle i {
    border: 1px solid #6c757d;
    border-radius: 50%;
    padding: 2px;
    margin-right: 0.25rem;
}
@media (max-width: 768px) { #sidebarToggle { display: block; } }

.sidebar-collapsed #sidebarToggle span {
    display: none;
}

.text-start {
    text-align: left; /* Zarovnání textu vlevo */
}

/* Zmìní barvu aktivní ikony v sidebaru podle design pravidel */
.nav-link.active i {
    color: #f73f00 !important; /* coquelicot */
}

/* Styl aktivní položky v mobilním menu */
.dropdown-item.active {
    background-color: rgb(245, 215, 200); /* Světlé tlumená oranžová */
    color: #333;
    font-weight: normal;
}

/* Stejný vzhled i při stisknutí odkazu v mobilním menu */
.dropdown-item:active {
    background-color: #f5f5f5;
    color: #000;
}

/* Barva ikon v aktivní položce mobilního menu podle design pravidel */
.dropdown-item.active i {
    color: #f73f00 !important; /* coquelicot */
}


/* Fixní velikost sidebaru – nebude se zmenšovat */
aside {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    flex-shrink: 0;
}

/* Umožní lámání slov v tabulkách pro lepší responzivitu */
.break-words {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chart-responsive {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
.chart-responsive canvas {
    width: 100% !important;
    height: auto;
    display: block;
}

header {
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    margin-left: -32px;
    margin-right: -32px;
    padding-left: 32px;
    padding-right: 32px;
}
@media (max-width: 768px) {
    header {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }
}

.flex-main h2 {
    margin-top: 18px;
    margin-bottom: 14px;
}

/* Machine image responsive container */
.machine-image-container {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.machine-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Responsive image adjustments for smaller screens */
@media (max-width: 768px) {
    .machine-image-container {
        max-height: 200px;
    }

    .machine-image {
        max-height: 200px;
    }
}

@media (max-width: 576px) {
    .machine-image-container {
        max-height: 150px;
    }

    .machine-image {
        max-height: 150px;
    }
}

/* Edit view image container - 4:3 aspect ratio */
.machine-image-container-edit {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 4/3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Details view image container - 4:3 aspect ratio */
.machine-image-container-details {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 4/3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Cards view image container - 4:3 aspect ratio */
.machine-image-container-cards {
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 aspect ratio (3/4 = 0.75) */
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
}

.machine-image-container-cards .machine-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Responsive adjustments for edit view - maintain 4:3 */
@media (max-width: 768px) {
    .machine-image-container-edit {
        max-width: 240px;
    }
}

/* Responsive adjustments for details view - maintain 4:3 */
@media (max-width: 768px) {
    .machine-image-container-details {
        max-width: 320px;
    }
}

/* Responsive adjustments for cards view - maintain 4:3 ratio */
@media (max-width: 768px) {
    .machine-image-container-cards {
        padding-bottom: 75%; /* Keep 4:3 aspect ratio on mobile */
    }
}

/* Responsive adjustments for map layout */
@media (max-width: 768px) {
    .map-image {
        max-height: 60vh;
    }

    .map-overlay {
        max-width: 98vw;
        aspect-ratio: 4/3;
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .map-overlay {
        max-width: 100vw;
        margin: 0 -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* Responsive styles for map points (machines) */
@media (max-width: 768px) {
    .map-point {
        min-width: clamp(25px, 6vw, 45px);
        min-height: clamp(12px, 3vw, 22px);
        width: clamp(35px, 8vw, 60px);
        height: clamp(18px, 4vw, 30px);
        padding: clamp(1px, 0.8vw, 6px) clamp(2px, 1.2vw, 8px);
    }

    .map-point span {
        font-size: clamp(7px, 1.8vw, 12px);
        -webkit-line-clamp: 1;
    }

    .map-point:hover, .map-point:focus {
        transform: translate(-50%, -50%) scale(1.02);
        box-shadow: 0 1px 4px rgba(0,123,255,0.2);
    }
}

@media (max-width: 480px) {
    .map-point {
        min-width: clamp(20px, 8vw, 35px);
        min-height: clamp(10px, 4vw, 18px);
        width: clamp(28px, 10vw, 45px);
        height: clamp(14px, 5vw, 24px);
        padding: 1px 2px;
    }

    .map-point span {
        font-size: clamp(6px, 2.2vw, 10px);
        -webkit-line-clamp: 1;
    }

    .map-point:hover {
        transform: translate(-50%, -50%);
        box-shadow: none;
        border: 2px solid #007bff;
    }

    .machine-label {
        background: rgba(255,255,255,0.95);
    }
}

/* Touch-friendly interactions for mobile */
@media (hover: none) and (pointer: coarse) {
    .map-point {
        cursor: default;
    }

    .map-point:hover {
        transform: translate(-50%, -50%);
        box-shadow: none;
        border: 2px solid #007bff;
    }

    .map-point:active {
        transform: translate(-50%, -50%) scale(1.1);
        background-color: #007bff;
        color: white;
    }
}

/* Responsive resizer */
@media (max-width: 768px) {
    .resizer {
        width: clamp(6px, 1.5vw, 10px);
        height: clamp(6px, 1.5vw, 10px);
    }
}

@media (max-width: 480px) {
    .resizer {
        width: clamp(4px, 2vw, 8px);
        height: clamp(4px, 2vw, 8px);
    }
}

/* Responsive buttons for layout controls */
.btn-responsive {
    padding: clamp(6px, 1vw, 12px) clamp(12px, 2vw, 24px);
    font-size: clamp(12px, 1vw, 16px);
    min-height: 38px;
}

@media (max-width: 480px) {
    .btn-responsive {
        padding: 8px 16px;
        font-size: 14px;
        min-height: 32px;
    }
}

