body {
    font-family: sans-serif;
    background-color: #181818;
    color: #fff;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.player-wrapper {
    width: 95%;
    max-width: 600px;
    position: relative;
}

.player-container {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

#videoPlayer {
    width: 100%;
    height: auto;
    display: block;
    background-color: #000;
}

.controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px; /* Reduced padding for mobile */
    opacity: 1;
    transition: opacity 0.3s ease;
}

.controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.controls.locked {
    background-color: transparent; /* Make the controls completely transparent when locked */
}

.controls.locked .top-controls,
.controls.locked .center-controls,
.controls.locked .bottom-controls {
    pointer-events: none; /* Disable interaction with controls when locked*/
    opacity: 0; /* Hide controls when locked */
}

.controls.locked .top-controls {
    opacity: 1; /* Keep top-controls visible with full opacity */
}

.controls.locked .top-controls .video-title {
    opacity: 0; /* Hide the title when locked */
}

/* Initially hide the lock button when locked */
.controls.locked .top-controls #lockBtn {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease; /* Add a transition for a smooth fade-in/out */
}

/* Always show the lock button when controls are locked, even in fullscreen */
.controls.locked .top-controls #lockBtn {
    pointer-events: auto; /*Except the lock button itself*/
    opacity: 1; /*Keep the lock button visible*/
}

/* Fullscreen styles */
:fullscreen .player-wrapper,
:-webkit-full-screen .player-wrapper,
:-moz-full-screen .player-wrapper,
:-ms-fullscreen .player-wrapper {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0; /* Remove rounded corners in fullscreen */
}

:fullscreen .player-container,
:-webkit-full-screen .player-container,
:-moz-full-screen .player-container,
:-ms-fullscreen .player-container {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0; /* Remove rounded corners in fullscreen */
}

:fullscreen #videoPlayer,
:-webkit-full-screen #videoPlayer,
:-moz-full-screen #videoPlayer,
:-ms-fullscreen #videoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Maintain aspect ratio */
}

/* Rest of your CSS remains unchanged */

.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0; /* Reduced padding for mobile */
}

.video-title {
    font-size: 14px; /* Adjusted font size for mobile */
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%; /* Ensure title doesn't overflow */
}

#lockBtn {
    font-size: 18px; /* Adjusted font size for mobile */
}

.center-controls {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* Adjusted gap for mobile */
    padding: 10px 0; /* Added padding for touch area */
}

.tap-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    opacity: 0;
    -webkit-tap-highlight-color: transparent; /* Remove highlight on tap */
}

.tap-overlay.left {
    left: 0;
}

.tap-overlay.right {
    right: 0;
}

.bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0; /* Reduced padding for mobile */
}

.control-icon {
    background: none;
    border: none;
    color: #eee;
    cursor: pointer;
    font-size: 20px; /* Adjusted font size for mobile */
    padding: 10px; /* Adjusted padding for mobile */
    border-radius: 50%;
    opacity: 0.8;
    transition: opacity 0.2s ease, background-color: 0.2s ease;
    margin: 0 2px; /* Add some horizontal spacing */
}

.control-icon:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.control-icon.big-icon {
    font-size: 28px; /* Adjusted font size for mobile */
    padding: 14px; /* Adjusted padding for mobile */
}

.progress-container {
    flex-grow: 1;
    margin-right: 8px; /* Adjusted margin for mobile */
    display: flex;
    align-items: center;
}

#progressBar {
    -webkit-appearance: none;
    appearance: none;
    height: 6px; /* Thicker progress bar for mobile */
    background: rgba(255, 255, 255, 0.3); /* Lighter track */
    cursor: pointer;
    flex-grow: 1;
    border-radius: 3px;
    margin-right: 3px; /* Adjusted margin for mobile */
    background-image: linear-gradient(#fff, #fff);
    background-repeat: no-repeat;
    background-size: 0% 100%;
}

#progressBar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px; /* Smaller thumb for mobile */
    height: 12px; /* Smaller thumb for mobile */
    background-color: #eee;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); /* Add shadow to thumb */
}

#progressBar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background-color: #eee;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.time-display {
    color: #eee;
    font-size: 12px; /* Adjusted font size for mobile */
    white-space: nowrap;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 5px; /* Adjusted gap for mobile */
}

#volumeBtn {
    font-size: 18px; /* Adjusted font size for mobile */
}

#aspectRatioBtn {
    font-size: 18px;
}

.settings-menu {
    position: relative;
}

#settingsBtn {
    font-size: 18px; /* Adjusted font size for mobile */
}

.settings-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    background-color: #333;
    color: #eee;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    display: none;
    z-index: 10;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-size: 14px;
}

.settings-dropdown.show {
    display: block;
}

.setting-item{
   display: flex;
   align-items: center;
   margin-bottom: 10px;
   font-size: 14px;
   width: 100%;
}

.setting-icon {
    flex-shrink: 0; /* Prevent icon from shrinking */
    width: 20px;
    text-align: center;
}

.setting-item label {
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 10px;
    margin-right: auto;
}

.setting-item select {
    margin-left: auto; /* Push select to the right */
}

#qualityControl {
    background-color: #444;
    color: #eee;
    border: none;
    padding: 6px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    width: 55px;
}

.setting-button {
    background: none;
    border: none;
    color: #eee;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    transition: opacity 0.2s ease;
    padding: 8px 0;
}

.setting-button:hover {
    opacity: 0.8;
}

/* Smaller PiP icon */
.pip-icon {
    font-size: 14px; /* Even smaller size for PiP icon */
}

/* Playback speed dropdown styling */
#playbackSpeed {
    background-color: #444;
    color: #eee;
    border: none;
    padding: 6px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    width: 55px;
    margin-left: auto; /* Align to the right */
}

/* Mobile Specific Styles */
@media (max-width: 768px) {
    .controls {
        padding: 8px;
    }
    .top-controls {
        padding: 4px 0;
    }
    .video-title {
        font-size: 12px;
    }
    #lockBtn {
        font-size: 16px;
    }
    .center-controls {
        gap: 8px;
        padding: 8px 0;
    }
    .control-icon {
        padding: 8px;
        font-size: 18px;
    }
    .control-icon.big-icon {
        font-size: 24px;
        padding: 12px;
    }
    .time-display {
        font-size: 10px;
    }
    .right-controls {
        gap: 3px;
    }
    #volumeBtn {
        font-size: 16px;
    }
    #aspectRatioBtn {
        font-size: 16px;
    }
    .settings-dropdown {
        padding: 8px;
        min-width: 140px;
        font-size: 12px;
    }
    .setting-item {
        margin-bottom: 8px;
        font-size: 12px;
    }
    #qualityControl, .setting-button {
        font-size: 12px;
        padding: 4px;
    }
}