* {
    box-sizing: border-box;
}

html{
    scroll-behavior:smooth;
}

body {
    font-family:Arial,sans-serif;
    font-size:15px;
    background:#333;
    margin:0;
    padding:20px;
}

h1 {
    color:white;
    text-align:center;
    font-size:22px;
    margin:0;
}

h2 {
    color:white;
    text-align:center;
    font-size:18px;
    margin:10px 0;
}
h3 {
    margin:10px 7px;
}
p {
    margin:7px;
}
footer {
    text-align:center;
    padding:3px;
 }
footer a {
    text-decoration:none;
    color:white;
 }
footer a:hover {
    text-decoration:none;
    color:yellow;
 }

.container {
    max-width: 1000px;
}

#infoRow,#infoStacja,#infoKam {
    font-size:14px;
    border-radius: 12px;
    color:#555;
    max-width:1000px;
    margin:15px auto;
    background:white;
    padding:10px;
    box-shadow:0 4px 10px rgba(0,0,0,0.1);
}

canvas {
    width:100%!important;
}

button{
    border-radius:8px;
    border:none;
    background:#444;
    color:white;
}

button:hover{
    background:#666;
}

.top_nag {
    display:flex;
    flex-direction:column;
    gap:15px;
    padding:5px;
}

.controls {
    xposition:sticky;
    top:0;
    z-index:100;
    background:#333;
    padding:10px;
    border-radius:0 0 12px 12px;
    margin-bottom:0;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:5px;
    color:white;
}

.topRow{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
}

.thumb{
    width:90%;
    max-width:320px;
    height:auto;
    object-fit:cover;
    border-radius:6px;
    cursor:pointer;
    border:2px solid #ddd;
    transition: transform 0.2s;
}

.thumb_desc{
    color:white;
    font-size:14px;
    text-align:center;
}

.separaterro{
    max-width:1000px;
    margin:10px auto 20px auto;
    border:none;
    border-top:2px solid #aaa;
}

#galleryOverlay button{
    display:none;
    z-index: 10;
}

@media (hover:hover){
    .thumb:hover{
        border:2px solid #999;
        transform: scale(1.05);
    }
}

#chartContainer {
    padding:10px;
    margin:15px auto; 


    height:300px;
    background:white;


    border-radius:12px;
    box-shadow:0 4px 10px rgba(0,0,0,0.1);

    border:4px solid orange;
}

@media (min-width:768px){
    #galleryOverlay button{
        display:block;
    }
    #galleryOverlay .navLeft,
    #galleryOverlay .navRight{
        display:block;
    }

}

/* TABLET */
@media (min-width:700px){

    #infoRow,#infoStacja,#infoKam {
        font-size:12px;
    }

    #chartContainer {
        height:550px;
        padding:10px;
        margin:15px auto; 
        border:4px solid green;
    }

    .dateRow{
        flex-direction:row !important;
        justify-content:center;
        gap:10px;
    }

    .dateRow input{
        flex:1;
        min-width:0;
    }

    .dateRow button{
        flex:0 0 auto;
        white-space:nowrap;
    }

    .separaterro{
        margin:0 auto 0px auto;
    }

    .top_nag{
        flex-direction:row;
        justify-content:space-between;
        align-items:stretch;
    }

    .topRow{
        display:grid;
        grid-template-columns: 1fr 1fr;
        gap:5px;
        align-items:start;
        flex:1; 
    }

    .thumb_desc{
        grid-row:3;
        xtext-align:left;
        xmargin-left:30px;
        xfont-weight:500;
        xjustify-content:space-between;

    }

    .thumb{
        grid-row:2;
        margin: 0 auto;
        max-width:none;
        width:80%;
    }

    .channels{
        flex-direction:row !important;
        gap:10px;
    }

    .channelBox{
        flex:1;
        min-width:0;
    }

    .channelBox select{
        width:100%;
    }

    footer {
        margin-top:10px;
    }
}

@media (min-width:1024px){

    #infoRow,#infoStacja,#infoKam {
        font-size:16px;
    }

    #chartContainer {
       height:600px;
       border:4px solid maroon;
    }

    h1{
        font-size:24px;
	margin:0;
    }

    h2{
        font-size:18px;
    }

    .separaterro{
        margin:0 auto 0px auto;
    }

    .top_nag{
        margin:0 auto; 
    }
}

@media (min-width:1400px){
    #chartContainer {
        height: 600px;
    }
    #chartContainer {
        max-width:1000px;
    }
}

/* Poziomy iPhone */
@media (max-height:400px){

    #chartContainer {
      height:350px;
    }
}

select,button {
    padding:6px 10px;
    margin:5px;
 }

button, select, input {
    min-height: 44px;
    font-size:16px;
}

.leftControls{
    display:flex;
    gap:10px;
    align-items:center;
}

#galleryOverlay{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.9);
    z-index:1000;
    xtouch-action: none;
    touch-action: pan-x pan-y pinch-zoom;
}
#galleryOverlay.active{
    display:flex;
    align-items:center;
    justify-content:center;
}
#galleryOverlay img{
    max-width:100%;
    max-height:80%;
    width:auto;
    height:auto;
    object-fit:contain;
}

#galleryOverlay span{
    position:absolute;
    top:20px;
    right:20px;
    font-size:40px;
    color:white;
    cursor:pointer;

    background:rgba(0,0,0,0.5);
    padding:5px 12px;
    border-radius:10px;
    z-index:10;
}
#galleryOverlay span:hover{
    background:rgba(255,255,255,0.2);
}

.closeBtn{
    position:absolute;
    top:20px;
    right:40px;
    font-size:40px;
    color:white;
    cursor:pointer;
}

.navLeft{
    position:absolute;
    left:20px;
    top:50%;
    font-size:40px;
    background:none;
    color:white;
    border:none;
    cursor:pointer;
}

.navRight{
    position:absolute;
    right:20px;
    top:50%;
    font-size:40px;
    background:none;
    color:white;
    border:none;
    cursor:pointer;
}
#videoOverlay{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.9);
    z-index:1000;
    text-align:center;
}

#videoOverlay video{
    max-width:90%;
    max-height:90%;
    margin-top:3%;
}

#videoOverlay span{
    position:absolute;
    top:20px;
    right:40px;
    font-size:40px;
    color:white;
    cursor:pointer;
}
.qrBox{
    max-width:1000px;
    margin:20px auto;
    text-align:center;
}

.qrBox img{
    width:120px;
    height:auto;
    background:white;
    padding:10px;
    border-radius:10px;
    box-shadow:0 4px 10px rgba(0,0,0,0.3);
}

.qrDesc{
    color:white;
    margin-top:10px;
    font-size:14px;
}
.channels{
    display:flex;
    flex-direction:column;
    gap:10px;
    width:100%;
}
.channelBox{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
}

.channelBox label{
    margin-bottom:4px;
    font-size:14px;
}

.dateRow{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:8px 10px;
    width:100%;
}
.dateRow input{
    padding:6px 10px;
}
select{
    height: 44px;
    border-radius:8px;
    -webkit-appearance: none;
    appearance: none;
}

.dateRow input[type="date"]{
    height: 44px;
    xxline-height: 44px;
    border-radius:8px;
    padding:0 10px;
    -webkit-appearance: none;
}

.dateRow label:nth-of-type(1){
    grid-column:1;
    grid-row:1;
}

#dateFrom{
    grid-column:1;
    grid-row:2;
}

.dateRow label:nth-of-type(2){
    grid-column:2;
    grid-row:1;
}

#dateTo{
    grid-column:2;
    grid-row:2;
}

.dateRow button{
    margin-top:5px;
    grid-column:1 / span 2;
    grid-row:3;
}

.dateRow label{
    font-size:14px;
    margin-bottom:2px;
}

.gallerySlider{
    position:relative;
    width:100%;
    height:100%;
    overflow:hidden;
}

.gallerySlider img{
    max-width:90%;
    max-height:90%;
    object-fit:contain;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.sliderViewport{
    width:100%;
    height:100%;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
}

#sliderTrack{
    display:flex;
    transition: transform 0.3s ease;
}

#sliderTrack img{
    width:100%;
    max-width:100%;
    height:auto;
    max-height:90vh;
    object-fit:contain;
    flex-shrink:0;
    transform-origin: center center;
}

@media (max-width:700px){
    .top_nag{
        display:flex;
        flex-direction:column;
    }

    .topRow{
        order:1;
    }

    .controls{
        order:2;
    }

    .topRow{
        display:grid;
        grid-template-columns: 1fr 1fr;
        gap:10px;
        align-items:start;
    }

    .thumb_desc{
        grid-row:1;
        text-align:left;
        font-size:13px;
    }

    .thumb{
        grid-row:2;
        width:100%;
        max-width:none;
    }

    .channelBox{
        display:flex;
        flex-direction:row;
        align-items:center;
        gap:10px;
    }

    .channelBox label{
        order:2;
        margin-bottom:0;
        font-size:13px;
        white-space:nowrap;
        opacity:0.8;
        width:70px;
        text-align:left;
    }

    .channelBox select{
        order:1;
        flex:1;
        min-width:0;
    }

    .dateRow{
        display:grid;
        grid-template-columns: 1fr 1fr;
        gap:8px 10px;
        width:100%;
    }

    .dateRow label:nth-of-type(1){
        grid-column:1;
        grid-row:1;
    }

    #dateFrom{
        grid-column:1;
        grid-row:2;
    }

    .dateRow label:nth-of-type(2){
        grid-column:2;
        grid-row:1;
    }

    #dateTo{
        grid-column:2;
        grid-row:2;
    }

    .dateRow button{
        margin-top:5px;
        grid-column:1 / span 2;
        grid-row:3;
    }

    .dateRow label{
        font-size:13px;
        margin-bottom:2px;
    }

    .dateRow input[type="date"]{
        height:44px;
        border-radius:8px;
        padding:0 10px;
        -webkit-appearance:none;
    }
}

@media (max-width:700px) and (orientation:portrait){

    #galleryOverlay{
        flex-direction:column;
        justify-content:flex-start;
        align-items:center;
        padding-top:40px;
    }

    .sliderViewport{
        order:1;
        max-height:50vh;
    margin-top:20px;
    }

    #galleryOverlay span{
        order:2;
        position:static;
        margin-top:20px;
        font-size:32px;
        background:#444;
        padding:8px 16px;
        border-radius:10px;
    }
}
