/* PWA Custom Install Prompt - Premium Glassmorphic Styles */

#pwa-install-prompt {
    position: fixed;
    z-index: 99999;
    bottom: 24px;
    left: 24px;
    width: 420px;
    max-width: calc(100vw - 48px);
    background: rgba(18, 18, 20, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 100px rgba(226, 32, 38, 0.05);
    color: #ffffff;
    font-family: 'DM Sans', 'Hanken Grotesk', sans-serif;
    transform: translateY(150px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

#pwa-install-prompt.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Prompt Container Elements */
.pwa-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
}

.pwa-logo-container {
    width: 56px;
    height: 56px;
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    flex-shrink: 0;
}

.pwa-logo-container img {
    width: 82%;
    height: 82%;
    object-fit: contain;
}

.pwa-title-area {
    flex-grow: 1;
}

.pwa-title-area h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.pwa-title-area p {
    margin: 0;
    font-size: 13px;
    color: #e22026;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.pwa-close-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.pwa-close-btn:hover {
    background: rgba(226, 32, 38, 0.2);
    color: #ffffff;
    transform: rotate(90deg);
}

.pwa-body {
    margin-bottom: 20px;
}

.pwa-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
}

/* iOS Specific Guide Elements */
.pwa-ios-instructions {
    display: none;
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pwa-ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    line-height: 1.4;
}

.pwa-ios-step:last-child {
    margin-bottom: 0;
}

.pwa-ios-step-num {
    background: rgba(226, 32, 38, 0.15);
    color: #e22026;
    font-weight: 700;
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.pwa-ios-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
}

.pwa-ios-icon.share svg {
    stroke-width: 1.8;
}

.pwa-ios-icon.plus svg {
    fill: #ffffff;
    stroke: none;
}

/* Footer / Actions */
.pwa-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.pwa-btn {
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
}

.pwa-btn-dismiss {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

.pwa-btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.pwa-btn-install {
    background: linear-gradient(135deg, #e22026 0%, #b8151b 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(226, 32, 38, 0.25);
    position: relative;
    overflow: hidden;
}

.pwa-btn-install::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: 0.75s;
    opacity: 0;
}

.pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(226, 32, 38, 0.35);
}

.pwa-btn-install:hover::after {
    left: 125%;
    opacity: 1;
}

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

/* Mobile Responsiveness */
@media (max-width: 576px) {
    #pwa-install-prompt {
        bottom: 16px;
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
        padding: 20px;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    
    .pwa-logo-container {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    
    .pwa-title-area h4 {
        font-size: 16px;
    }
    
    .pwa-body p {
        font-size: 13.5px;
    }
    
    .pwa-btn {
        padding: 10px 16px;
        font-size: 13px;
        flex-grow: 1;
        text-align: center;
    }
    
    .pwa-actions {
        width: 100%;
    }
}

/* iOS Helper Floating Arrow/Badge */
.pwa-ios-helper-arrow {
    position: fixed;
    z-index: 100000;
    background: #e22026;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 30px;
    box-shadow: 0 8px 30px rgba(226, 32, 38, 0.4), 0 0 0 4px rgba(226, 32, 38, 0.2);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* iPhone Placement: bottom center, pointing down */
.pwa-ios-helper-arrow.iphone {
    bottom: 90px; /* Sits just above the Safari bottom bar */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    animation: iphone-pulse 2s infinite ease-in-out;
}

/* iPad Placement: top right, pointing up */
.pwa-ios-helper-arrow.ipad {
    top: 90px;
    right: 90px;
    transform: translateY(-20px);
    animation: ipad-pulse 2s infinite ease-in-out;
}

.pwa-ios-helper-arrow.visible {
    opacity: 1;
}

.pwa-ios-helper-arrow.iphone.visible {
    transform: translateX(-50%) translateY(0);
}

.pwa-ios-helper-arrow.ipad.visible {
    transform: translateY(0);
}

/* Arrow indicator triangles */
.pwa-ios-helper-arrow::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.pwa-ios-helper-arrow.iphone::after {
    border-width: 10px 10px 0 10px;
    border-color: #e22026 transparent transparent transparent;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
}

.pwa-ios-helper-arrow.ipad::after {
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent #e22026 transparent;
    top: -9px;
    right: 20px;
}

/* Custom Safari Share Icon inside the helper arrow */
.pwa-ios-helper-arrow svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.5;
}

@keyframes iphone-pulse {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(12px); }
}

@keyframes ipad-pulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

