/**
 * OLAMI Master Manager — Push Notification Styles
 *
 * Compact trigger button + modal overlay on dashboard.
 * Also used by Command Center notifications page.
 * Follows existing .odv2-* class conventions from dashboard-v2.css.
 *
 * @since Phase Push v1
 */

/* ─── Dashboard Trigger Button (compact row under mini-stats) ── */

.odv2-push-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(128, 128, 128, 0.15);
    background: rgba(128, 128, 128, 0.06);
    color: #555;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
}

[data-theme="dark"] .odv2-push-trigger,
.dark .odv2-push-trigger {
    color: #aaa;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.odv2-push-trigger:hover {
    background: rgba(128, 128, 128, 0.12);
}

.odv2-push-trigger-icon {
    font-size: 16px;
    line-height: 1;
}

.odv2-push-trigger-label {
    flex: 1;
}

.odv2-push-trigger-status {
    font-size: 11px;
    color: #999;
}

.odv2-push-trigger-arrow {
    font-size: 18px;
    color: #bbb;
    font-weight: 300;
}

/* ─── Modal Overlay ─────────────────────────────────── */

.odv2-push-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: odv2PushFadeIn 0.15s ease;
}

@keyframes odv2PushFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.odv2-push-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: odv2PushSlideUp 0.2s ease;
}

[data-theme="dark"] .odv2-push-modal,
.dark .odv2-push-modal {
    background: #1e1e1e;
}

@keyframes odv2PushSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.odv2-push-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.odv2-push-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(128, 128, 128, 0.1);
    color: #666;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.odv2-push-modal-close:hover {
    background: rgba(128, 128, 128, 0.2);
}

.odv2-push-modal-body {
    padding: 16px 20px 20px;
}

/* ─── Title (shared by modal + CC page) ─────────────── */

.odv2-push-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

[data-theme="dark"] .odv2-push-title,
.dark .odv2-push-title {
    color: #eee;
}

/* ─── Enable/Disable Toggle Button ──────────────────── */

button.odv2-push-toggle,
.odv2-push-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 2px solid #999 !important;
    background: transparent !important;
    color: #333 !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}

[data-theme="dark"] button.odv2-push-toggle,
[data-theme="dark"] .odv2-push-toggle,
.dark button.odv2-push-toggle,
.dark .odv2-push-toggle {
    border-color: #777 !important;
    background: transparent !important;
    color: #ccc !important;
}

button.odv2-push-toggle:hover,
.odv2-push-toggle:hover {
    border-color: #E21B4D !important;
    color: #E21B4D !important;
}

button.odv2-push-toggle.odv2-push-on,
.odv2-push-toggle.odv2-push-on {
    background: #E21B4D !important;
    border-color: #E21B4D !important;
    color: #fff !important;
}

button.odv2-push-toggle.odv2-push-on:hover,
.odv2-push-toggle.odv2-push-on:hover {
    opacity: 0.9;
}

button.odv2-push-toggle:disabled,
.odv2-push-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Status Text ───────────────────────────────────── */

.odv2-push-status {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ─── Preference Section ────────────────────────────── */

.odv2-push-prefs {
    border-top: 1px solid rgba(128, 128, 128, 0.15);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.odv2-push-prefs-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 2px;
}

/* ─── Individual Preference Row ─────────────────────── */

.odv2-push-pref {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.odv2-push-pref-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.odv2-push-pref-icon {
    font-size: 16px;
    line-height: 1;
    width: 24px;
    text-align: center;
}

.odv2-push-pref-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

[data-theme="dark"] .odv2-push-pref-name,
.dark .odv2-push-pref-name {
    color: #ddd;
}

/* ─── Toggle Switch ─────────────────────────────────── */

.odv2-push-switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.odv2-push-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.odv2-push-switch .odv2-push-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.2s ease;
}

[data-theme="dark"] .odv2-push-switch .odv2-push-slider,
.dark .odv2-push-switch .odv2-push-slider {
    background: #4b5563;
}

.odv2-push-switch .odv2-push-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.odv2-push-switch input:checked + .odv2-push-slider {
    background: var(--primary, #E21B4D);
}

.odv2-push-switch input:checked + .odv2-push-slider::before {
    transform: translateX(18px);
}

/* ─── Test Button ───────────────────────────────────── */

.odv2-push-test {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-theme="dark"] .odv2-push-test,
.dark .odv2-push-test {
    background: #2a2a2a;
    border-color: #444;
    color: #bbb;
}

.odv2-push-test:hover {
    background: #f3f4f6;
    color: #333;
}

.odv2-push-test:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
