/* ============================================
   PWA Install Prompt Styles
   TruVerifAI - Install Prompt Component
   ============================================ */

/* Install Prompt Banner */
.pwa-install-prompt {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    animation: pwaSlideUp 0.3s ease-out;
}

.pwa-install-prompt.show {
    display: block;
}

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

.pwa-install-prompt-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-install-prompt-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}

.pwa-install-prompt-text {
    flex: 1;
}

.pwa-install-prompt-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.pwa-install-prompt-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.pwa-install-prompt-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: white;
    color: var(--brand-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pwa-dismiss-btn {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.pwa-dismiss-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

/* Install Instructions Modal */
.pwa-install-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: pwaFadeIn 0.2s ease-out;
}

.pwa-install-modal.show {
    display: flex;
}

@keyframes pwaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pwa-install-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pwaScaleIn 0.3s ease-out;
}

@keyframes pwaScaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pwa-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.pwa-modal-header img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 12px;
}

.pwa-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.pwa-modal-header p {
    margin: 8px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.pwa-modal-body {
    padding: 24px;
}

.pwa-install-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

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

.pwa-step-number {
    width: 32px;
    height: 32px;
    background: var(--brand-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.pwa-step-content h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #171717;
}

.pwa-step-content p {
    margin: 0;
    font-size: 13px;
    color: #525252;
    line-height: 1.5;
}

.pwa-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 16px;
    margin: 0 2px;
}

.pwa-modal-footer {
    padding: 16px 24px 24px;
    text-align: center;
}

.pwa-modal-close-btn {
    background: #f3f4f6;
    color: #525252;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-modal-close-btn:hover {
    background: #e5e7eb;
}

/* Dark mode support for PWA banner */
[data-theme="dark"] .pwa-install-prompt {
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .pwa-install-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #4338ca;
}

[data-theme="dark"] .pwa-dismiss-btn {
    border-color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .pwa-dismiss-btn:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
}

/* Prompt closing animation */
.pwa-install-prompt.closing {
    animation: pwaSlideDown 0.2s ease-in forwards;
}

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

/* Modal closing animation */
.pwa-install-modal.closing {
    animation: pwaFadeOut 0.2s ease-out forwards;
}

.pwa-install-modal.closing .pwa-install-modal-content {
    animation: pwaScaleOut 0.2s ease-out forwards;
}

@keyframes pwaFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pwaScaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* Dark mode support for modal - using data-theme attribute */
[data-theme="dark"] .pwa-install-modal-content {
    background: #1f2937;
}

[data-theme="dark"] .pwa-modal-body {
    color: #e5e7eb;
}

[data-theme="dark"] .pwa-step-content h4 {
    color: #f3f4f6;
}

[data-theme="dark"] .pwa-step-content p {
    color: #9ca3af;
}

[data-theme="dark"] .pwa-step-icon {
    background: #374151;
}

[data-theme="dark"] .pwa-modal-close-btn {
    background: #374151;
    color: #e5e7eb;
}

[data-theme="dark"] .pwa-modal-close-btn:hover {
    background: #4b5563;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .pwa-install-prompt-content {
        flex-wrap: wrap;
    }
    
    .pwa-install-prompt-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .pwa-install-btn,
    .pwa-dismiss-btn {
        flex: 1;
    }
}

/* Accessibility - respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .pwa-install-prompt,
    .pwa-install-modal,
    .pwa-install-modal-content {
        animation: none;
    }
}
