body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #121212;
    color: #FFFFFF;
    margin: 0;
}

.container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #FFFFFF;
}

.thumbnail-selection {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.thumbnail-selection img {
    width: 80px;
    height: auto;
    margin: 5px;
    cursor: pointer;
    border: 2px solid #ccc; /* Border */
    border-radius: 15px; /* Rounded corners */
    transition: border-color 0.2s; /* Smooth transition */
}

.thumbnail-selection img.selected {
    border-color: #4CAF50; /* Highlight selected thumbnail */
}

.thumbnail-selection img:hover {
    border-color: #4CAF50; /* Change border color on hover */
}

.video-container {
    position: relative;
    display: inline-block;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
}

#exercise-video {
    border: 3px solid #444;
    border-radius: 15px;
}

.counter {
    position: absolute;
    bottom: 30px; /* Positioned above the progress bar */
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: bold;
    color: #ff4444;
}

.progress-bar-container {
    width: 100%;
    height: 40px; /* Increased height for a thicker progress bar */
    background-color: #ddd;
    position: relative;
    margin-top: 10px;
    border-radius: 20px; /* Optional: rounded corners */
    overflow: hidden; /* Ensure the progress bar stays within the container */
}

.progress-bar {
    width: 0;
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.5s ease-in-out;
}

#counter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px; /* Increased font size */
    font-weight: 700; /* Bolder font weight */
    color: #000000;
    z-index: 1;
    text-shadow: 
        -2px -2px 0 #fff,
        2px -2px 0 #fff,
        -2px 2px 0 #fff,
        2px 2px 0 #fff,
        0 3px 0 #fff,
        3px 0 0 #fff,
        0 -3px 0 #fff,
        -3px 0 0 #fff; /* Thicker text shadow */
    font-family: Arial, Helvetica, sans-serif; /* Web-safe font for better rendering */
    letter-spacing: 1px; /* Slight letter spacing for clarity */
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.slider-container {
    margin: 10px 0;
    text-align: center;
    width: 100%;
}

.slider-container label {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.controls input[type="range"] {
    width: 100%;
    height: 10px; /* Thicker slider */
    -webkit-appearance: none;
    appearance: none;
    background: #444;
    outline: none;
    opacity: 0.9;
    transition: opacity .2s;
    margin-bottom: 10px;
}

.controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    background: #4CAF50;
    cursor: pointer;
}

.button-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.button-container button {
    font-size: 20px;
    margin: 10px;
    padding: 10px 20px;
    background-color: #444;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button-container button:hover {
    background-color: #666;
}

#settings-button {
    padding: 10px;
}

.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}

.popup-content {
    background-color: #2c2c2c;
    color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.popup-content h2 {
    margin-top: 0;
    color: #4CAF50;
    border-bottom: 1px solid #4CAF50;
    padding-bottom: 10px;
    text-align: left;
}

.settings-section h3 {
    color: #4CAF50;
    margin-bottom: 10px;
    text-align: left;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.setting-item label {
    flex: 0 0 100px; /* Fixed width for labels */
    margin-right: 10px;
}

.setting-item input[type="text"],
.setting-item input[type="number"] {
    flex: 1;
    background-color: #3c3c3c;
    border: none;
    padding: 8px;
    color: #fff;
    border-radius: 5px;
}

.popup-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.popup-buttons button {
    margin-left: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#save-settings {
    background-color: #4CAF50;
    color: white;
}

#close-settings {
    background-color: #f44336;
    color: white;
}

.popup-buttons button:hover {
    opacity: 0.8;
}


/* Toggle switch styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex: 0 0 50px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    transition: .4s;
    border-radius: 24px;
    max-width: 50px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.connection-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 10px;
}

.connection-status.connected {
    background-color: #4CAF50;
}

.connection-status.disconnected {
    background-color: #f44336;
}

.collapsible {
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    padding: 10px 20px;
    border: none;
    text-align: center;
    outline: none;
    font-size: 16px;
    margin: 5px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.active, .collapsible:hover {
    background-color: #45a049;
}

.collapsible:after {
    content: '\25BC';
    color: white;
    font-weight: bold;
    float: right;
    margin-left: 5px;
}

.active:after {
    content: "\25B2";
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 10px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
