/* Import Google Font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* Mengatur tampilan umum untuk semua elemen */
* {
    margin: 0; /* Menghilangkan margin default */
    padding: 0; /* Menghilangkan padding default */
    box-sizing: border-box; /* Mengatur box sizing agar padding dan border tidak mempengaruhi ukuran elemen */
    font-family: 'Poppins', sans-serif; /* Menggunakan font Poppins */
}

/* Mengatur tampilan dasar halaman */
body {
    display: flex; /* Menjadikan halaman flexbox */
    align-items: center; /* Menyelaraskan item secara vertikal */
    justify-content: center; /* Menyelaraskan item secara horizontal */
    min-height: 100vh; /* Tinggi minimum halaman adalah 100% viewport */
    background: #f2f2f2; /* Warna latar belakang halaman */
}

/* Container utama */
.wrapper {
    width: 780px; /* Lebar container */
    padding: 35px 40px; /* Padding container */
    border-radius: 20px; /* Membulatkan sudut container */
    background: #141414; /* Warna background container */
}

/* Style untuk judul */
header h2 {
    color: #fff;
    font-size: 1.6rem;
}

/* Kolom dalam header */
header .column {
    display: flex;
    width: calc(100% / 2);
    align-items: center;
    margin: 15px 0;
    justify-content: space-between;
}

/* Input dalam header */
header input {
    height: 100%;
    outline: none;
    border: none;
    border-radius: 15px;
}

/* Slider volume */
.volume-slider input {
    accent-color: #fff; /* Warna slider */
}

/* Checkbox untuk menampilkan tombol */
.keys-checkbox input {
    height: 20px;
    width: 40px;
    cursor: pointer;
    appearance: none;
    position: relative;
    background: #4b4b4b;
    border-radius: 20px;
}

/* Desain tombol toggle saat belum dicentang */
.keys-checkbox input::before {
    content: '';
    height: 16px;
    width: 16px;
    position: absolute;
    top: 50%;
    left: 5px;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

/* Desain tombol toggle saat dicentang */
.keys-checkbox input:checked::before {
    left: 20px;
}

/* Gaya untuk daftar tombol piano */
.piano-keys {
    display: flex;
    list-style: none;
    margin-top: 40px;
}

/* Gaya untuk tombol */
.piano-keys .key {
    cursor: pointer;
    user-select: none;
    position: relative;
    text-transform: uppercase;
}

/* Gaya untuk tombol hitam */
.piano-keys .black {
    z-index: 2;
    height: 140px;
    width: 44px;
    margin: 0 -22px 0 -22px;
    border-radius: 0 0 5px 5px;
    background: linear-gradient(#333, #000);
}

/* Efek saat tombol hitam ditekan */
.piano-keys .black.active {
    box-shadow: inset -5px -8px 10px rgba(255,255,255,0.1);
    background: linear-gradient(to bottom, #000, #434343);
}

/* Gaya untuk tombol putih */
.piano-keys .white {
    height: 230px;
    width: 70px;
    border-radius: 8px;
    border: 1px solid #b3b3b3;
    background: linear-gradient(#fff 96%, #eee 4%);
}

/* Efek saat tombol putih ditekan */
.piano-keys .white.active {
    box-shadow: inset -5px -8px 20px rgba(0,0,0,0.2);
    background: linear-gradient(to bottom, #fff, #ddd);
}

/* Gaya teks pada tombol piano */
.piano-keys .key span {
    position: absolute;
    bottom: 12px;
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    color: #777;
}

/* Menyembunyikan teks tombol piano saat opsi disembunyikan */
.piano-keys .key.hide span {
    display: none;
}

/* Responsif untuk layar kecil (maksimum 815px) */
@media screen and (max-width: 815px) {
    .wrapper {
        padding: 25px;
    }

    header {
        flex-direction: column;
    }

    header > *:nth-child(2), 
    header > *:nth-child(3) {
        margin-bottom: 15px;
    }

    .volume-slider input {
        max-width: 100px;
    }

    .piano-keys {
        margin-top: 20px;
    }

    .piano-keys .key:nth-child(9), 
    .piano-keys .key:nth-child(10) {
        display: none;
    }

    .piano-keys .black {
        width: 40px;
        margin: 0 -20px;
    }

    .piano-keys .white {
        height: 180px;
        width: 60px;
    }
}

/* Responsif untuk layar lebih kecil (maksimum 550px) */
@media screen and (max-width: 550px) {
    .piano-keys .black:nth-child(10),
    .piano-keys .black:nth-child(11),
    .piano-keys .black:nth-child(12),
    .piano-keys .black:nth-child(13),
    .piano-keys .black:nth-child(14),
    .piano-keys .black:nth-child(15) {
        display: none;
    }

    .piano-keys .white {
        width: 50px;
    }
}