/**
 * AnnounceitOnce Notification System Styles
 * Professional notification styling for newsletter plugin
 */

/* Notification Container */
.announce-notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    pointer-events: none;
}

/* Individual Notification */
.announce-notification {
    background: var(--itonce-surface, #ffffff);
    border: 1px solid var(--itonce-border, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(100%);
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

/* Notification Content */
.announce-notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.announce-notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.announce-notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: var(--itonce-text, #2c3e50);
    font-weight: 500;
}

.announce-notification-close {
    background: none;
    border: none;
    color: var(--itonce-text-muted, #6c757d);
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.announce-notification-close:hover {
    background: var(--itonce-gray-100, #f8f9fa);
    color: var(--itonce-text, #2c3e50);
}

/* Notification Types */
.announce-notification-success {
    border-left: 4px solid var(--itonce-success, #28a745);
}

.announce-notification-error {
    border-left: 4px solid var(--itonce-danger, #dc3545);
}

.announce-notification-warning {
    border-left: 4px solid var(--itonce-warning, #ffc107);
}

.announce-notification-info {
    border-left: 4px solid var(--itonce-primary, #2271b1);
}

/* Modal Overlay */
.announce-modal-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: 999999;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal */
.announce-modal {
    background: var(--itonce-surface, #ffffff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal Header */
.announce-modal-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid var(--itonce-border, #e0e0e0);
}

.announce-modal-header h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--itonce-text, #2c3e50);
}

/* Modal Body */
.announce-modal-body {
    padding: 24px;
}

.announce-modal-body p {
    margin: 0;
    color: var(--itonce-text, #2c3e50);
    line-height: 1.5;
}

/* Modal Footer */
.announce-modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Buttons */
.announce-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.announce-btn-primary {
    background: var(--itonce-primary, #2271b1);
    color: white;
}

.announce-btn-primary:hover {
    background: var(--itonce-primary-dark, #135e96);
    transform: translateY(-1px);
}

.announce-btn-secondary {
    background: var(--itonce-gray-100, #f8f9fa);
    color: var(--itonce-text, #2c3e50);
    border: 1px solid var(--itonce-border, #e0e0e0);
}

.announce-btn-secondary:hover {
    background: var(--itonce-gray-200, #e9ecef);
    transform: translateY(-1px);
}

/* Form Field Error Styling */
.announce-field-invalid {
    border-color: var(--itonce-danger, #dc3545) !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1) !important;
}

.announce-field-error {
    color: var(--itonce-danger, #dc3545);
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.announce-field-error:before {
    content: "⚠️";
    font-size: 10px;
}

/* WordPress Admin Bar Compatibility */
.admin-bar .announce-notifications-container {
    top: 52px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .announce-notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .announce-notification {
        margin-bottom: 8px;
    }
    
    .announce-notification-content {
        padding: 12px;
    }
    
    .announce-modal {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .announce-modal-header,
    .announce-modal-body {
        padding: 20px;
    }
    
    .announce-modal-footer {
        padding: 0 20px 20px;
        flex-direction: column;
    }
    
    .announce-btn {
        width: 100%;
    }
}

/* Hide default WordPress notices when ItOnce notifications are active */
.announce-notifications-active .notice,
.announce-notifications-active .updated,
.announce-notifications-active .error {
    display: none !important;
}

/* Integration with existing ItOnce design system */
.announce-notification,
.announce-modal {
    font-family: var(--itonce-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* Success state for forms */
.announce-field-valid {
    border-color: var(--itonce-success, #28a745) !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1) !important;
}

/* Loading state for buttons */
.announce-btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.announce-btn-loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}