/**
 * FleetyCar PWA Styles
 * Install Banners for iOS and Android
 */

/* Common PWA Install Banner Styles */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    padding: 16px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    animation: pwaSlideUp 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes pwaSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pwa-install-icon {
    flex-shrink: 0;
}

.pwa-install-icon img {
    border-radius: 12px;
    width: 48px;
    height: 48px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-text strong {
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.pwa-install-text p {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.3;
}

.pwa-install-close {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}

.pwa-install-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Android Install Banner Specific */
.pwa-install-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.pwa-install-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #4680ff;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 280px;
}

.pwa-install-btn:hover {
    background: #3d70e0;
    transform: translateY(-1px);
}

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

.pwa-install-btn svg {
    flex-shrink: 0;
}

/* iOS Install Banner Specific */
.ios-install-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
}

.ios-share-icon {
    width: 22px;
    height: 22px;
    color: #007AFF;
    flex-shrink: 0;
}

/* Legacy class support */
.ios-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    padding: 16px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    animation: pwaSlideUp 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ios-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ios-install-icon {
    flex-shrink: 0;
}

.ios-install-icon img {
    border-radius: 12px;
    width: 48px;
    height: 48px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ios-install-text {
    flex: 1;
    min-width: 0;
}

.ios-install-text strong {
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.ios-install-text p {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.3;
}

.ios-install-close {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}

.ios-install-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Standalone mode - hide all banners */
@media all and (display-mode: standalone) {
    .pwa-install-banner,
    .ios-install-banner {
        display: none !important;
    }
}

/* Safe area padding for iPhone X and newer */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pwa-install-banner,
    .ios-install-banner {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* Install App Button (inline on login page) */
#install-app-btn {
    background: linear-gradient(135deg, #4680ff 0%, #3d70e0 100%);
    border: none;
    color: #ffffff;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#install-app-btn:hover {
    background: linear-gradient(135deg, #3d70e0 0%, #2d5bc0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(70, 128, 255, 0.3);
}

#install-app-btn:active {
    transform: translateY(0);
}

#install-app-btn svg {
    stroke: currentColor;
}

/* Hide install button in standalone mode */
@media all and (display-mode: standalone) {
    #install-app-container {
        display: none !important;
    }
}
