/* Notification Settings Page Styles
   ================================
   Industrial-dashboard aesthetic matching the site's security-focused design.
   Uses the established slate/cyan color system with proper contrast.
*/

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

/* ===== STATUS SECTION ===== */
.notification-status {
    margin-bottom: var(--space-8);
}

.notification-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
}

.notification-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-cyan-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status Cards - Base styles */
.notification-status-subscribed,
.notification-status-available,
.notification-status-denied,
.notification-status-unsupported,
.notification-status-unavailable,
.notification-status-error {
    position: relative;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Subscribed - Success state with green accent */
.notification-status-subscribed {
    background: linear-gradient(135deg, var(--color-slate-900) 0%, var(--color-slate-800) 100%);
    border: 1px solid var(--color-emerald-500);
}

.notification-status-subscribed::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-emerald-500), var(--color-cyan-400));
}

.notification-status-subscribed::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.notification-status-subscribed h3 {
    color: var(--color-emerald-500);
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.notification-status-subscribed h3::before {
    content: "\2713";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--color-emerald-500);
    color: var(--color-slate-900);
    border-radius: 50%;
    font-size: var(--text-sm);
    font-weight: 700;
}

.notification-status-subscribed p {
    color: var(--color-slate-300);
    margin: 0 0 var(--space-4) 0;
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.notification-status-subscribed p:last-child {
    margin-bottom: 0;
}

/* Available - Call to action state with cyan accent */
.notification-status-available {
    background: linear-gradient(135deg, var(--color-slate-900) 0%, var(--color-slate-800) 100%);
    border: 1px solid var(--color-cyan-500);
}

.notification-status-available::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-cyan-500), var(--color-cyan-400));
}

.notification-status-available::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.notification-status-available h3 {
    color: var(--color-cyan-400);
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
}

.notification-status-available p {
    color: var(--color-slate-300);
    margin: 0 0 var(--space-4) 0;
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.notification-status-available p:last-child {
    margin-bottom: 0;
}

.notification-status-available .privacy-link {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-3);
}

.notification-status-available .privacy-link a {
    color: var(--color-cyan-400);
    text-decoration: none;
}

.notification-status-available .privacy-link a:hover {
    text-decoration: underline;
}

/* Denied/Error - Warning state with rose accent */
.notification-status-denied,
.notification-status-error {
    background: linear-gradient(135deg, var(--color-slate-900) 0%, var(--color-slate-800) 100%);
    border: 1px solid var(--color-rose-500);
}

.notification-status-denied::before,
.notification-status-error::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-rose-500);
}

.notification-status-denied h3,
.notification-status-error h3 {
    color: var(--color-rose-500);
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
}

.notification-status-denied p,
.notification-status-error p {
    color: var(--color-slate-300);
    margin: 0 0 var(--space-4) 0;
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.notification-status-denied p:last-child,
.notification-status-error p:last-child {
    margin-bottom: 0;
}

/* Unsupported/Unavailable - Muted state */
.notification-status-unsupported,
.notification-status-unavailable {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.notification-status-unsupported::before,
.notification-status-unavailable::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-slate-400);
}

.notification-status-unsupported h3,
.notification-status-unavailable h3 {
    color: var(--color-text);
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
}

.notification-status-unsupported p,
.notification-status-unavailable p {
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-4) 0;
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.notification-status-unsupported p:last-child,
.notification-status-unavailable p:last-child {
    margin-bottom: 0;
}

/* ===== PREFERENCE FORM ===== */
.preference-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.preference-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
}

.preference-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-slate-300);
    transform: scaleY(0);
    transition: transform var(--transition);
}

.preference-item:hover {
    border-color: var(--color-slate-300);
    background: var(--color-bg-alt);
}

.preference-item:hover::before {
    transform: scaleY(1);
    background: var(--color-cyan-500);
}

/* Hide native checkbox */
.preference-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Custom checkbox */
.preference-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-slate-400);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.preference-item:hover .preference-checkbox {
    border-color: var(--color-cyan-500);
}

/* Checked state */
.preference-item input[type="checkbox"]:checked + .preference-checkbox {
    background: linear-gradient(135deg, var(--color-cyan-500) 0%, var(--color-cyan-600) 100%);
    border-color: var(--color-cyan-500);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.preference-item input[type="checkbox"]:checked + .preference-checkbox::after {
    content: "";
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Checked state - highlight the row */
.preference-item:has(input[type="checkbox"]:checked) {
    border-color: rgba(6, 182, 212, 0.3);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.05) 0%, var(--color-surface) 100%);
}

.preference-item:has(input[type="checkbox"]:checked)::before {
    transform: scaleY(1);
    background: var(--color-cyan-500);
}

/* Disabled state */
.preference-item input[type="checkbox"]:disabled + .preference-checkbox {
    background: var(--color-bg-alt);
    border-color: var(--color-border);
}

.preference-item:has(input[type="checkbox"]:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
}

.preference-item:has(input[type="checkbox"]:disabled):hover {
    border-color: var(--color-border);
    background: var(--color-surface);
}

/* Focus visible state */
.preference-item input[type="checkbox"]:focus-visible + .preference-checkbox {
    outline: 2px solid var(--color-cyan-500);
    outline-offset: 2px;
}

/* Label */
.preference-label {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--text-base);
    color: var(--color-text);
    user-select: none;
}

.preference-item input[type="checkbox"]:disabled ~ .preference-label {
    color: var(--color-text-muted);
}

/* Actions section */
.preference-actions {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

/* ===== BUTTONS ===== */
.notification-status .btn,
.preference-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    min-height: 44px;
}

.notification-status .btn:disabled,
.preference-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary button - cyan gradient */
.notification-status .btn-primary,
.preference-actions .btn-primary {
    background: linear-gradient(135deg, var(--color-cyan-500) 0%, var(--color-cyan-600) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.notification-status .btn-primary:hover:not(:disabled),
.preference-actions .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-cyan-400) 0%, var(--color-cyan-500) 100%);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
    transform: translateY(-2px);
}

.notification-status .btn-primary:active:not(:disabled),
.preference-actions .btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary button */
.notification-status .btn-secondary,
.preference-actions .btn-secondary {
    background: transparent;
    color: var(--color-slate-300);
    border: 1px solid var(--color-slate-600);
}

.notification-status .btn-secondary:hover:not(:disabled),
.preference-actions .btn-secondary:hover:not(:disabled) {
    background: var(--color-slate-800);
    border-color: var(--color-slate-500);
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .notification-status-subscribed,
    .notification-status-available,
    .notification-status-denied,
    .notification-status-unsupported,
    .notification-status-unavailable,
    .notification-status-error {
        padding: var(--space-5);
    }

    .preference-item {
        padding: var(--space-3) var(--space-4);
    }

    .notification-status .btn,
    .preference-actions .btn {
        width: 100%;
    }
}

/* ===== ANIMATIONS ===== */
.preference-item {
    animation: prefFadeIn 0.3s ease forwards;
    opacity: 0;
}

.preference-item:nth-child(1) { animation-delay: 0.05s; }
.preference-item:nth-child(2) { animation-delay: 0.1s; }
.preference-item:nth-child(3) { animation-delay: 0.15s; }
.preference-item:nth-child(4) { animation-delay: 0.2s; }
.preference-item:nth-child(5) { animation-delay: 0.25s; }
.preference-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes prefFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .preference-item,
    .notification-loading::before {
        animation: none;
        opacity: 1;
    }
}
