/**
 * Web Push Notifications Frontend Styles
 */

/* Subscription Container */
.wpn-subscription-container {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.wpn-subscription-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.wpn-subscription-description {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
}

.wpn-subscription-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.wpn-subscribe-btn,
.wpn-unsubscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpn-subscribe-btn {
    background: #0073aa;
    color: #fff;
}

.wpn-subscribe-btn:hover {
    background: #005a87;
    color: #fff;
}

.wpn-unsubscribe-btn {
    background: #dc3545;
    color: #fff;
}

.wpn-unsubscribe-btn:hover {
    background: #c82333;
    color: #fff;
}

.wpn-subscribe-btn:disabled,
.wpn-unsubscribe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.wpn-message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 4px solid;
    font-size: 14px;
}

.wpn-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.wpn-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.wpn-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.wpn-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Unsupported Browser Message */
.wpn-unsupported {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.wpn-unsupported p {
    margin: 0;
    font-size: 14px;
}

/* GDPR Consent Dialog */
.wpn-gdpr-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.wpn-gdpr-dialog {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.wpn-gdpr-dialog h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3em;
}

.wpn-gdpr-dialog p {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #666;
}

.wpn-gdpr-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.wpn-gdpr-actions .button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wpn-gdpr-accept {
    background: #0073aa;
    color: #fff;
}

.wpn-gdpr-accept:hover {
    background: #005a87;
}

.wpn-gdpr-decline {
    background: #6c757d;
    color: #fff;
}

.wpn-gdpr-decline:hover {
    background: #545b62;
}

/* Notification Display */
.wpn-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #0073aa;
    z-index: 10001;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: wpn-slide-in 0.3s ease-out;
}

.wpn-notification:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.wpn-notification-content {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    gap: 12px;
}

.wpn-notification-icon {
    flex-shrink: 0;
}

.wpn-notification-icon img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.wpn-notification-text {
    flex: 1;
    min-width: 0;
}

.wpn-notification-title {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.wpn-notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    word-wrap: break-word;
}

.wpn-notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.wpn-notification-close:hover {
    opacity: 1;
}

.wpn-notification-close::before,
.wpn-notification-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: #999;
    transform: translate(-50%, -50%) rotate(45deg);
}

.wpn-notification-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Notification Animations */
@keyframes wpn-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes wpn-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.wpn-notification.fade-out {
    animation: wpn-slide-out 0.3s ease-in forwards;
}

/* Subscription Widget Styles */
.wpn-widget {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.wpn-widget-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.wpn-widget-description {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Floating Subscription Button */
.wpn-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpn-floating-btn:hover {
    background: #005a87;
    transform: scale(1.1);
}

.wpn-floating-btn i {
    font-size: 24px;
}

/* Subscription Form */
.wpn-subscription-form {
    max-width: 400px;
    margin: 0 auto;
}

.wpn-form-group {
    margin-bottom: 15px;
}

.wpn-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.wpn-form-group input,
.wpn-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.wpn-form-group input:focus,
.wpn-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wpn-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Loading States */
.wpn-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.wpn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: wpn-spin 1s linear infinite;
}

@keyframes wpn-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpn-subscription-container {
        margin: 15px 0;
        padding: 15px;
    }
    
    .wpn-subscription-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .wpn-subscribe-btn,
    .wpn-unsubscribe-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .wpn-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .wpn-gdpr-dialog {
        margin: 20px;
        padding: 20px;
    }
    
    .wpn-gdpr-actions {
        flex-direction: column;
    }
    
    .wpn-floating-btn {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .wpn-floating-btn i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .wpn-subscription-title {
        font-size: 1.1em;
    }
    
    .wpn-subscription-description {
        font-size: 14px;
    }
    
    .wpn-notification {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .wpn-notification-content {
        padding: 12px;
    }
    
    .wpn-notification-title {
        font-size: 13px;
    }
    
    .wpn-notification-message {
        font-size: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wpn-subscription-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .wpn-subscription-title {
        color: #f7fafc;
    }
    
    .wpn-subscription-description {
        color: #a0aec0;
    }
    
    .wpn-notification {
        background: #2d3748;
        border-left-color: #4299e1;
    }
    
    .wpn-notification-title {
        color: #f7fafc;
    }
    
    .wpn-notification-message {
        color: #a0aec0;
    }
    
    .wpn-gdpr-dialog {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .wpn-gdpr-dialog h3 {
        color: #f7fafc;
    }
    
    .wpn-gdpr-dialog p {
        color: #a0aec0;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .wpn-subscribe-btn,
    .wpn-unsubscribe-btn {
        border: 2px solid currentColor;
    }
    
    .wpn-notification {
        border: 2px solid #000;
    }
    
    .wpn-message {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wpn-notification,
    .wpn-subscribe-btn,
    .wpn-unsubscribe-btn,
    .wpn-floating-btn {
        transition: none;
    }
    
    .wpn-notification {
        animation: none;
    }
    
    .wpn-loading::after {
        animation: none;
    }
} 