/* Reset Dasar dan Font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Kontainer utama */
.container {
    text-align: center;
    background-color: #34495e;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
}

h1 {
    margin-bottom: 10px;
}

p {
    margin-bottom: 25px;
    color: #bdc3c7;
}

/* Grup Input - PERBAIKAN */
.input-group {
    display: flex;
    margin-bottom: 30px;
}

#hexInput {
    flex-grow: 1; /* Biarkan input mengambil sisa ruang */
    min-width: 0; /* Mencegah input meluap saat layar kecil */
    padding: 12px;
    border: 2px solid #7f8c8d;
    border-radius: 6px 0 0 6px;
    background-color: #2c3e50;
    color: #fff;
    font-size: 16px;
    text-transform: uppercase;
    outline: none;
    border-right: none; /* Hapus border kanan agar menyatu */
}

#hexInput:focus {
    border-color: #3498db;
}

#showColorBtn {
    flex-shrink: 0; /* Mencegah tombol mengecil */
    padding: 12px 20px;
    border: 2px solid #3498db;
    background-color: #3498db;
    color: white;
    font-size: 16px;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    transition: background-color 0.3s;
}

#showColorBtn:hover {
    background-color: #2980b9;
}

/* Palet Warna */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.color-swatch {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

/* Tampilan Warna Fullscreen */
#colorDisplay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    cursor: pointer; /* Menandakan area bisa diklik */
}

#exitBtn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    opacity: 0.5;
    /* Transisi untuk efek menghilang/muncul */
    transition: opacity 0.5s ease-in-out;
    z-index: 1001;
}

#exitBtn:hover {
    opacity: 1;
}

/* Kelas untuk menyembunyikan tombol X */
#exitBtn.hidden {
    opacity: 0;
    pointer-events: none; /* Agar tidak bisa diklik saat transparan */
}
