/**
 * PWA Install Banner
 * Банер предложения установки приложения
 */

/* === Банер (снизу экрана) === */
.pwa-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pwa-banner.pwa-show {
    bottom: 0;
}

/* Иконка приложения */
.pwa-banner-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255,255,255,0.1);
}

/* Текстовый блок */
.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    line-height: 1.3;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопка установки */
.pwa-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.pwa-banner-btn:hover {
    transform: scale(1.03);
}

.pwa-banner-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* Кнопка закрытия */
.pwa-banner-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}

.pwa-banner-close:hover {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
}

/* Safari instruction tooltip */
.pwa-safari-tip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #1a1a2e;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    padding: 16px 20px;
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-safari-tip.pwa-show {
    transform: translateY(0);
}

.pwa-safari-tip .pwa-safari-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin: 0 2px;
}

.pwa-safari-tip .pwa-banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Desktop: мини-уведомление в правом нижнем углу */
@media (min-width: 769px) {
    .pwa-banner {
        left: auto;
        right: 20px;
        bottom: -200px;
        max-width: 380px;
        width: auto;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.1);
    }

    .pwa-banner.pwa-show {
        bottom: 20px;
    }

    .pwa-safari-tip {
        left: auto;
        right: 20px;
        width: 340px;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.1);
        transform: translateY(calc(100% + 20px));
    }

    .pwa-safari-tip.pwa-show {
        transform: translateY(0);
        bottom: 20px;
    }
}
