/**
 * HFZ Content Gen — Shared Stylesheet
 * ----------------------------------------------------------------------------
 * Dikongsi oleh thumbnail.php, flowjson.php, settings.php supaya semua
 * app guna CSS yang sama (dulu setiap page ada <style> block sendiri yang
 * berulang - sekarang satu fail sahaja, senang update sekali untuk semua).
 *
 * 2026-09-16: SELURUH sistem ditukar ke LIGHT MODE (permintaan HAFIZ) — semua
 * warna hex di bawah dipetakan ke palet slate/violet cerah. Dark mode dibuang.
 */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

[x-cloak] {
    display: none !important;
}

.header-glow {
    background: radial-gradient(circle at 30% 30%, rgba(139,92,246,0.14), transparent 60%);
}

@keyframes refresh-spin {
    to { transform: rotate(360deg); }
}
.refresh-btn.spinning svg {
    animation: refresh-spin 0.6s linear;
}

/* Tooltip info - ikon bulat kecil di sebelah label, tap/click untuk toggle
   (bukan hover-only, sebab hover tak wujud kat mobile). Popup auto letak
   kiri/kanan ikut ruang supaya tak overflow luar skrin kecil. */
.info-tip-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #64748b;
    font-size: 11px;
    line-height: 1;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s;
}
.info-tip-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.info-tip-btn:hover,
.info-tip-btn.active {
    color: #7c3aed;
}
.info-tip-popup {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    max-width: min(320px, calc(100vw - 3rem));
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
    box-shadow: 0 10px 30px rgba(15,23,42,0.12);
}

/* ============================================================
   Modal — ganti native prompt()/confirm() dengan modal moden.
   Reuse untuk semua kes: tukar password, confirm delete, dsb.
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-card {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(15,23,42,0.18);
}
.modal-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}
.modal-card p.modal-sub {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 16px;
}
.modal-input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s;
}
.modal-input:focus {
    border-color: #7c3aed;
}
.modal-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 8px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}
.modal-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border: none;
    cursor: pointer;
}
.modal-btn-cancel {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.modal-btn-cancel:hover {
    color: #0f172a;
}
.modal-btn-primary {
    background: #7c3aed;
    color: #fff;
}
.modal-btn-primary:hover {
    background: #6d28d9;
}
.modal-btn-danger {
    background: #dc2626;
    color: #fff;
}
.modal-btn-danger:hover {
    background: #b91c1c;
}

/* ============================================================
   Date Picker — ganti native <input type="date"> dengan kalendar
   custom moden (native picker style berbeza ikut OS/browser & susah
   nak styling/konsisten kat mobile).
   ============================================================ */
.datepicker-wrap {
    position: relative;
}
.datepicker-input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s;
}
.datepicker-input:hover,
.datepicker-input.active {
    border-color: #7c3aed;
}
.datepicker-input.placeholder-text {
    color: #94a3b8;
}
.datepicker-popup {
    /* position: fixed (bukan absolute) + top/left/width dikira dinamik via JS
       (getBoundingClientRect, lihat toggle() dalam users.php) — supaya popup
       TAK ter-clip bila datepicker diletak dalam container yang ada
       overflow-x-auto/overflow-hidden (contoh: table senarai user), dan TAK
       overflow tepi skrin pada telefon sempit (~320-360px). max-width di sini
       ialah safety net kalau JS belum sempat set width inline. */
    position: fixed;
    z-index: 100;
    width: 260px;
    max-width: calc(100vw - 16px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 20px 50px rgba(15,23,42,0.18);
}
.datepicker-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}
.datepicker-shortcut-btn {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    color: #7c3aed;
    background: transparent;
    border: 1px dashed #c4b5fd;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.datepicker-shortcut-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}
.datepicker-nav-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.datepicker-nav-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.datepicker-month-label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-top: 8px;
}
.datepicker-dow {
    font-size: 10px;
    text-align: center;
    color: #94a3b8;
    padding: 4px 0;
}
.datepicker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 8px;
    color: #0f172a;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.datepicker-day:hover {
    background: #e2e8f0;
}
.datepicker-day.outside-month {
    color: #cbd5e1;
}
.datepicker-day.is-today {
    color: #7c3aed;
    font-weight: 600;
}
.datepicker-day.is-selected {
    background: #7c3aed;
    color: #fff;
    font-weight: 600;
}
.datepicker-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}
.datepicker-footer button {
    font-size: 11px;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
}
.datepicker-footer button:hover {
    color: #7c3aed;
}

/* 2026-09-16: icon (Lucide <svg>/emoji) di dalam <button> TIDAK menangkap klik —
   klik sentiasa jatuh pada button induk. Fix untuk kes "kena klik bucu button
   baru berfungsi" di Settings → Menu & Module (icon picker/butang baris). */
button svg.lucide,
button [data-lucide],
button .lucide { pointer-events: none; }

/* 2026-09-16: Label field tak nampak bold di MOBILE. Punca: font-semibold =
   weight 600; font sistem Android (Roboto) hanya ada 400/500/700 — Chrome
   Android petakan 600 ke 500 (Medium) yang hampir sama dengan biasa. Desktop
   (Segoe UI / SF) ada 600 sebenar, sebab tu nampak beza. Di skrin <768px
   naikkan semua font-semibold ke 700 supaya hierarki tajuk jelas di telefon. */
/* !important WAJIB: Tailwind CDN (cdn.tailwindcss.com) inject <style> secara
   runtime ke HUJUNG <head> — selepas <link app.css>. Rule Tailwind
   `.font-semibold{font-weight:600}` datang KEMUDIAN dengan specificity sama,
   jadi rule ni kalah tanpa !important (sebab fix asal 10:13 tak nampak di phone). */
@media (max-width: 767px) {
    .font-semibold { font-weight: 700 !important; }
}
