/**
 * KF Samara - PWA Installation Styles
 * Баннер установки и iOS инструкция
 */

/* =============================================
   PWA Install Banner (Android/Chrome)
   ============================================= */

.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 16px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 10000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .pwa-install-banner {
        display: flex;
    }
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-install-banner__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.pwa-install-banner__close:hover {
    opacity: 1;
}

.pwa-install-banner__close svg {
    width: 20px;
    height: 20px;
    fill: #ff4444;
}

.pwa-install-banner__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-install-banner__button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid #f5e91f;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pwa-install-banner__button:hover {
    background: #f5e91f;
    color: #17181f;
}

.pwa-install-banner__button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.pwa-install-banner__logo {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pwa-install-banner__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .pwa-install-banner {
        padding: 12px 15px;
        gap: 10px;
    }

    .pwa-install-banner__button {
        padding: 10px 16px;
        font-size: 13px;
    }

    .pwa-install-banner__logo {
        width: 44px;
        height: 44px;
    }
}


/* =============================================
   iOS Installation Modal
   ============================================= */

.pwa-ios-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pwa-ios-overlay.show {
    opacity: 1;
    visibility: visible;
}

.pwa-ios-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 10002;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-ios-modal.show {
    transform: translateY(0);
}

.pwa-ios-modal__header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 20px 20px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.pwa-ios-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.pwa-ios-modal__close:hover {
    opacity: 1;
}

.pwa-ios-modal__close svg {
    width: 20px;
    height: 20px;
    fill: #333;
}

.pwa-ios-modal__logo {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.pwa-ios-modal__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pwa-ios-modal__title {
    font-size: 22px;
    font-weight: 700;
    color: #17181f;
    margin-bottom: 5px;
}

.pwa-ios-modal__subtitle {
    font-size: 14px;
    color: #777;
}

.pwa-ios-modal__content {
    padding: 25px 20px 30px;
}

.pwa-ios-modal__instructions-title {
    font-size: 16px;
    font-weight: 700;
    color: #17181f;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-ios-modal__instructions-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, #f5e91f 0%, #f3ae56 100%);
    border-radius: 2px;
}

.pwa-ios-modal__steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pwa-ios-modal__step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pwa-ios-modal__step:last-child {
    border-bottom: none;
}

.pwa-ios-modal__step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #f5e91f 0%, #f3ae56 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #17181f;
}

.pwa-ios-modal__step-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    padding-top: 3px;
}

.pwa-ios-modal__step-text strong {
    color: #17181f;
}

.pwa-ios-modal__step-icon--safari,
.pwa-ios-modal__step-icon--share,
.pwa-ios-modal__step-icon--add {
    display: inline-block;
    vertical-align: middle;
    margin: 0 3px;
}

/* Success note */
.pwa-ios-modal__success {
    background: linear-gradient(135deg, rgba(245, 233, 31, 0.15) 0%, rgba(243, 174, 86, 0.15) 100%);
    border: 1px solid rgba(245, 233, 31, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pwa-ios-modal__success-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-ios-modal__success-icon svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

.pwa-ios-modal__success-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.pwa-ios-modal__success-text strong {
    color: #4CAF50;
}

/* Important note */
.pwa-ios-modal__note {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pwa-ios-modal__note-icon {
    flex-shrink: 0;
    font-size: 20px;
}

.pwa-ios-modal__note-text {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

.pwa-ios-modal__note-text strong {
    color: #17181f;
}

/* Arrow indicator at bottom */
.pwa-ios-modal__arrow {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10003;
    animation: pwa-bounce 1s infinite;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.pwa-ios-modal__arrow.show {
    opacity: 1;
    visibility: visible;
}

.pwa-ios-modal__arrow svg {
    width: 40px;
    height: 40px;
    fill: #f5e91f;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.3));
}

@keyframes pwa-bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}


/* =============================================
   Already Installed State
   ============================================= */

.pwa-installed-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.pwa-installed-badge svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}


/* =============================================
   Desktop Banner Variant
   ============================================= */

@media (min-width: 769px) {
    .pwa-ios-modal {
        left: 50%;
        right: auto;
        bottom: 50%;
        transform: translate(-50%, 50%) scale(0.9);
        width: 90%;
        max-width: 450px;
        border-radius: 20px;
        max-height: 85vh;
    }

    .pwa-ios-modal.show {
        transform: translate(-50%, 50%) scale(1);
    }
}

