/**
 * PWA Install Prompt Styles
 *
 * @package AnowXRadio
 * @since 2.0.0
 * @updated 2.1.0 - Removed bottom-center, improved responsive
 */

/* ============================================
   PWA Install Prompt Container
   ============================================ */
.anowxradio-pwa-prompt {
    position: fixed;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.anowxradio-pwa-prompt.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Position Variants */
.anowxradio-pwa-prompt[data-position="bottom-right"] {
    bottom: 24px;
    right: 24px;
}

.anowxradio-pwa-prompt[data-position="bottom-left"] {
    bottom: 24px;
    left: 24px;
}

.anowxradio-pwa-prompt[data-position="top-right"] {
    top: 24px;
    right: 24px;
    transform: translateY(-100px);
}

.anowxradio-pwa-prompt[data-position="top-right"].visible {
    transform: translateY(0);
}

.anowxradio-pwa-prompt[data-position="top-left"] {
    top: 24px;
    left: 24px;
    transform: translateY(-100px);
}

.anowxradio-pwa-prompt[data-position="top-left"].visible {
    transform: translateY(0);
}

/* ============================================
   Prompt Content Card
   ============================================ */
.pwa-prompt-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    max-width: 380px;
    min-width: 320px;
}

/* Close Button */
.pwa-prompt-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2d2d44;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.pwa-prompt-close:hover {
    background: #DC143C;
    color: #ffffff;
    transform: scale(1.1);
}

.pwa-prompt-close svg {
    width: 12px;
    height: 12px;
}

/* App Icon */
.pwa-prompt-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pwa-prompt-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Text Content */
.pwa-prompt-text {
    flex: 1;
    min-width: 0;
}

.pwa-prompt-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-prompt-text span {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Install Button */
.pwa-prompt-install {
    flex-shrink: 0;
    padding: 10px 20px;
    background: linear-gradient(135deg, #DC143C 0%, #FF1493 100%);
    border: none;
    border-radius: 25px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
}

.pwa-prompt-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(220, 20, 60, 0.5);
}

.pwa-prompt-install:active {
    transform: translateY(0);
}

/* ============================================
   iOS Install Instructions Modal
   ============================================ */
.pwa-ios-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pwa-ios-modal.visible {
    opacity: 1;
    visibility: visible;
}

.pwa-ios-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.pwa-ios-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pwa-ios-modal.visible .pwa-ios-modal-content {
    transform: scale(1);
}

.pwa-ios-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-ios-modal-close:hover {
    background: #DC143C;
    color: #ffffff;
}

.pwa-ios-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pwa-ios-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-ios-modal h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 20px;
}

.pwa-ios-steps {
    text-align: left;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.pwa-ios-steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.pwa-ios-steps li:last-child {
    border-bottom: none;
}

.pwa-ios-step-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #DC143C, #FF1493);
    border-radius: 50%;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.pwa-ios-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    margin: 0 4px;
    vertical-align: middle;
}

.pwa-ios-step-icon svg {
    width: 16px;
    height: 16px;
    fill: #007AFF;
}

.pwa-ios-modal-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #DC143C 0%, #FF1493 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-ios-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.4);
}

/* ============================================
   Success Toast
   ============================================ */
.pwa-success-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-success-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.pwa-success-toast svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
    flex-shrink: 0;
}

.pwa-success-toast span {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================
   Animations
   ============================================ */
@keyframes pwa-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 20, 60, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 20, 60, 0);
    }
}

.pwa-prompt-install.pulse {
    animation: pwa-pulse 2s infinite;
}

@keyframes pwa-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.anowxradio-pwa-prompt.shake .pwa-prompt-content {
    animation: pwa-shake 0.5s ease;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .anowxradio-pwa-prompt[data-position="bottom-right"],
    .anowxradio-pwa-prompt[data-position="bottom-left"] {
        bottom: 16px;
        left: 16px;
        right: 16px;
        transform: translateY(100px);
    }

    .anowxradio-pwa-prompt[data-position="bottom-right"].visible,
    .anowxradio-pwa-prompt[data-position="bottom-left"].visible {
        transform: translateY(0);
    }

    .anowxradio-pwa-prompt[data-position="top-right"],
    .anowxradio-pwa-prompt[data-position="top-left"] {
        top: 16px;
        left: 16px;
        right: 16px;
        transform: translateY(-100px);
    }

    .anowxradio-pwa-prompt[data-position="top-right"].visible,
    .anowxradio-pwa-prompt[data-position="top-left"].visible {
        transform: translateY(0);
    }

    .pwa-prompt-content {
        max-width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        padding: 14px 16px;
    }

    .pwa-prompt-icon {
        width: 46px;
        height: 46px;
        border-radius: 10px;
    }

    .pwa-prompt-text {
        flex: 1;
        min-width: 120px;
    }

    .pwa-prompt-text strong {
        font-size: 14px;
    }

    .pwa-prompt-text span {
        font-size: 11px;
    }

    .pwa-prompt-install {
        padding: 10px 16px;
        font-size: 12px;
    }

    .pwa-ios-modal-content {
        padding: 24px 20px;
        margin: 0 10px;
    }

    .pwa-ios-icon {
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }

    .pwa-ios-modal h3 {
        font-size: 18px;
    }

    .pwa-ios-steps li {
        font-size: 13px;
        padding: 10px 0;
    }
}

@media (max-width: 480px) {
    .pwa-prompt-content {
        gap: 10px;
    }

    .pwa-prompt-icon {
        width: 42px;
        height: 42px;
    }

    .pwa-prompt-install {
        padding: 8px 14px;
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .pwa-prompt-content {
        flex-direction: column;
        text-align: center;
    }

    .pwa-prompt-text {
        width: 100%;
    }

    .pwa-prompt-text strong,
    .pwa-prompt-text span {
        white-space: normal;
    }

    .pwa-prompt-install {
        width: 100%;
    }
}

/* ============================================
   Footer Player Offset
   ============================================ */
body.has-footer-player .anowxradio-pwa-prompt[data-position="bottom-right"],
body.has-footer-player .anowxradio-pwa-prompt[data-position="bottom-left"] {
    bottom: 90px;
}

@media (max-width: 768px) {
    body.has-footer-player .anowxradio-pwa-prompt[data-position="bottom-right"],
    body.has-footer-player .anowxradio-pwa-prompt[data-position="bottom-left"] {
        bottom: 80px;
    }
}

/* ============================================
   Dark Mode Compatibility
   ============================================ */
[data-theme="light"] .pwa-prompt-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

[data-theme="light"] .pwa-prompt-close {
    background: #e9ecef;
    color: #495057;
}

[data-theme="light"] .pwa-prompt-close:hover {
    background: #DC143C;
    color: #ffffff;
}

[data-theme="light"] .pwa-prompt-icon {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .pwa-prompt-text strong {
    color: #1a1a2e;
}

[data-theme="light"] .pwa-prompt-text span {
    color: #6c757d;
}

/* ============================================
   Print - Hide PWA Prompt
   ============================================ */
@media print {
    .anowxradio-pwa-prompt,
    .pwa-ios-modal,
    .pwa-success-toast {
        display: none !important;
    }
}