/* ============================================================
 * MatLuk FotoChallenge — Notifications-Settings (Iter V.6)
 *
 * Erweitert das bestehende acc-detail / vis-option Pattern um
 * Toggle-Variante (Switch statt Radio) und die Push-Status-Box.
 * ============================================================ */

/* === Section-Label (Gruppen-Ueberschrift) === */
.acc-card .acc-section-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin: 16px 0 8px;
}
.acc-card .acc-section-label:first-child {
    margin-top: 0;
}

/* === Toggle-Variante von vis-option === */
/* Bestehende vis-option ist Radio-Pattern (input + div). Hier flippen wir
 * die Reihenfolge: text links, toggle rechts, kein gesamt-clickable Border. */
.vis-option.vis-option-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.vis-option.vis-option-toggle:hover {
    background: rgba(0,0,0,0.02);
}
.vis-option.vis-option-toggle div {
    flex: 1;
    min-width: 0;
}
.vis-option.vis-option-toggle strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}
.vis-option.vis-option-toggle small {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}
/* Aktiv markieren wenn Checkbox an */
.vis-option.vis-option-toggle:has(input:checked) {
    border-color: var(--brand, #4f46e5);
    background: rgba(79, 70, 229, 0.04);
}

/* hr in acc-card etwas dezenter */
.acc-card hr {
    border: 0;
    border-top: 1px solid var(--border, rgba(0,0,0,0.08));
    margin: 18px 0 12px;
}

/* === Push-Status-Box === */
.push-status-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface-alt, rgba(0,0,0,0.03));
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    margin: 14px 0;
}
.push-status-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
    width: 44px;
    text-align: center;
}
.push-status-text {
    flex: 1;
    min-width: 0;
}
.push-status-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}
.push-status-detail {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
}

.push-status-box[data-state="on"] {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.10), rgba(34, 197, 94, 0.04));
    border-color: rgba(34, 197, 94, 0.3);
}
.push-status-box[data-state="on"] .push-status-title {
    color: #16a34a;
}
.push-status-box[data-state="off"] {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.25);
}
.push-status-box[data-state="off"] .push-status-title {
    color: #b45309;
}
.push-status-box[data-state="denied"],
.push-status-box[data-state="unsupported"],
.push-status-box[data-state="error"] {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.25);
}
.push-status-box[data-state="denied"] .push-status-title,
.push-status-box[data-state="unsupported"] .push-status-title,
.push-status-box[data-state="error"] .push-status-title {
    color: #b91c1c;
}

/* === Push-Action-Buttons === */
.push-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.push-actions .btn {
    flex: 1 1 auto;
    min-width: 140px;
}

/* === Push-Result-Message === */
.push-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}
.push-msg-ok {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.push-msg-error {
    background: rgba(239, 68, 68, 0.10);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================
   10. Master-Switch (großer Hauptschalter ganz oben)
   ============================================================ */

.notif-master-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    transition: background 0.2s ease, border-color 0.2s ease;
}

.notif-master-card:not(.is-off) {
    background: linear-gradient(135deg,
        rgba(34, 197, 94, 0.08),
        rgba(3, 215, 226, 0.05));
    border-color: rgba(34, 197, 94, 0.25);
}

.notif-master-card.is-off {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
}

.notif-master-form {
    margin: 0;
}

.notif-master-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.notif-master-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.notif-master-text {
    flex: 1;
    min-width: 0;
}

.notif-master-text strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notif-master-card:not(.is-off) .notif-master-text strong {
    color: #16a34a;
}

.notif-master-card.is-off .notif-master-text strong {
    color: #b45309;
}

.notif-master-text small {
    display: block;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-dim, #6b7280);
}

.notif-master-switch {
    flex-shrink: 0;
    transform: scale(1.1);
}

/* Light-Mode */
[data-theme="light"] .notif-master-card.is-off {
    background: rgba(245, 158, 11, 0.10);
}

/* Disabled-Cards (wenn Master aus) */
.acc-card.is-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.4);
}

.notif-disabled-info {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
}
.notif-disabled-info .hint {
    margin: 0;
    font-size: 14px;
    color: var(--text, #111827);
}

/* Dark-Mode */
@media (prefers-color-scheme: dark) {
    .vis-option.vis-option-toggle {
        background: transparent;
        border-color: rgba(255,255,255,0.08);
    }
    .vis-option.vis-option-toggle:hover {
        background: rgba(255,255,255,0.03);
    }
    .vis-option.vis-option-toggle:has(input:checked) {
        background: rgba(79, 70, 229, 0.10);
    }
    .push-status-box {
        background: rgba(255,255,255,0.03);
        border-color: rgba(255,255,255,0.08);
    }
    .push-status-box[data-state="on"] .push-status-title    { color: #4ade80; }
    .push-status-box[data-state="off"] .push-status-title   { color: #fbbf24; }
    .push-status-box[data-state="denied"] .push-status-title,
    .push-status-box[data-state="unsupported"] .push-status-title,
    .push-status-box[data-state="error"] .push-status-title { color: #fca5a5; }
    .push-msg-ok {
        background: rgba(34, 197, 94, 0.18);
        color: #86efac;
    }
    .push-msg-error {
        background: rgba(239, 68, 68, 0.18);
        color: #fca5a5;
    }
    .notif-master-card:not(.is-off) .notif-master-text strong {
        color: #4ade80;
    }
    .notif-master-card.is-off .notif-master-text strong {
        color: #fbbf24;
    }
    .notif-disabled-info {
        background: rgba(99, 102, 241, 0.10);
    }
}
