/**
 * Push Notifications Styles
 * dagnytt.no
 */

/* Notification Icon - Bottom Left */
#pushNotificationIcon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #c41e3a 0%, #a01828 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    animation: pulse-notification 2s infinite;
}

/* When subscribed - make icon almost invisible */
#pushNotificationIcon.subscribed {
    opacity: 0.2;
    animation: none;
    box-shadow: 0 2px 6px rgba(196, 30, 58, 0.2);
}

#pushNotificationIcon.subscribed:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

#pushNotificationIcon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(196, 30, 58, 0.6);
}

#pushNotificationIcon i {
    color: white;
    font-size: 24px;
}

/* Tooltip for subscribed users */
.push-tooltip {
    position: fixed;
    bottom: 85px;
    left: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
}

.push-tooltip.show {
    opacity: 1;
}

@keyframes pulse-notification {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(196, 30, 58, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(196, 30, 58, 0.7), 0 0 0 10px rgba(196, 30, 58, 0.1);
    }
}

/* Push Settings Panel - Small popup beside icon */
#pushSettingsPanel {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 85px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    min-width: 280px;
    animation: slideInLeft 0.3s ease-out;
}

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

#pushSettingsPanel h3 {
    margin: 0 0 15px 0;
    font-family: 'Georgia', serif;
    font-size: 18px;
    color: #1a1a1a;
}

#pushSettingsPanel .unsubscribe-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

#pushSettingsPanel .unsubscribe-btn:hover {
    background: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

#pushSettingsPanel .unsubscribe-btn:active {
    transform: scale(0.98);
}

/* Success message */
.push-unsubscribe-message {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 85px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: slideInLeft 0.3s ease-out;
}

/* Push Notification Modal */
#pushNotificationModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.push-notification-popup {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

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

.push-notification-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #c41e3a 0%, #a01828 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.push-notification-icon i {
    color: white;
    font-size: 32px;
}

.push-notification-popup h2 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 24px;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    text-align: center;
    line-height: 1.3;
}

.push-notification-popup p {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 16px;
    color: #555;
    margin: 0 0 24px 0;
    text-align: center;
    line-height: 1.6;
}

.push-notification-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.push-notification-button {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.push-notification-button.accept {
    background: linear-gradient(135deg, #c41e3a 0%, #a01828 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.push-notification-button.accept:hover {
    background: linear-gradient(135deg, #a01828 0%, #8a1522 100%);
    box-shadow: 0 6px 16px rgba(196, 30, 58, 0.4);
    transform: translateY(-2px);
}

.push-notification-button.accept:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

.push-notification-button.decline {
    background: white;
    color: #666;
    border: 2px solid #ddd;
}

.push-notification-button.decline:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.push-notification-button.decline:active {
    background: #eee;
}

/* Mobile responsive */
@media (max-width: 600px) {
    #pushNotificationIcon {
        bottom: 15px;
        left: 15px;
        width: 50px;
        height: 50px;
    }
    
    #pushNotificationIcon i {
        font-size: 22px;
    }
    
    .push-notification-popup {
        padding: 24px;
        max-width: 90%;
    }
    
    .push-notification-popup h2 {
        font-size: 20px;
    }
    
    .push-notification-popup p {
        font-size: 15px;
    }
    
    .push-notification-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .push-notification-button {
        width: 100%;
        padding: 14px 24px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    #pushNotificationIcon {
        animation: none;
    }
    
    .push-notification-popup {
        animation: none;
    }
}

