/* WebPush Modal Styles */

/* Modal overlay and container */
.webpush-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.webpush-modal.show {
    opacity: 1;
    visibility: visible;
}

.webpush-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

/* Modal content */
.webpush-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.webpush-modal.show .webpush-modal-content {
    transform: scale(1) translateY(0);
}

/* Modal header */
.webpush-modal-header {
    position: relative;
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.webpush-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.webpush-close:hover {
    color: #333;
}

.webpush-icon {
    margin-bottom: 10px;
}

/* Modal body */
.webpush-modal-body {
    padding: 20px 30px;
}

.webpush-modal-body h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.webpush-modal-body p {
    margin: 0 0 25px 0;
    color: #666;
    line-height: 1.6;
    text-align: center;
    font-size: 15px;
}

/* Form styles */
.webpush-form-group {
    margin-bottom: 20px;
}

.webpush-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.webpush-form-group .required {
    color: #e74c3c;
}

.webpush-form-group input[type="text"],
.webpush-form-group input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    background: #fff;
}

.webpush-form-group input[type="text"]:focus,
.webpush-form-group input[type="email"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.webpush-form-group input.error {
    border-color: #e74c3c;
}

/* Consent checkbox */
.webpush-consent {
    margin: 25px 0;
}

.webpush-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

.webpush-checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.webpush-checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #0073aa;
    border-color: #0073aa;
}

.webpush-checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Error messages */
.webpush-error {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    min-height: 16px;
}

/* Modal footer */
.webpush-modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 10px;
    flex-direction: column;
}

/* Buttons */
.webpush-btn {
    padding: 14px 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-height: 48px;
    box-sizing: border-box;
}

.webpush-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.webpush-btn-primary {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.webpush-btn-primary:hover:not(:disabled) {
    background-color: #005a87;
    border-color: #005a87;
}

.webpush-btn-secondary {
    background-color: transparent;
    color: #666;
    border-color: #e1e8ed;
}

.webpush-btn-secondary:hover {
    background-color: #f8f9fa;
    border-color: #d1d9e0;
}

.webpush-btn-outline {
    background-color: transparent;
    color: #0073aa;
    border-color: #0073aa;
}

.webpush-btn-outline:hover {
    background-color: #0073aa;
    color: white;
}

/* Button loading state */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* Success and error messages */
.webpush-success-message,
.webpush-error-message {
    padding: 30px;
    text-align: center;
}

.success-icon,
.error-icon {
    margin-bottom: 15px;
}

.webpush-success-message h4,
.webpush-error-message h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
}

.webpush-success-message h4 {
    color: #27ae60;
}

.webpush-error-message h4 {
    color: #e74c3c;
}

.webpush-success-message p,
.webpush-error-message p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.5;
}

/* Responsive design */
@media screen and (max-width: 480px) {
    .webpush-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .webpush-modal-header,
    .webpush-modal-body,
    .webpush-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .webpush-modal-header {
        padding-top: 25px;
        padding-bottom: 15px;
    }
    
    .webpush-modal-body h3 {
        font-size: 20px;
    }
    
    .webpush-modal-footer {
        padding-bottom: 25px;
    }
    
    .webpush-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .webpush-modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .webpush-modal-header {
        border-bottom-color: #4a5568;
    }
    
    .webpush-modal-body h3 {
        color: #f7fafc;
    }
    
    .webpush-modal-body p {
        color: #cbd5e0;
    }
    
    .webpush-form-group label {
        color: #f7fafc;
    }
    
    .webpush-form-group input[type="text"],
    .webpush-form-group input[type="email"] {
        background: #4a5568;
        border-color: #718096;
        color: #f7fafc;
    }
    
    .webpush-form-group input[type="text"]:focus,
    .webpush-form-group input[type="email"]:focus {
        border-color: #4299e1;
    }
    
    .checkmark {
        border-color: #718096;
    }
    
    .webpush-checkbox-label {
        color: #cbd5e0;
    }
    
    .webpush-btn-secondary {
        color: #cbd5e0;
        border-color: #718096;
    }
    
    .webpush-btn-secondary:hover {
        background-color: #4a5568;
        border-color: #a0aec0;
    }
    
    .webpush-close {
        color: #a0aec0;
    }
    
    .webpush-close:hover {
        color: #f7fafc;
    }
}

/* Animation for modal show/hide */
@keyframes webpushFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

/* Hide modal content sections by default */
.webpush-modal-body,
.webpush-modal-footer {
    transition: opacity 0.3s ease;
}

.webpush-success-message.show,
.webpush-error-message.show {
    animation: webpushFadeIn 0.3s ease;
}

/* Accessibility improvements */
.webpush-modal:focus {
    outline: none;
}

.webpush-btn:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

.webpush-form-group input:focus {
    outline: none;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .webpush-modal-content {
        border: 2px solid #000;
    }
    
    .webpush-btn {
        border-width: 2px;
    }
    
    .webpush-form-group input[type="text"],
    .webpush-form-group input[type="email"] {
        border-width: 2px;
    }
}
