/* =========================================
   PRAYER WIDGET - GAYA UTAMA (BASE STYLES)
   ========================================= */

.pw-root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

.pw-card {
    background: linear-gradient(180deg, #0b7a1a, #046b10);
    padding: 18px;
    max-width: 520px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    margin: 0 auto;
    position: relative; /* Untuk positioning tombol info */
}

.pw-card h1 {
    font-size: 24px;
    margin: 0 0 8px;
    text-align: center;
}

.pw-clock {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    line-height: 1;
}

.pw-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.pw-controls select,
.pw-settings select {
    padding: 6px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    color: #fff;
    width: 100%; /* Agar select mengisi ruang */
}

.pw-controls button {
    padding: 6px 8px;
    border-radius: 4px;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.pw-times {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 kolom dengan lebar sama */
    gap: 8px;
}

.pw-times .pw-item {
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.pw-item .pw-name {
    font-size: 13px;
    opacity: 0.9;
}

.pw-item .pw-time {
    font-size: 16px;
    font-weight: 700;
    margin-top: 6px;
}

.pw-date {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.12);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
}

.pw-settings {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 kolom dengan lebar sama */
    gap: 12px; /* Sedikit lebih besar untuk kerapian */
    align-items: center;
    font-size: 13px;
}

.pw-settings label {
    display: flex;
    flex-direction: column; /* Mengubah orientasi label */
    gap: 4px;
    align-items: flex-start; /* Label teks di atas */
    color: rgba(255, 255, 255, 0.9);
}

.pw-loading,
.pw-error {
    padding: 14px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    text-align: center;
    font-size: 0.95rem;
}

/* ==================================
   GAYA UNTUK TOMBOL INFO EMBED
   ================================== */

.pw-info-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

.pw-info-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    font-family: serif;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.pw-info-trigger:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.pw-info-popup {
    display: none;
    position: absolute;
    top: 30px;
    right: 0;
    background-color: #ffffff;
    color: #333;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    text-align: left;
}

.pw-info-popup.pw-popup-visible {
    display: block;
}

.pw-info-popup p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}
.pw-info-popup p:last-child {
    margin-bottom: 0;
}
.pw-info-popup strong {
    color: #000;
}

.pw-info-popup textarea {
    width: 100%;
    height: 140px;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    resize: none;
    box-sizing: border-box;
}

.pw-info-popup .pw-info-copy-text {
    font-size: 12px;
    color: #777;
    margin-top: -5px;
}

.pw-info-popup .pw-info-feedback {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 12px;
}

.pw-info-popup a {
    color: #0b7a1a;
    text-decoration: none;
}
.pw-info-popup a:hover {
    text-decoration: underline;
}

/* ===============================================
   PENYESUAIAN KHUSUS UNTUK HALAMAN EMBED
   =============================================== */

body.halaman-embed {
    height: auto;
    padding-bottom: 0 !important;
    overflow: hidden;
}

/* Sembunyikan tombol deteksi lokasi & pengaturan */
body.halaman-embed #pw-loc-btn,
body.halaman-embed .pw-settings {
    display: none;
}

/* Atur dropdown kota agar di tengah */
body.halaman-embed .pw-controls {
    justify-content: center;
}
body.halaman-embed #pw-city-select {
    flex-grow: 1;
    max-width: 250px;
}


/* =========================================
   GAYA RESPONSIVE (MOBILE & TABLET)
   ========================================= */

/* Untuk layar tablet ke bawah */
@media (max-width: 600px) {
    .pw-settings {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .pw-settings label {
        justify-content: space-between;
    }
    .pw-settings select {
        max-width: 60%;
    }
}

/* Untuk layar ponsel */
@media (max-width: 420px) {
    .pw-card {
        padding: 12px;
    }
    .pw-clock {
        font-size: 28px;
    }
    .pw-item .pw-name {
        font-size: 12px;
    }
    .pw-item .pw-time {
        font-size: 15px;
    }
}

/* Untuk layar sangat kecil */
@media (max-width: 340px) {
    .pw-card {
        padding: 0.8rem;
    }
    .pw-clock {
        font-size: 1.8rem;
    }
    .pw-times .pw-item {
        /* Kembali menjadi 1 kolom agar tidak terlalu sempit */
        grid-template-columns: 1fr;
    }
}

.pw-settings label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: rgba(255, 255, 255, 0.9); /* Tambahkan warna agar terlihat */
}

/* Gaya untuk Tanggal */
.pw-date {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.12);
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    line-height: 1.4; /* Beri sedikit ruang untuk dua baris */
}

/* Gaya khusus untuk tanggal Hijriah */
.pw-hijri-date {
    font-size: 0.85em; /* Ukuran sedikit lebih kecil */
    opacity: 0.9;
}