/**
 * PushNotify - Permission Prompt Widget Styles
 * 
 * Elegant, non-intrusive notification permission prompt.
 * Supports: dark/light themes, 4 positions, smooth animations.
 */

/* ==========================================
   Base Styles & Reset
   ========================================== */
.pn-prompt {
    position: fixed;
    z-index: 2147483647;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    direction: ltr;
    box-sizing: border-box;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pn-prompt *,
.pn-prompt *::before,
.pn-prompt *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.pn-prompt--visible {
    opacity: 1;
    pointer-events: all;
}

/* ==========================================
   Positions
   ========================================== */
.pn-prompt--bottom-right {
    bottom: 20px;
    right: 20px;
    transform: translateY(30px);
}
.pn-prompt--bottom-right.pn-prompt--visible {
    transform: translateY(0);
}

.pn-prompt--bottom-left {
    bottom: 20px;
    left: 20px;
    transform: translateY(30px);
}
.pn-prompt--bottom-left.pn-prompt--visible {
    transform: translateY(0);
}

.pn-prompt--top-right {
    top: 20px;
    right: 20px;
    transform: translateY(-30px);
}
.pn-prompt--top-right.pn-prompt--visible {
    transform: translateY(0);
}

.pn-prompt--top-left {
    top: 20px;
    left: 20px;
    transform: translateY(-30px);
}
.pn-prompt--top-left.pn-prompt--visible {
    transform: translateY(0);
}

/* ==========================================
   Card Container
   ========================================== */
.pn-prompt__card {
    position: relative;
    width: 340px;
    max-width: calc(100vw - 40px);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: pn-pulse 2s infinite;
}

@keyframes pn-pulse {
    0%, 100% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05); }
    50% { box-shadow: 0 20px 60px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.1); }
}

/* ==========================================
   Dark Theme (Default)
   ========================================== */
.pn-prompt--dark .pn-prompt__card {
    background: linear-gradient(145deg, rgba(30, 30, 46, 0.95), rgba(24, 24, 37, 0.98));
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: #e2e8f0;
}

.pn-prompt--dark .pn-prompt__title {
    color: #f1f5f9;
}

.pn-prompt--dark .pn-prompt__text {
    color: #94a3b8;
}

.pn-prompt--dark .pn-prompt__close {
    color: #64748b;
}

.pn-prompt--dark .pn-prompt__close:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   Light Theme
   ========================================== */
.pn-prompt--light .pn-prompt__card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(99, 102, 241, 0.12);
    color: #334155;
}

.pn-prompt--light .pn-prompt__title {
    color: #1e293b;
}

.pn-prompt--light .pn-prompt__text {
    color: #64748b;
}

.pn-prompt--light .pn-prompt__close {
    color: #94a3b8;
}

.pn-prompt--light .pn-prompt__close:hover {
    color: #334155;
    background: rgba(0, 0, 0, 0.05);
}

/* ==========================================
   Close Button
   ========================================== */
.pn-prompt__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

/* ==========================================
   Icon
   ========================================== */
.pn-prompt__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    flex-shrink: 0;
}

.pn-prompt__icon svg {
    width: 28px;
    height: 28px;
}

/* ==========================================
   Content
   ========================================== */
.pn-prompt__title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.pn-prompt__text {
    font-size: 13px;
    line-height: 1.6;
}

.pn-prompt__branding {
    font-size: 10px;
    text-align: center;
    opacity: 0.4;
    margin-top: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==========================================
   Action Buttons
   ========================================== */
.pn-prompt__actions {
    display: flex;
    gap: 8px;
}

.pn-prompt__btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.pn-prompt__btn--allow {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.pn-prompt__btn--allow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.pn-prompt__btn--allow:active {
    transform: translateY(0);
}

.pn-prompt--dark .pn-prompt__btn--later {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pn-prompt--dark .pn-prompt__btn--later:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.pn-prompt--light .pn-prompt__btn--later {
    background: rgba(0, 0, 0, 0.04);
    color: #64748b;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.pn-prompt--light .pn-prompt__btn--later:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #334155;
}

/* ==========================================
   Responsive (Mobile)
   ========================================== */
@media (max-width: 480px) {
    .pn-prompt--bottom-right,
    .pn-prompt--bottom-left {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    .pn-prompt--top-right,
    .pn-prompt--top-left {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .pn-prompt__card {
        width: auto;
        max-width: 100%;
        padding: 16px;
    }
}

/* ==========================================
   Reduced Motion
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .pn-prompt {
        transition: opacity 0.2s ease;
    }

    .pn-prompt__card {
        animation: none;
    }
}

/* ==========================================
   Floating Bell Widget
   ========================================== */
.pn-bell {
    position: fixed;
    z-index: 2147483646;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pn-bell--bottom-right { bottom: 24px; right: 24px; }
.pn-bell--bottom-left { bottom: 24px; left: 24px; }

.pn-bell--dark {
    background: #1e1e2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #818cf8;
}

.pn-bell--light {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #6366f1;
}

.pn-bell:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3);
}

.pn-bell__icon {
    width: 24px;
    height: 24px;
    position: relative;
}

.pn-bell--subscribed .pn-bell__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid #fff;
    border-radius: 50%;
}

.pn-bell--dark.pn-bell--subscribed .pn-bell__badge {
    border-color: #1e1e2e;
}

@keyframes pn-shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

.pn-bell--pulse .pn-bell__icon {
    animation: pn-shake 0.8s ease-in-out infinite;
}

/* ==========================================
   Top Bar Banner Styles
   ========================================== */
.pn-prompt--banner {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.pn-prompt--banner.pn-prompt--visible {
    transform: translateY(0);
}

.pn-prompt__banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.pn-prompt__banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pn-prompt__banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #6366f1;
}

.pn-prompt__banner-text {
    font-size: 14px;
}

.pn-prompt__banner-text strong {
    font-weight: 700;
    margin-right: 4px;
}

.pn-prompt__banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pn-prompt--banner .pn-prompt__btn {
    padding: 6px 16px;
    font-size: 12px;
    flex: none;
}

.pn-prompt--banner .pn-prompt__close {
    position: static;
    font-size: 22px;
}

/* Theme Banner Styles */
.pn-prompt--banner.pn-prompt--dark .pn-prompt__banner-inner {
    background: #1e1e2e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.pn-prompt--banner.pn-prompt--light .pn-prompt__banner-inner {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #334155;
}

@media (max-width: 768px) {
    .pn-prompt__banner-inner {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        text-align: center;
    }
    
    .pn-prompt__banner-content {
        flex-direction: column;
    }
    
    .pn-prompt__banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    .pn-prompt--banner .pn-prompt__btn {
        flex: 1;
    }
}

