/**
 * WHMCSPilot Notifications - Client Area Styles
 * Beautiful notification styling that overrides WHMCS themes
 * 
 * @author Shahid Malla
 * @website https://whmcspilot.com
 * @version 1.1.0
 */

/* ============================================================================
   BASE NOTIFICATION CONTAINER
============================================================================ */

#wpn-notifications-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.wpn-notification {
    box-sizing: border-box !important;
}

.wpn-notification * {
    box-sizing: border-box !important;
}

/* ============================================================================
   TYPOGRAPHY - Dedicated Heading Classes for Client Area
============================================================================ */

.wpn-notification .wpn-h1,
.wpn-notification h1 {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.2 !important;
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
}

.wpn-notification .wpn-h2,
.wpn-notification h2 {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.3 !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

.wpn-notification .wpn-h3,
.wpn-notification h3 {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
}

.wpn-notification .wpn-h4,
.wpn-notification h4 {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    line-height: 1.4 !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
}

.wpn-notification .wpn-h5,
.wpn-notification h5 {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    line-height: 1.5 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
}

.wpn-notification .wpn-h6,
.wpn-notification h6 {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    line-height: 1.5 !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

/* ============================================================================
   POPUP NOTIFICATIONS - CENTERED MODAL STYLE
============================================================================ */

.wpn-type-popup {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    animation: wpnFadeIn 0.3s ease !important;
    margin: 0 !important;
}

.wpn-popup {
    background: #ffffff !important;
    border-radius: 24px !important;
    max-width: 520px !important;
    width: 100% !important;
    padding: 48px 44px 44px 44px !important;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 40px -8px rgba(0, 0, 0, 0.2),
        0 40px 80px -20px rgba(0, 0, 0, 0.25) !important;
    text-align: center !important;
    position: relative !important;
    animation: wpnSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    margin: 0 auto !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: #1a1a2e !important;
    overflow: hidden !important;
}

/* Decorative gradient top border */
.wpn-popup::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
}

/* Close Button */
.wpn-popup .wpn-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 40px !important;
    height: 40px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: #94a3b8 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}

.wpn-popup .wpn-close:hover {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #ef4444 !important;
    transform: rotate(90deg) scale(1.1) !important;
}

.wpn-popup .wpn-close:active {
    transform: rotate(90deg) scale(0.95) !important;
}

/* Image Container */
.wpn-popup .wpn-popup-image {
    margin: -48px -44px 28px -44px !important;
    padding-top: 4px !important;
    overflow: hidden !important;
}

.wpn-popup .wpn-popup-image img {
    width: 100% !important;
    height: auto !important;
    max-height: 220px !important;
    object-fit: cover !important;
}

/* Icon Container */
.wpn-popup .wpn-popup-icon {
    width: 72px !important;
    height: 72px !important;
    margin: 0 auto 24px auto !important;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 32px !important;
    border: 2px solid #bae6fd !important;
}

/* Title */
.wpn-popup .wpn-title,
.wpn-popup h3 {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 0 16px 0 !important;
    line-height: 1.25 !important;
    padding: 0 20px !important;
    letter-spacing: -0.025em !important;
}

/* Body Text */
.wpn-popup .wpn-body,
.wpn-popup p {
    font-size: 17px !important;
    color: #64748b !important;
    margin: 0 0 32px 0 !important;
    line-height: 1.7 !important;
    padding: 0 12px !important;
}

/* Actions Container */
.wpn-popup .wpn-actions {
    margin-top: 28px !important;
    display: flex !important;
    justify-content: center !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

/* Buttons */
.wpn-popup .wpn-btn,
.wpn-popup a.wpn-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px 40px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-radius: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    border: none !important;
    line-height: 1.4 !important;
    text-align: center !important;
    min-width: 160px !important;
    letter-spacing: 0.01em !important;
}

.wpn-popup .wpn-btn-primary,
.wpn-popup a.wpn-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    box-shadow: 
        0 4px 6px -1px rgba(37, 99, 235, 0.3),
        0 10px 20px -5px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.wpn-popup .wpn-btn-primary:hover,
.wpn-popup a.wpn-btn-primary:hover {
    transform: translateY(-3px) !important;
    box-shadow: 
        0 8px 12px -2px rgba(37, 99, 235, 0.35),
        0 16px 32px -8px rgba(37, 99, 235, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.wpn-popup .wpn-btn-primary:active,
.wpn-popup a.wpn-btn-primary:active {
    transform: translateY(-1px) !important;
}

/* Secondary Button */
.wpn-popup .wpn-btn-secondary,
.wpn-popup a.wpn-btn-secondary {
    background: #f8fafc !important;
    color: #475569 !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.wpn-popup .wpn-btn-secondary:hover,
.wpn-popup a.wpn-btn-secondary:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-2px) !important;
    color: #334155 !important;
    text-decoration: none !important;
}

/* Style Variants - Modern gradient top borders */
.wpn-popup.info::before { background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%) !important; }
.wpn-popup.success::before { background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #6ee7b7 100%) !important; }
.wpn-popup.warning::before { background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #fcd34d 100%) !important; }
.wpn-popup.danger::before { background: linear-gradient(90deg, #ef4444 0%, #f87171 50%, #fca5a5 100%) !important; }
.wpn-popup.promo::before { background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%) !important; }

/* Icon colors by type */
.wpn-popup.info .wpn-popup-icon {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    border-color: #93c5fd !important;
    color: #2563eb !important;
}

.wpn-popup.success .wpn-popup-icon {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border-color: #6ee7b7 !important;
    color: #059669 !important;
}

.wpn-popup.warning .wpn-popup-icon {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    border-color: #fcd34d !important;
    color: #d97706 !important;
}

.wpn-popup.danger .wpn-popup-icon {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

.wpn-popup.promo .wpn-popup-icon {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%) !important;
    border-color: #c4b5fd !important;
    color: #7c3aed !important;
}

/* Promo special button */
.wpn-popup.promo .wpn-btn-primary,
.wpn-popup.promo a.wpn-btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    box-shadow: 
        0 4px 6px -1px rgba(139, 92, 246, 0.3),
        0 10px 20px -5px rgba(139, 92, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* ============================================================================
   HEADER BAR NOTIFICATIONS
============================================================================ */

.wpn-type-header {
    position: relative !important;
    z-index: 99998 !important;
}

.wpn-header-bar {
    padding: 14px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

.wpn-bar-content {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

.wpn-bar-text {
    font-size: 15px !important;
    font-weight: 500 !important;
}

.wpn-bar-btn {
    display: inline-block !important;
    padding: 8px 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: inherit !important;
    transition: all 0.2s ease !important;
}

.wpn-bar-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    text-decoration: none !important;
}

.wpn-bar-close {
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    font-size: 20px !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    padding: 5px !important;
    line-height: 1 !important;
}

.wpn-bar-close:hover {
    opacity: 1 !important;
}

/* Header Close Button (using .wpn-close class from template) */
.wpn-header .wpn-close {
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    font-size: 20px !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    padding: 5px !important;
    line-height: 1 !important;
    margin-left: 10px !important;
}

.wpn-header .wpn-close:hover {
    opacity: 1 !important;
}

/* Header Bar Colors */
.wpn-bar-info {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
}

.wpn-bar-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
}

.wpn-bar-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #1f2937 !important;
}

.wpn-bar-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
}

.wpn-bar-promo {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
}

/* ============================================================================
   TOAST NOTIFICATIONS
============================================================================ */

.wpn-toast-container {
    position: fixed !important;
    bottom: 25px !important;
    right: 25px !important;
    z-index: 999990 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    max-width: 400px !important;
}

.wpn-type-toast {
    position: relative !important;
}

.wpn-toast {
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 16px 45px 16px 18px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18) !important;
    animation: wpnSlideIn 0.4s ease !important;
    border-left: 4px solid !important;
    position: relative !important;
}

.wpn-toast-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.wpn-toast-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin: 0 !important;
}

.wpn-toast-message {
    font-size: 14px !important;
    color: #64748b !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.wpn-toast-close {
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    font-size: 18px !important;
    cursor: pointer !important;
    color: #94a3b8 !important;
    padding: 5px !important;
    line-height: 1 !important;
}

.wpn-toast-close:hover {
    color: #64748b !important;
}

/* Toast Close Button (using .wpn-close class from template) */
.wpn-toast .wpn-close {
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    font-size: 18px !important;
    cursor: pointer !important;
    color: #94a3b8 !important;
    padding: 5px !important;
    line-height: 1 !important;
}

.wpn-toast .wpn-close:hover {
    color: #64748b !important;
}

/* Toast Colors */
.wpn-toast-info { border-left-color: #3b82f6 !important; }
.wpn-toast-success { border-left-color: #10b981 !important; }
.wpn-toast-warning { border-left-color: #f59e0b !important; }
.wpn-toast-danger { border-left-color: #ef4444 !important; }
.wpn-toast-promo { border-left-color: #8b5cf6 !important; }

/* ============================================================================
   INLINE NOTIFICATIONS
============================================================================ */

.wpn-inline {
    padding: 18px 20px !important;
    border-radius: 12px !important;
    margin: 15px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

.wpn-inline-content {
    flex: 1 !important;
}

.wpn-inline-content strong {
    display: block !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
}

.wpn-inline-content p {
    font-size: 14px !important;
    margin: 0 !important;
    opacity: 0.9 !important;
}

.wpn-inline-btn {
    display: inline-block !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    color: inherit !important;
    transition: all 0.2s ease !important;
}

.wpn-inline-btn:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    text-decoration: none !important;
}

.wpn-inline-close {
    background: transparent !important;
    border: none !important;
    font-size: 18px !important;
    cursor: pointer !important;
    color: inherit !important;
    opacity: 0.6 !important;
    padding: 5px !important;
}

.wpn-inline-close:hover {
    opacity: 1 !important;
}

/* Inline Close Button (using .wpn-close class from template) */
.wpn-inline .wpn-close {
    background: transparent !important;
    border: none !important;
    font-size: 18px !important;
    cursor: pointer !important;
    color: inherit !important;
    opacity: 0.6 !important;
    padding: 5px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

.wpn-inline .wpn-close:hover {
    opacity: 1 !important;
}

/* Inline Colors */
.wpn-inline-info {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1e40af !important;
}

.wpn-inline-success {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
}

.wpn-inline-warning {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
}

.wpn-inline-danger {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #991b1b !important;
}

.wpn-inline-promo {
    background: #f5f3ff !important;
    border: 1px solid #ddd6fe !important;
    color: #5b21b6 !important;
}

/* ============================================================================
   ANIMATIONS
============================================================================ */

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

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

@keyframes wpnSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade Out for Dismissal */
.wpn-notification.wpn-fade-out {
    animation: wpnFadeOut 0.3s ease forwards !important;
}

@keyframes wpnFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ============================================================================
   MOBILE RESPONSIVE
============================================================================ */

@media (max-width: 640px) {
    .wpn-type-popup {
        padding: 15px !important;
    }
    
    .wpn-popup {
        padding: 30px 25px !important;
        border-radius: 16px !important;
        max-width: 100% !important;
    }
    
    .wpn-popup .wpn-title,
    .wpn-popup h3 {
        font-size: 20px !important;
    }
    
    .wpn-popup .wpn-body,
    .wpn-popup p {
        font-size: 15px !important;
    }
    
    .wpn-popup .wpn-btn {
        padding: 12px 28px !important;
        font-size: 14px !important;
    }
    
    .wpn-header-bar {
        padding: 12px 15px !important;
        text-align: center !important;
    }
    
    .wpn-bar-text {
        font-size: 14px !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .wpn-toast-container {
        bottom: 15px !important;
        right: 15px !important;
        left: 15px !important;
        max-width: none !important;
    }
    
    .wpn-toast {
        border-radius: 10px !important;
    }
}

/* ============================================================================
   ACCESSIBILITY
============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .wpn-type-popup,
    .wpn-popup,
    .wpn-toast,
    .wpn-notification.wpn-fade-out {
        animation: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wpn-popup {
        border: 2px solid #000000 !important;
    }
    
    .wpn-toast {
        border: 2px solid currentColor !important;
    }
}

/* ============================================================================
   POPUP POSITION CLASSES
   Positions: center, top, bottom, top-left, top-right, bottom-left, bottom-right
============================================================================ */

/* Center (default) */
.wpn-type-popup.wpn-position-center {
    align-items: center !important;
    justify-content: center !important;
}

/* Top Center */
.wpn-type-popup.wpn-position-top {
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 50px !important;
}

/* Bottom Center */
.wpn-type-popup.wpn-position-bottom {
    align-items: flex-end !important;
    justify-content: center !important;
    padding-bottom: 50px !important;
}

/* Top Left */
.wpn-type-popup.wpn-position-top-left {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 30px !important;
}

/* Top Right */
.wpn-type-popup.wpn-position-top-right {
    align-items: flex-start !important;
    justify-content: flex-end !important;
    padding: 30px !important;
}

/* Bottom Left */
.wpn-type-popup.wpn-position-bottom-left {
    align-items: flex-end !important;
    justify-content: flex-start !important;
    padding: 30px !important;
}

/* Bottom Right */
.wpn-type-popup.wpn-position-bottom-right {
    align-items: flex-end !important;
    justify-content: flex-end !important;
    padding: 30px !important;
}

/* Position adjustments for popup content */
.wpn-position-top .wpn-popup,
.wpn-position-top-left .wpn-popup,
.wpn-position-top-right .wpn-popup {
    animation: wpnSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.wpn-position-bottom .wpn-popup,
.wpn-position-bottom-left .wpn-popup,
.wpn-position-bottom-right .wpn-popup {
    animation: wpnSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Slide down animation for top positions */
@keyframes wpnSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsive positions */
@media (max-width: 576px) {
    .wpn-type-popup.wpn-position-top-left,
    .wpn-type-popup.wpn-position-top-right,
    .wpn-type-popup.wpn-position-bottom-left,
    .wpn-type-popup.wpn-position-bottom-right {
        align-items: center !important;
        justify-content: center !important;
        padding: 15px !important;
    }
}

/* ============================================================================
   TOAST POSITION CLASSES
============================================================================ */

/* Toast container positions */
.wpn-toast-container.wpn-toast-top-right {
    top: 25px !important;
    right: 25px !important;
    bottom: auto !important;
    left: auto !important;
}

.wpn-toast-container.wpn-toast-top-left {
    top: 25px !important;
    left: 25px !important;
    bottom: auto !important;
    right: auto !important;
}

.wpn-toast-container.wpn-toast-bottom-left {
    bottom: 25px !important;
    left: 25px !important;
    top: auto !important;
    right: auto !important;
}

.wpn-toast-container.wpn-toast-bottom-right {
    bottom: 25px !important;
    right: 25px !important;
    top: auto !important;
    left: auto !important;
}
