/**
 * Styles for Virtual Gamepad (VGP) in EmulatorJS plugin.
 * @file ejs-vgp.css
 * @since 1.0.0
 */

/* General button styles for pixel art */
.ejs_virtualGamepad_button,
.ejs_dpad_main,
.b_a, .b_b, .b_x, .b_y,
.b_start, .b_select, .b_l, .b_r,
.b_speed_fast, .b_speed_slow, .b_speed_rewind {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    border: none !important;
    border-radius: 50%;
    cursor: pointer;
    image-rendering: pixelated;
    box-shadow: 0 3px #000, 0 -3px #000, 3px 0 #000, -3px 0 #000, 0 10px #00000038, 5px 5px #00000038, -5px 5px #00000038, inset 0 5px #ffffff36;
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: none;
    position: absolute;
}

/* Specific button styles */
.b_a {
    background-color: #d83434 !important; /* Red */
}

.b_b {
    background-color: #1c74ba !important; /* Blue */
}

.b_x {
    background-color: #e430a6 !important; /* Pink */
}

.b_y {
    background-color: #34b54f !important; /* Green */
}

.ejs_virtualGamepad_button_down {
    transform: translateY(5px);
    box-shadow: 0 3px #000, 0 -3px #000, 3px 0 #000, -3px 0 #000, inset 0 5px #00000038;
}

/* D-pad and other buttons */
.ejs_dpad_main,
.b_start, .b_select, .b_l, .b_r,
.b_speed_fast, .b_speed_slow, .b_speed_rewind {
    background-color: #2e2e2e !important; /* Dark gray */
}

.ejs_dpad_main {
    width: 125px !important;
    height: 125px !important;
}

.b_start, .b_select, .b_l, .b_r,
.b_speed_fast, .b_speed_slow, .b_speed_rewind {
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
}

.b_speed_rewind {
    width: 60px !important; /* Match default width */
    border-radius: 10px; /* Rectangle for rewind */
}

.ejs_dpad_bar {
    background: #787878; /* Keep sub-component color */
}

/* Edit button */
.ejs-vgp-edit-button {
    position: absolute;
    top: 7px;
    right: 52px;
    background: transparent !important;
    border: none;
    border-radius: 4px;
    padding: 3px;
    cursor: pointer;
    z-index: 10000;
}

.ejs-vgp-edit-button svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Notification */
.ejs-vgp-notification {
    position: fixed;
    top: 0;
    width: 100%;
    left: 0;
    background: #000;
    color: #fff;
    padding: 5px;
    line-height: 1.5;
    text-align: center;
    z-index: 10001;
}

.ejs-vgp-notification p {
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 5px;
    font-size: 13px;
}

/* Notification buttons */
.ejs-vgp-reset,
.ejs-vgp-save,
.ejs-vgp-close {
    border-radius: 0.25rem;
    font-size: .875rem;
    padding: 0.2rem 1rem;
    display: inline-block;
    background-color: rgba(var(--ejs-primary-color), 1);
    color: #fff !important;
    border: none;
    cursor: pointer;
}

/* Editable state */
.ejs-vgp-editable {
    border: 2px dashed #fff !important;
    background: rgba(0, 0, 0, 0.5) !important;
    cursor: move !important;
    pointer-events: auto !important;
    z-index: 10002 !important;
    transition: none !important;
    -webkit-transition: none !important;
    border-radius: 50%;
}

.ejs-vgp-selected {
    border: 2px dashed #00b7eb !important;
    will-change: transform, left, top;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

/* Resume button */
.ejs-resume-button {
    position: relative;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    display: flex;
    justify-content: center;
    font-size: 20px;
    line-height: 45px;
    text-transform: uppercase;
    font-weight: bolder;
    text-decoration: none;
    width: fit-content;
    padding: 0 40px;
    white-space: nowrap;
    height: 45px;
    border: none;
    color: #fff !important;
    border-radius: 5px;
    text-align: center;
    background-color: #dd2020;
    z-index: 1000;
    box-shadow: 0 5px #000, 0 -5px #000, 5px 0 #000, -5px 0 #000, 0 10px #00000038, 5px 5px #00000038, -5px 5px #00000038, inset 0 5px #ffffff36;
}

/* Fast forward toggle */
.ejs-fast-forward-toggle {
    position: absolute;
    top: 5px;
    right: 87px;
    background: rgba(0, 0, 0, .1);
    color: #fff;
    padding: 5px 8px;
    border-radius: 5px;
    z-index: 10000;
    font-size: 13px;
}

.ejs-fast-forward-toggle label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ejs-fast-forward-toggle input {
    margin: 0;
}

/* Exit fullscreen button */
.ejs-exit-fullscreen-button {
    position: absolute;
    top: 5px;
    left: 10px;
    background: transparent !important;
    border: none;
    border-radius: 4px;
    padding: 3px;
    cursor: pointer;
    z-index: 10000;
    opacity: .7;
}

.ejs-exit-fullscreen-button svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Black overlay */
.ejs-black-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333333;
    z-index: 999;
}

/* Virtual gamepad parent */
.ejs_virtualGamepad_parent {
    bottom: 0 !important;
    width: 100%;
    position: absolute;
}

/* Menu open button */
.ejs_virtualGamepad_open {
    right: 10px !important;
    display: inline-block;
    width: 30px;
    height: 30px;
    color: #fff;
    position: absolute;
    top: 5px;
    opacity: .5;
    z-index: 999;
}

.ejs_virtualGamepad_open svg {
    fill: currentColor;
}