/* PrayerPop admin toggle switch.
 *
 * One definition, shared by every admin screen that offers a toggle: the
 * settings tabs, the dashboard, campaigns, and the Chat inbox. It used to live
 * inside prayer-pop-admin.css, which the Chat inbox does not load — so a
 * toggle rendered there fell back to a bare checkbox. Registered as its own
 * handle ('prayer-pop-toggle') and pulled in as a dependency rather than
 * copied, so the control cannot drift between screens.
 */

.prayer-pop-toggle-wrapper {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    margin-bottom: 10px;
    min-width: 0;
}

.prayer-pop-toggle-switch {
    position: relative;
    display: block;
    width: 90px;
    min-width: 90px;
    height: 24px;
    margin: 0;
}

.prayer-pop-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    position: absolute;
}

.prayer-pop-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    width: 50px;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.prayer-pop-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.prayer-pop-toggle-slider {
    background-color: #2271b1;
}

input:focus+.prayer-pop-toggle-slider {
    box-shadow: 0 0 1px #2271b1;
}

input:checked+.prayer-pop-toggle-slider:before {
    transform: translateX(26px);
}

/* Locked toggle (e.g. Chat while the Messenger layout is selected).
   WordPress core gives every disabled checkbox opacity: .7, which un-hides the
   real checkbox this switch covers and draws its checkmark as a stray blue
   line above the slider — so the hidden state is restated for disabled too. */
.prayer-pop-toggle-switch input,
.prayer-pop-toggle-switch input:disabled,
.prayer-pop-toggle-switch input:disabled:checked::before {
    opacity: 0 !important;
}

.prayer-pop-toggle-switch input:disabled + .prayer-pop-toggle-slider {
    background-color: #c3c4c7;
    cursor: not-allowed;
}

.prayer-pop-toggle-switch input:disabled:checked + .prayer-pop-toggle-slider {
    background-color: #a7aaad;
}

.prayer-pop-toggle-switch input:disabled + .prayer-pop-toggle-slider:before {
    background-color: #f6f7f7;
}

.prayer-pop-toggle-switch input:disabled ~ .toggle-status {
    color: #a7aaad;
}

.toggle-status {
    display: block;
    margin-left: 60px;
    font-weight: 500;
    color: #50575e;
    min-width: 30px;
    line-height: 24px;
}

/* Description text */
.prayer-pop-toggle-wrapper .description {
    min-width: 0;
    margin: 0;
    color: #646970;
    font-style: italic;
    overflow-wrap: anywhere;
}

/* The compact size the admin screens use at narrow widths. */
@media screen and (max-width: 782px) {
    .prayer-pop-toggle-switch {
        width: 80px;
        min-width: 80px;
        height: 20px;
    }

    .prayer-pop-toggle-wrapper {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .prayer-pop-toggle-slider {
        width: 40px;
    }

    .prayer-pop-toggle-slider:before {
        height: 12px;
        width: 12px;
    }

    input:checked+.prayer-pop-toggle-slider:before {
        transform: translateX(20px);
    }

    .toggle-status {
        margin-left: 50px;
        line-height: 20px;
    }
}
