* {
    box-sizing: border-box;
}

:root {
    --track-width: 40px;
    --viewer-height: 800px; /* Individual plot height */
    --viewer-width: 1000px;
}
/* Page stuff*/
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #000;
    padding: 20px;
}
.header {
    background-color:  #000000;  /* #60607d;#1A648F;  #005299;  #f1f1f1;*/
    background-repeat: no-repeat;
    background-position: left; 
    padding: 8px;
    text-align: left;
    font-size: 20px;
    color: #ffffff;
    background-color:  #000000;
}

.header img { width: 55%;}


/* Clear floats after the columns */
.row:after {
    content: "";
    display: table;
    clear: both;
}

.topnav {
    background-color: #000000; /*#504071;  /*5598db; #1A648F;*/
    padding: 1px;
    padding-left: 30px;
    border-top: 1px solid #dcc;     /* Separates legend from the images */
    border-bottom: 1px solid #dcc;     /* Separates legend from the images */
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    top: 0;
}
.topnav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000000; /*#60607d;*/
    width: 100%;
    display: flex;           /* This is the magic line that makes them horizontal */
    flex-direction: row;     /* Forces the boxes to sit side-by-side */
    justify-content: left; /* Centers the whole group of boxes */
    flex-wrap: wrap;         /* Allows boxes to wrap to a second line on small screens */
    gap: 10px;               /* Adds a nice gap between the boxes */
}

/* Style the topnav links */
.topnav a {
    float: left;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 8px 16px;
    text-decoration: none;
    transition: 0.3s;
}
/* Change color on hover */
.topnav a:hover  {
    /*background-color: #445555; /*#A2CC29;#38c4fe;*/
    color: #ffff88;
    opacity: 1;
    text-shadow: 0 0 5px #ffaa99; /*#1A648F; #005299;*/
}

.active {
    background-color: #445555; /*#60607d;*/
}


.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    padding: 12px 16px;
    z-index: 1;
}

.dropdown:hover .dropdown-content {
    display: block;
}


#app-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    background: black;
    color: #fff;
    padding: 10px;
    border-width: px;
    border-color: #000;
    border-radius: 2px;
    max-width: 100vw;
}

/* contains the forecast maps*/
#map-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #000;
    width: fit-content;
}
/*slider goes here*/
#right-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Aligns slider top with the first image frame */
    padding-top: 50px; 
    background-color: #000;

}


/* Container for both images */
.image-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-frame {
    width: var(--viewer-width);
    height: var(--viewer-height);
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px 8px;
    overflow: hidden;
}

.image-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.bottom-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 5px;
    background: #000;
    border-radius: 4px;
}

/* horizontal slider Slider */
#slider-container {
    width: var(--track-width);
    height: var(--viewer-height);
    justify-content: center;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    font-weight: bold;
    background: #000;
}

.side-label {
    position: relative;
    /* Position it to the left of the slider */
    left: -40px; 
    top: 0;/*calc(var(--viewer-height)*.25);*/
    /* Rotate and move it back up by half its own height to keep it centered */
    transform: translateY(-50%) rotate(-90deg);
    white-space: nowrap;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    letter-spacing: 1px;
}

/*the large slider shape/container*/
#slider-outer { 
    position: absolute;
    /*height: var(--track-width);*/
    /* Height matches the TOTAL stack of both images + gap */
    width: var(--track-width); /*var(--viewer-height); /*calc((var(--viewer-height) * 2) + 10px); */
    height: calc(var(--viewer-height)*.951);
    background: #000;
    border-style: solid;
    border-color: #000;
    border-width: 8px 2px; /* Thick top/bottom, thin sides */
    border-radius: 4px;
    margin: 20px;
    box-sizing: border-box; /*container-box;*/
    overflow: visible;
}

/*the large slider content*/
#image-slider {
    -webkit-appearance: none;
    appearance: none;
    /* Width becomes the vertical height in rotation */
    height: calc(var(--track-width)*1.35);
    width: calc(var(--viewer-height)*.95);/*calc((var(--viewer-height) * 2) + 10px);*/
    /*height: var(--viewer-height);*/
    background: transparent;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    margin: 0;
    cursor: grab;
    z-index: 3;
    outline: none;
    touch-action: none;
}

/*the large slider content labels*/
#datalist-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100.9%;
    background: transparent;
    pointer-events: none;
    z-index: 2;
}

#datalist-labels span {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: medium;
    color: #fff;
    transform: translateY(50%); /*roate(90deg);*/
    line-height: 0;
}

/*the large slider bar info*/
#image-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    /*width: var(--track-width);
    height: 20px;*/
    background: #007bff;
    width: 13px;
    height: calc(var(--track-width)*1.35);
    /*border: 1px solid #fff;*/
    background: rgba(255, 225, 100, 0.35); /* 50% transparent blue */
    border: 2px solid rgba(255, 200, 123, 0.8); /* Nearly solid white border */
    border-radius: 6px;
    box-shadow: 0 0 0px rgba(0,0,0,0.3);
}

/*the step and play/pause button info*/
button {
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #533;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;    
}
button:hover {
    background: #ecc;
    box-shadow: 0 3px 3px rgba(200, 150, 150, 0.5);
    border-radius: 8px;
    transform: translateY(-1px);
}
button#play-pause.playing { background: #dc3545; color: white; }

.legend-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between; /* Pushes them to the edges */
    gap: 20px;                      /* Space between the columns */
    background: #fff;
    color: #000;
    padding: 10px;
    border-top: 1px solid #dcc;     /* Separates legend from the images */
    width: var(--viewer-width);    /* Matches your image width */
    border-radius: 4px;

}

.legend-container p {
    flex: 1;                        /* Ensures both columns take up equal space */
    margin: 0;
    line-height: 1.4;               /* Improves readability of the symbols */
    font-size: 12px;
}

/* Footer */
.footer {
    padding: 10px;
    text-align: center;
    background: #000;
    margin-top: 20px;
    border-top: 1px solid #dcc; 
}




/* Small screen/device adjustments */
@media (max-width: 1000px) {
    body {
        padding: 5px;
    }
    h1 {font-size: 13px;}

    .header img{width: 80%;}
    
    .topnav {
        padding-left: 5px;
        font-size: 10px;
        font-weight: 600;
    }
    .topnav a {
        padding: 2px 6px;
    }
    /* Change color on hover */
    .topnav a:hover  {
        text-shadow: 0 0 5px #ffaa99; /*#1A648F; #005299;*/
    }

    #app-container {
        flex-direction: column; /* Stacks slider, buttons, and images vertically */
        align-items: center;
        padding: 5px;
    }

    #right-col {
        padding-top: 0; /* Remove the desktop alignment padding */
        width: 100%;
    }

    /* Change slider from vertical back to horizontal for mobile */
    #slider-container {
        width: 100%;
        height: 80px; /* Give space for labels below */
        padding-bottom: 0;
        margin-top: 10px;
    }
    .side-label {
        position: static; /* Put it back into the normal flow */
        transform: none;  /* Remove the rotation */
        margin-bottom: 5px;
        text-align: center;
        left: 0;
        top: 0;
    }
    #slider-outer {
        width: 90%; /* Use most of the screen width */
        height: 30px; /* Horizontal thickness */
        border-width: 1px 15px; /* Thick sides, thin top/bottom */
        margin: 0px auto;
        font-weight: normal;

    }

    #image-slider {
        width: 90%; /* Spans screen width */
        height: 100%;
        transform: none; /* REMOVE the rotation */
        position: absolute;
        top: 0;
        left: 0;
    }

    #datalist-labels {
        display: flex;
        justify-content: space-between;
        transform: none; /* REMOVE the rotation */
        padding: 9px;
        border-width: 9px;
        width: 89%; /* Spans screen width */

    }

    #datalist-labels span {
        position: absolute; /* Remove absolute positioning */
        transform: translate(-48.9%, -50%) rotate(90deg);
        top: 15px !important; /* Move labels below the track */
        width: 85%;
        left: unset;
        font-size: 8px;
        text-align: center center;
        white-space: nowrap; /* Prevent labels from wrapping */
        /* Add some padding for better readability if needed */
    }
    #datalist-labels span:nth-child(even) {display: none;}
    button {
    padding: 5px 10px; 
    color: #533;
    }  

    #image-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 9px;
    }
    
    /* Adjust image frames to fit screen width */
    .image-frame {
        width: 100%; 
        height: auto; /* Let height adjust to maintain aspect ratio */
        min-height: 300px;
    }

    .image-frame img {
        width: 100%;
        height: auto;
    }

     .legend-container {
        flex-direction: column;
        width: 100%;
    }

}
    
