.pwa-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    padding: 20px;
    max-width: 340px;
    z-index: 999999;
    transform: translateY(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* Close button */
.pwa-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.pwa-prompt--safari {
    max-width: 400px; /* Slightly wider for Safari instructions */
}

.pwa-close:hover {
    background-color: #f5f5f5;
}

/* Icon */
.pwa-icon {
    text-align: center;
    margin-bottom: 16px;
}

.pwa-instructions--safari-desktop {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.pwa-icon img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pwa-instructions--safari-desktop ol {
    margin: 12px 0;
    padding-left: 20px;
    color: #333;
}

/* Content */
.pwa-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.pwa-instructions--safari-desktop li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.pwa-instructions--safari-desktop strong {
    color: #000;
    font-weight: 600;
}

.pwa-content p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.pwa-instructions-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    color: #666;
}

/* Instructions */
.pwa-instructions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.pwa-instructions-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}


/* Safari visual guide styles */
.pwa-safari-guide {
    margin: 16px 0;
}

.pwa-safari-step {
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.pwa-safari-visual {
    margin-bottom: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Mock Safari menu bar */
.pwa-menu-bar {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #333;
}

.pwa-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.pwa-instructions li {
    margin-bottom: 4px;
}

.pwa-instructions--compact p {
    margin: 0;
    font-size: 13px;
    color: #555;
}

.pwa-menu-item {
    padding: 4px 8px;
    border-radius: 4px;
    cursor: default;
}

.pwa-menu-item--highlight {
    background: #007AFF;
    color: white;
}

/* Action buttons */
.pwa-actions {
    display: flex;
    gap: 8px;
}

.pwa-install-btn,
.pwa-later-btn,
.pwa-done-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

/* Mock dropdown menu */
.pwa-dropdown-menu {
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 4px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 13px;
}

.pwa-menu-option {
    padding: 6px 20px;
    color: #333;
}

.pwa-install-btn {
    background: #2196F3;
    color: white;
}

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

.pwa-later-btn {
    background: #f5f5f5;
    color: #666;
}

.pwa-later-btn:hover {
    background: #e0e0e0;
}

.pwa-menu-option--highlight {
    background: #007AFF;
    color: white;
}

.pwa-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

/* Icons */
.pwa-icon-share::after {
    content: '⎙';
    display: inline-block;
    padding: 2px 6px;
    background: #007AFF;
    color: white;
    border-radius: 4px;
    font-weight: bold;
}

/* Safari benefits list */
.pwa-safari-benefits {
    margin-top: 16px;
    padding: 16px;
    background: #e8f4fd;
    border-radius: 8px;
}

.pwa-icon-install::after {
    content: '⊕';
    display: inline-block;
    padding: 2px 6px;
    background: #4285F4;
    color: white;
    border-radius: 4px;
}

.pwa-safari-benefits h4 {
    margin: 0 0 8px 0;
    color: #0066CC;
    font-size: 14px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .pwa-prompt {
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 12px 12px 0 0;
        padding: 24px;
    }
    
    .pwa-prompt--ios {
        /* iOS safe area */
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

.pwa-safari-benefits ul {
    margin: 0;
    padding-left: 20px;
}

.pwa-safari-benefits li {
    margin-bottom: 4px;
    color: #333;
    font-size: 13px;
}

/* Safari Dock icon */
.pwa-prompt--safari .pwa-icon img {
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    border-radius: 22.4%; /* Safari's specific icon rounding */
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pwa-prompt {
        background: #1e1e1e;
        color: #fff;
    }
    
    .pwa-content h3 {
        color: #fff;
    }
    
    .pwa-content p {
        color: #ccc;
    }
    
    .pwa-instructions {
        background: #2a2a2a;
    }
    
    .pwa-instructions-title,
    .pwa-instructions ol {
        color: #ddd;
    }
    
    .pwa-later-btn {
        background: #333;
        color: #ddd;
    }
    
    .pwa-later-btn:hover {
        background: #444;
    }
    
    .pwa-close {
        color: #999;
    }
    
    .pwa-close:hover {
        background-color: #333;
    }

    .pwa-instructions--safari-desktop {
        background: #2a2a2a;
    }
    
    .pwa-safari-step {
        background: #1e1e1e;
        border-color: #444;
    }
    
    .pwa-safari-visual {
        background: #333;
    }
    
    .pwa-menu-bar {
        color: #ddd;
    }
    
    .pwa-dropdown-menu {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .pwa-menu-option {
        color: #ddd;
    }
    
    .pwa-safari-benefits {
        background: #1a3a52;
    }
    
    .pwa-safari-benefits h4 {
        color: #4da6ff;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.pwa-install-btn:hover {
    animation: none;
}

/* Accessibility */
.pwa-prompt:focus-within {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16), 0 0 0 2px #2196F3;
}

button:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .pwa-prompt {
        display: none;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .pwa-prompt--safari {
        max-width: none;
    }
    
    .pwa-safari-visual {
        font-size: 11px;
    }
}

/* Animation for Safari guide */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwa-safari-step {
    animation: slideDown 0.3s ease-out forwards;
}

.pwa-safari-step:nth-child(2) {
    animation-delay: 0.1s;
}

.pwa-safari-step:nth-child(3) {
    animation-delay: 0.2s;
}