/* General reset */
body, h1, p, button, textarea {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: grid;
    grid-template-rows: 80px auto;
    grid-template-columns: 250px 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    height: 100vh;
}

/* Header */
#headerTitle {
    grid-area: header;
    background-color: #3c3c3c;
    color: white;
    text-align: center;
    font-size: 1.5rem;
    line-height: 80px;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background-color: #d3d3d3;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    text-align: center;
}

.sidebar button{
    padding: 0.5rem;
    margin-bottom: .5rem;
    width: 100%;
    border: none;
    color: white;
    font-size: 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}
.button-active {
    background-color: #525252;
    cursor: pointer;
}
.button-active:hover {
    background-color: #3c3c3c;
}
.button-disabled {
    background-color: #bbb;
    cursor: default;
}
.button-disabled-choice {
    background-color: #555;
    cursor: default;
}

.notifications{
    display: flex;
    text-align: left;
    margin-top: 2rem;
}
#hourlyNotifyOptions, #centuryNotifyOptions{
    border-radius: 10px;
    border: 2px solid #525252;
    height: 24px;
    margin-top: 4px; 
    padding-left: 6px;
    background-color: #f8f8f8;
    box-shadow: inset -1px -2px 4px rgba(0, 0, 0, 0.3);
}

.scores {
    width: 100%;
    margin-top: auto;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1rem;
}
#current-score{
    display: none;
}
#countDisplay{
    display: none;
    padding-top: .5rem;
}
.divideLine{
    margin: 2rem 0px;
}
.high-score{
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}
.high-score-sub{
    font-size: 1rem;
    font-weight: normal;
}

/*          Main content         */
.main {
    grid-area: main;
    background-color: white;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

#videoContainer {
    margin-top: auto;
    margin-bottom: auto;
    background-color: black;
    width: 640px;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #ccc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    pointer-events:all;
}
#videoContainer.fullscreen{
    width: 100hw;
    height: 100vh;
    border: none;
}
#videoElement{
/*    z-index: 1;   ???   */
    width: 100%;
    height: 100%;
    display: flex;
}
#videoElement.fullscreen{
    z-index: 999;
}

#controls {
    pointer-events: none;
    z-index: 1;
    display: flex;
    position: absolute;
    bottom: 15px;
    align-items: center;
    width: 95%;
    border-radius: 25px;
    padding: 10px;
    height: 48px;
/*    background-color: rgba(0, 0, 0, 0.25); */
    -webkit-transition: .2s;
    transition: opacity .2s 2s;
    opacity: 1;
}
.disabled{
    cursor: default !important;
    pointer-events: none !important;
    opacity: .25 !important;
}
#controls.fullscreen{
    z-index: 10000;
    display: flex;
    position: absolute;
}
.control-button {
    z-index: 3;
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    position: absolute;
    display: flex;
    width: 25px;
    bottom: 35px;
    -webkit-transition: .2s;
    transition: opacity .2s;
    opacity: 0.7;
    transition: .2s;
    transform-origin: center;
    filter: drop-shadow(0 0 2px black) drop-shadow(0 0 4px black);
}
.control-button:hover {
    opacity: 1;
    transform: scale(1.3);
}
#play-pauseBtn{
    pointer-events: all;
    left: 3%;
}
#volume-controls {
    pointer-events: all;
    display: flex;
    position: absolute;
    width: 140px;
    height: 25px;
    left: calc(96% - 90px);
    bottom: 3px;
    padding: 10px;
    border-radius: 20px;
    align-items: center;
    justify-content: space-between;
    transform: rotate(270deg);
    transform-origin: left;
    background-color: rgba(0, 0, 0, 0);
    -webkit-transition: .2s;
    transition: background-color 0.2s;
}
#audioBtn{
    position: relative;
    transform: rotate(90deg);
    bottom: -2px;
}
#audioBtn:hover{
    transform: rotate(90deg) scale(1.3);
}
#fullscreenBtn {
    pointer-events: all;
    right: 3%;
}
.customSlider{
    z-index: 3;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 5px;  
    background: #d3d3d3;
    outline: none;
    height: 4px;
    -webkit-transition: .3s;
    transition: opacity .3s;
    box-shadow: 0 0 4px #333, 0 0 4px #333;
}
#volume-slider{
    width: 100px;
    position: relative;
    display: none;
    right: 5px;
}
#volume-slider::-webkit-slider-thumb {
    width: 6px;
    border-radius: 3px;
    box-shadow: 0 0 1px black;
}
#volume-slider::-moz-range-thumb {
    width: 6px;
    border-radius: 3px;
    box-shadow: 0 0 1px black;
}
#playbar {
    flex-grow: 1;
    left: 3%;
    width: 94%;
    display: flex;
    position: absolute;
    bottom: 10px;
    opacity: 0.7;
}
#filled-progress-bar {
    z-index: 4;
    width: 100%;
    clip-path: inset(-20px 100% -20px 0);
    bottom: -2px;
    position: absolute;
    border-radius: 5px 0 0 5px;
    background: white;
    height: 8px;
    pointer-events: none;
}
#filled-progress-bar::-webkit-slider-thumb {
    display: none;
}
#filled-progress-bar::-moz-range-thumb {
    display: none;
}
#progress-bar {
    width: 100%;
}
.customSlider:hover{
    opacity: 1;
}
.customSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 8px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #3c3c3c;
    background: white;
    cursor: pointer;
}
.customSlider::-moz-range-thumb {
    width: 8px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #3c3c3c;
    background: white;
    cursor: pointer;
}

#dummyLoader{
    display: none;
}

#errorLog {
    position: relative;
    margin-top: auto;
    width: 80%;
    height: 120px;
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 1rem;
    resize: none;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
    font-family: monospace;
    color: #525252;
    background-color: #f8f8f8;
    overflow-y: auto;
}
#errorLog::-webkit-scrollbar {
    width: 12px;
}
#errorLog::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 8px;
}
#errorLog::-webkit-scrollbar-thumb { /* Handle */
    background: #999;
    border: 3px solid #e0e0e0;
    border-radius: 8px;
}
#errorLog::-webkit-scrollbar-thumb:hover {
    background: #666;
}
#logPlaceholder{
    text-align: center;
    color: #aaa;
}

#copyLogBtn{
    margin-bottom: 1rem;
    border-radius: 16px;
    padding: 8px;
    width: 20%;
    bottom: 6px;
    left: 45%;
    background-color: #ccc;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6), 1px 1px 4px rgba(0, 0, 0, 0.4);
}
#copyLogBtn:hover{
    background-color: #aaa;
}
#copyLogBtn:active{
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5), 1px 1px 3px rgba(0, 0, 0, 0.3);
    background-color: #999;
    transform: translateY(2px);
    box-shadow: none;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        grid-template-rows: 60px auto auto;
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "sidebar"
            "main";
    }
    .sidebar {
        align-items: center;
    }
    #videoContainerWrapper, .error-log {
        width: 95%;
    }
}
