/* =============================================
   Custom Push Notifications — UI
   TheRimOnline v2.1
============================================= */

/* --- Hidden Utility --- */
.cpn-hidden {
    display: none !important;
}

/* =============================================
   SUBSCRIPTION POPUP
============================================= */

#cpn-popup,
#cpn-ios-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    animation: cpnSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cpnSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Popup Card --- */
#cpn-popup-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 24px 24px;
    width: 320px;
    max-width: calc(100vw - 32px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    position: relative;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Devanagari', sans-serif;
}

/* --- Close Button --- */
#cpn-popup-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

#cpn-popup-close:hover {
    color: #374151;
    background: #f3f4f6;
}

/* --- Icon --- */
#cpn-popup-icon {
    font-size: 40px;
    margin-bottom: 12px;
    animation: cpnBellSwing 2s ease-in-out infinite;
    animation-delay: 0.5s;
    display: inline-block;
}

@keyframes cpnBellSwing {
    0%, 100% { transform: rotate(0deg); }
    10%      { transform: rotate(12deg); }
    20%      { transform: rotate(-10deg); }
    30%      { transform: rotate(8deg); }
    40%      { transform: rotate(-5deg); }
    50%      { transform: rotate(0deg); }
}

/* --- Title --- */
#cpn-popup-title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

/* --- Body Text --- */
#cpn-popup-body {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* --- Action Buttons --- */
#cpn-popup-actions {
    display: flex;
    gap: 10px;
}

#cpn-popup-allow {
    flex: 1;
    padding: 12px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

#cpn-popup-allow:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

#cpn-popup-allow:active {
    transform: scale(0.97);
}

#cpn-popup-allow:disabled {
    opacity: 0.7;
    cursor: wait;
}

#cpn-popup-later {
    flex: 0.6;
    padding: 12px 16px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

#cpn-popup-later:hover {
    background: #e5e7eb;
    color: #374151;
}

/* =============================================
   SUBSCRIBED BADGE (small indicator)
============================================= */

#cpn-subscribed-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 3px 12px rgba(16, 185, 129, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: default;
    animation: cpnBadgeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
}

@keyframes cpnBadgeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#cpn-subscribed-badge svg {
    width: 20px;
    height: 20px;
}

#cpn-badge-check {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #fff;
    color: #059669;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* =============================================
   DARK MODE SUPPORT
============================================= */

@media (prefers-color-scheme: dark) {
    #cpn-popup-card {
        background: #1f2937;
        box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.4),
            0 4px 16px rgba(0, 0, 0, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    #cpn-popup-title {
        color: #f9fafb;
    }

    #cpn-popup-body {
        color: #9ca3af;
    }

    #cpn-popup-close {
        color: #6b7280;
    }

    #cpn-popup-close:hover {
        color: #e5e7eb;
        background: #374151;
    }

    #cpn-popup-later {
        background: #374151;
        color: #9ca3af;
    }

    #cpn-popup-later:hover {
        background: #4b5563;
        color: #e5e7eb;
    }
}

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

@media (max-width: 420px) {
    #cpn-popup {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    #cpn-popup-card {
        width: auto;
        max-width: 100%;
        padding: 24px 20px 20px;
    }

    #cpn-popup-icon {
        font-size: 32px;
    }

    #cpn-popup-title {
        font-size: 16px;
    }

    #cpn-popup-body {
        font-size: 13px;
    }

    #cpn-popup-allow,
    #cpn-popup-later {
        padding: 11px 14px;
        font-size: 13px;
    }

    #cpn-subscribed-badge {
        bottom: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    #cpn-subscribed-badge svg {
        width: 17px;
        height: 17px;
    }
}

/* =============================================
   iOS ADD-TO-HOME-SCREEN STEPS
============================================= */

#cpn-ios-steps {
    margin: 16px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cpn-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Devanagari', sans-serif;
}

.cpn-ios-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

#cpn-ios-ok {
    flex: 1;
    padding: 12px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
}

#cpn-ios-ok:hover {
    opacity: 0.9;
}

@media (prefers-color-scheme: dark) {
    .cpn-ios-step {
        color: #d1d5db;
    }
}