/* Main layout styles */
body {
    margin: 0;
    padding: 0;
    background: #000000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Nunito', sans-serif;
}

#gameContainer {
    position: relative;
    width: 1920px;
    height: 1080px;
    transform-origin: center;
    border: none;
}

#gameWorld {
    width: 100%;
    height: 100%;
    background: black;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    outline: none;
}

/* Hide the buttons that are now in the settings menu */
#resetScoresButton, #helpButton, #fullscreenButton {
    display: none;
}

/* Button styles */
#fullscreenButton, #resetScoresButton {
    position: absolute;
    right: 10px;
    padding: 8px 12px;
    border: none;
    color: white;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    border-radius: 4px;
    z-index: 2;
}

#fullscreenButton {
    top: 10px;
    background: rgba(255, 255, 255, 0.2);
}

#resetScoresButton {
    top: 50px;
    background: rgba(255, 0, 0, 0.2);
}

#fullscreenButton:hover {
    background: rgba(255, 255, 255, 0.3);
}

#resetScoresButton:hover {
    background: rgba(255, 0, 0, 0.3);
}

/* Help button moved to bottom left */
.help-button {
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.help-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Confirmation dialog */
.confirmation-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    z-index: 3;
    display: none;
}

.confirmation-dialog p {
    color: white;
    margin-bottom: 20px;
    font-family: 'Nunito', sans-serif;
}

.confirmation-dialog button {
    margin: 0 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
}

.confirm-yes {
    background: #ff4444;
    color: white;
}

.confirm-no {
    background: #666;
    color: white;
}

/* Sound Button */
.sound-button {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 90;
    transition: background-color 0.2s;
}

.sound-button:hover {
    background-color: #555;
}

/* Updated Volume Controls */
.volume-controls {
    position: absolute;
    bottom: 70px; /* Position above the sound button */
    left: 20px;
    background-color: rgba(30, 30, 30, 0.95);
    padding: 15px;
    border-radius: 10px;
    z-index: 95;
    width: 300px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Make sure the volume controls are properly sized when expanded */
.volume-controls:not(.volume-collapsed) {
    height: auto;
}

.volume-collapsed {
    transform: translateY(-20px); /* Changed to move upward when collapsed */
    opacity: 0;
    pointer-events: none;
}

.close-volume-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.volume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #555;
}

.volume-header h3 {
    margin: 0;
    font-size: 18px;
}

.volume-group {
    margin-bottom: 15px;
}

.volume-group:last-child {
    margin-bottom: 0;
}

.volume-label {
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.volume-value {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.2s;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    transition: transform 0.1s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

.volume-slider::-moz-range-thumb:active {
    transform: scale(0.95);
}

/* Help panel styling */
.help-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 20;
    display: none;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.help-content {
    width: 80%;
    max-width: 800px;
    max-height: 90vh;
    background: #111;
    border-radius: 8px;
    padding: 20px;
    color: white;
    font-family: 'Nunito', sans-serif;
    overflow-y: auto;
    position: relative;
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.help-header h1 {
    margin: 0;
    font-size: 28px;
    color: white;
}

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.help-section {
    margin-bottom: 30px;
}

.help-section h2 {
    color: #ff9b9b;
    margin-top: 0;
    font-size: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.difficulty-guide {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.difficulty-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.diff-stars {
    font-size: 20px;
    min-width: 100px;
}

.diff-label {
    font-weight: bold;
    min-width: 80px;
}

.diff-desc {
    color: rgba(255, 255, 255, 0.8);
}

/* Scrollbar styling */
.help-content::-webkit-scrollbar {
    width: 8px;
}

.help-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Settings button */
.settings-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #555;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 5px;
}


.settings-button:hover {
    background-color: #777;
}

/* Settings panel */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.settings-content {
    background-color: #222;
    width: 80%;
    max-width: 700px;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    color: white;
    font-family: 'Nunito', sans-serif;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #333;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.settings-header h1 {
    margin: 0;
    font-size: 28px;
}

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.settings-section {
    margin: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 20px;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h2 {
    margin-top: 0;
    font-size: 22px;
    color: #ccc;
}

/* Key binding styles */
.key-bindings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.key-binding-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.key-binding-button {
    background-color: #444;
    border: 2px solid #666;
    border-radius: 5px;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    padding: 8px 20px;
    min-width: 120px;
    cursor: pointer;
    text-transform: uppercase;
}

.key-binding-confirmed {
    animation: confirmBind 0.5s ease-out forwards;
}

.key-binding-button:hover {
    background-color: #555;
    border-color: #888;
}

.key-binding-button.rebinding {
    background-color: #775500;
    border-color: #ffaa00;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { border-color: #ffaa00; }
    50% { border-color: #ffdd00; }
    100% { border-color: #ffaa00; }
}

/* Add a small animation for key binding confirmation */
@keyframes confirmBind {
    0% { background-color: #775500; }
    50% { background-color: #25a025; }
    100% { background-color: #444; }
}

.secondary-button {
    background-color: #444;
    border: none;
    border-radius: 5px;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    padding: 8px 15px;
    cursor: pointer;
}

.secondary-button:hover {
    background-color: #555;
}

/* Options styles */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.options-button {
    background-color: #444;
    border: none;
    border-radius: 5px;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    padding: 10px 15px;
    cursor: pointer;
    text-align: left;
}

.options-button:hover {
    background-color: #555;
}

.danger-button {
    background-color: rgba(180, 30, 30, 0.7);
}

.danger-button:hover {
    background-color: rgba(220, 30, 30, 0.8);
}

/* Zen Mode Styles */
.zen-mode .volume-controls,
.zen-mode #fullscreenButton,
.zen-mode #resetScoresButton,
.zen-mode #helpButton {
    display: none !important;
}

.zen-mode .settings-button {
    opacity: 0.03;
    transition: opacity 0.3s ease;
}

.zen-mode .settings-button:hover {
    opacity: 1;
}

/* Hide sound button */
.zen-mode .sound-button {
    opacity: 0.03;
    transition: opacity 0.3s ease;
}

.zen-mode .sound-button:hover {
    opacity: 1;
}

/* Toggle switch styles */
.toggle-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #333;
    border-radius: 5px;
    margin-bottom: 10px;
}

.toggle-option span {
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    border-radius: 24px;
    transition: .3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}

input:checked + .toggle-slider {
    background-color: #4CAF50;
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}