/* ============================================================
   JELYAHOME — COMPONENTS CSS
   Buttons, Inputs, Toggles, Checkboxes, Badges, Progress
   ============================================================ */

/* --- Buttons --- */
.jh-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 20px; border-radius: var(--R-sm); font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; border: none; transition: all var(--T2) var(--spring); white-space: nowrap;
}
.jh-btn:active { transform: scale(.96); }
.jh-btn-p { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; box-shadow: var(--accent-sh); }
.jh-btn-p:hover { box-shadow: 0 6px 24px rgba(var(--accent-rgb),.35); transform: translateY(-1px); }
.jh-btn-s { background: var(--accent-bg); color: var(--accent-light); border: 1px solid rgba(var(--accent-rgb),.3); }
.jh-btn-s:hover { background: var(--accent-bg-h); }
.jh-btn-g { background: transparent; color: var(--tx2); border: 1px solid var(--bd); }
.jh-btn-g:hover { background: var(--accent-bg); color: var(--tx1); }
.jh-btn-d { background: rgba(239,68,68,.1); color: var(--err); border: 1px solid rgba(239,68,68,.2); }
.jh-btn-d:hover { background: rgba(239,68,68,.18); }
.jh-btn-ok { background: rgba(34,197,94,.1); color: var(--ok); border: 1px solid rgba(34,197,94,.2); }
.jh-btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--R-xs); }
.jh-btn-full { width: 100%; }
.jh-btn-ico { width: 36px; height: 36px; padding: 0; justify-content: center; }

/* --- Inputs --- */
.jh-inp-g { display: flex; flex-direction: column; gap: 5px; }
.jh-lbl { font-size: 11px; font-weight: 700; color: var(--tx2); text-transform: uppercase; letter-spacing: .5px; }
.jh-inp {
    height: 40px; padding: 0 14px; border-radius: var(--R-sm);
    border: 1px solid var(--inpB); background: var(--inp); color: var(--tx1);
    font-family: inherit; font-size: 14px; outline: none; transition: all var(--T2); width: 100%;
}
.jh-txa {
    padding: 10px 14px; border-radius: var(--R-sm);
    border: 1px solid var(--inpB); background: var(--inp); color: var(--tx1);
    font-family: inherit; font-size: 14px; outline: none; transition: all var(--T2);
    width: 100%; min-height: 80px; resize: vertical; line-height: 1.5;
}
.jh-inp:focus, .jh-txa:focus {
    border-color: var(--accent); background: var(--inpF);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.jh-inp-hint { font-size: 10px; color: var(--tx3); }

/* --- Toggles --- */
.jh-tgl-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; cursor: pointer; user-select: none; }
.jh-tgl {
    width: 44px; height: 24px; border-radius: 100px; background: var(--bg3);
    border: none; position: relative; transition: background var(--T2), box-shadow var(--T2);
    flex-shrink: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.15);
}
.jh-tgl::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; transition: transform var(--T2) var(--spring);
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.jh-tgl.on { background: var(--accent); box-shadow: inset 0 1px 3px rgba(0,0,0,.1); }
.jh-tgl.on::after { transform: translateX(20px); }

/* --- Checkboxes --- */
.jh-chk {
    width: 20px; height: 20px; border-radius: var(--R-xs); border: 2px solid var(--bdH);
    cursor: pointer; transition: all var(--T2) var(--spring);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: transparent;
}
.jh-chk.on { background: var(--accent); border-color: var(--accent); animation: jh-ckPop .3s var(--spring); }
.jh-chk.on::after { content: ''; width: 5px; height: 9px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg) translateY(-1px); }
@keyframes jh-ckPop { 50% { transform: scale(1.15); } }

/* --- Badges --- */
.jh-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--R-full); font-size: 11px; font-weight: 600; }
.jh-badge-a { background: var(--accent-bg); color: var(--accent-light); }
.jh-badge-ok { background: rgba(34,197,94,.12); color: var(--ok); }
.jh-badge-w { background: rgba(245,158,11,.12); color: var(--warn); }
.jh-badge-e { background: rgba(239,68,68,.12); color: var(--err); }

/* --- Progress --- */
.jh-prog { height: 7px; border-radius: 100px; background: var(--inp); overflow: hidden; }
.jh-prog-bar { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--accent), var(--accent-light)); transition: width 1s var(--ease); }

/* --- Skeleton --- */
.jh-skel { background: linear-gradient(90deg, var(--inp) 25%, var(--bdH) 50%, var(--inp) 75%); background-size: 200% 100%; animation: jh-sk 1.5s infinite; border-radius: var(--R-sm); }
@keyframes jh-sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Toast (component style) --- */
.jh-toast {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    border-radius: var(--R-md); background: var(--glH);
    backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glB); box-shadow: var(--sh-lg);
    pointer-events: auto; font-size: 13px; cursor: pointer;
    animation: jh-tIn .4s var(--spring) both;
}
.jh-toast.out { animation: jh-tOut .3s var(--ease) both; }
.jh-toast-ic { width: 28px; height: 28px; border-radius: var(--R-xs); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.jh-toast-ok .jh-toast-ic { background: rgba(34,197,94,.15); color: var(--ok); }
.jh-toast-err .jh-toast-ic { background: rgba(239,68,68,.15); color: var(--err); }
.jh-toast-w .jh-toast-ic { background: rgba(245,158,11,.15); color: var(--warn); }
.jh-toast-i .jh-toast-ic { background: rgba(14,165,233,.15); color: var(--info); }
.jh-toast-bd { flex: 1; min-width: 0; }
.jh-toast-t { font-weight: 600; color: var(--tx1); }
.jh-toast-m { font-size: 12px; color: var(--tx2); margin-top: 1px; }
.jh-toast-x { color: var(--tx3); cursor: pointer; font-size: 14px; border: none; background: none; padding: 2px; }
@keyframes jh-tIn { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: none; } }
@keyframes jh-tOut { to { opacity: 0; transform: translateY(-100%); } }

/* --- Bottom Sheet --- */
.jh-bsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; pointer-events: none; }
.jh-bsheet-bg {
    position: fixed; inset: 0; background: var(--overlay);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity var(--T2);
}
.jh-bsheet.on .jh-bsheet-bg { opacity: 1; pointer-events: auto; }
.jh-bsheet-panel {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--bgE); border-radius: var(--R-xl) var(--R-xl) 0 0;
    box-shadow: var(--sh-xl); transform: translateY(100%); transition: transform var(--T3) var(--ease);
    display: flex; flex-direction: column; pointer-events: auto; overflow: hidden; max-height: 70dvh;
}
.jh-bsheet.on .jh-bsheet-panel { transform: none; }
.jh-bsheet-handle { width: 36px; height: 4px; border-radius: 100px; background: var(--tx3); opacity: .35; margin: 10px auto 6px; flex-shrink: 0; }
.jh-bsheet-title { padding: 4px 20px 12px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--bd); flex-shrink: 0; color: var(--tx1); }
.jh-bsheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 20px; flex: 1; }

/* --- Modal (desktop) --- */
.jh-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.jh-modal-bg {
    position: fixed; inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity var(--T2);
}
.jh-modal.on .jh-modal-bg { opacity: 1; pointer-events: auto; }
.jh-modal-box {
    position: relative; z-index: 1;
    width: 90%; max-width: 480px; max-height: 80vh;
    background: var(--bgE);
    border: 1px solid var(--glB);
    border-radius: var(--R-xl);
    box-shadow: var(--sh-xl);
    display: flex; flex-direction: column;
    overflow: hidden;
    pointer-events: none;
    opacity: 0; transform: scale(.95) translateY(10px);
    transition: opacity var(--T3) var(--ease), transform var(--T3) var(--ease);
}
.jh-modal.on .jh-modal-box { opacity: 1; transform: none; pointer-events: auto; }
.jh-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--bd); flex-shrink: 0;
}
.jh-modal-title { font-size: 16px; font-weight: 700; color: var(--tx1); }
.jh-modal-close {
    width: 32px; height: 32px; border-radius: var(--R-sm);
    border: none; background: var(--accent-bg); color: var(--tx2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; transition: all var(--T2);
}
.jh-modal-close:hover { background: var(--accent-bg-h); color: var(--tx1); }
.jh-modal-body { overflow-y: auto; padding: 16px 20px 20px; flex: 1; }

/* --- Color Picker (shared, used in Panel) --- */
.jh-cpicker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 4px 0 8px; }
.jh-cpicker-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 4px; border-radius: var(--R-sm); border: none;
    cursor: pointer; background: none; transition: all var(--T2) var(--spring);
}
.jh-cpicker-btn:active { transform: scale(.92); }
.jh-cpicker-dot {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform var(--T2);
}
.jh-cpicker-dot i { color: #fff; font-size: 16px; opacity: 0; transition: opacity var(--T2); }
.jh-cpicker-name { font-size: 11px; color: var(--tx3); font-weight: 500; font-family: inherit; }
.jh-cpicker-btn.on .jh-cpicker-dot { transform: scale(1.1); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.jh-cpicker-btn.on .jh-cpicker-dot i { opacity: 1; }
.jh-cpicker-btn.on .jh-cpicker-name { color: var(--tx1); font-weight: 600; }

/* --- Panel list items (shared) --- */
.jh-dev-sheet-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 4px; border-bottom: 1px solid var(--bd);
    cursor: pointer; transition: background var(--T2); border-radius: var(--R-xs);
}
.jh-dev-sheet-item:hover { background: var(--accent-bg); }
.jh-dev-sheet-item:last-child { border-bottom: none; }
.jh-dev-sheet-item i { font-size: 18px; width: 24px; text-align: center; }
.jh-dev-sheet-item-t { font-size: 14px; font-weight: 600; }
.jh-dev-sheet-item-s { font-size: 12px; color: var(--tx3); }
