/**
 * Estilos para Prompt de Instalação PWA
 * VibeCode PWA Maker
 */

/* Overlay */
.vibecode-pwa-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

/* Container do Prompt */
.vibecode-pwa-prompt {
    position: fixed;
    z-index: 99999;
    display: none;
}

.vibecode-pwa-prompt.visible {
    display: block !important;
}

.vibecode-pwa-prompt-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: calc(100% - 40px);
    padding: 24px;
    animation: slideUp 0.4s ease;
    z-index: 99999;
}

/* Mobile: Prompt em baixo */
@media (max-width: 768px) {
    .vibecode-pwa-prompt-container {
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        max-width: none;
        width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 20px;
    }
}

/* Botão Fechar */
.vibecode-pwa-prompt-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
    font-size: 24px;
    line-height: 1;
    z-index: 10;
}

.vibecode-pwa-prompt-close:hover {
    background: #f3f4f6;
    color: #111;
}

/* Conteúdo */
.vibecode-pwa-prompt-content {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    padding-right: 44px; /* Espaço para botão × */
}

/* Ícone da App */
.vibecode-pwa-prompt-icon {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

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

@media (max-width: 480px) {
    .vibecode-pwa-prompt-icon img {
        width: 56px;
        height: 56px;
    }
}

/* Texto */
.vibecode-pwa-prompt-text {
    flex: 1;
    position: relative;
    z-index: 1;
    padding-right: 0; /* Removido - padding já está no content */
}

.vibecode-pwa-prompt-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #111;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.vibecode-pwa-prompt-message {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* Instruções iOS */
.vibecode-pwa-ios-instructions {
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    padding: 12px;
    margin-top: 12px;
    border-radius: 4px;
}

.vibecode-pwa-ios-instructions p {
    margin: 0;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.6;
}

.vibecode-pwa-ios-instructions strong {
    display: block;
    margin-bottom: 8px;
    color: #1e3a8a;
}

/* Ações */
.vibecode-pwa-prompt-actions {
    display: flex;
    gap: 12px;
}

@media (max-width: 480px) {
    .vibecode-pwa-prompt-actions {
        flex-direction: column;
    }
}

/* Botões */
.vibecode-pwa-prompt-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vibecode-pwa-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.vibecode-pwa-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.vibecode-pwa-btn-primary:active {
    transform: translateY(0);
    color: #ffffff !important;
}

.vibecode-pwa-btn-primary svg {
    width: 20px;
    height: 20px;
    fill: #ffffff !important;
    color: #ffffff !important;
}

.vibecode-pwa-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.vibecode-pwa-btn-secondary:hover {
    background: #e5e7eb;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 768px) {
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Estado: Escondido */
.vibecode-pwa-prompt.hiding .vibecode-pwa-prompt-container {
    animation: slideDown 0.3s ease forwards;
}

.vibecode-pwa-prompt.hiding .vibecode-pwa-prompt-overlay {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(50px);
    }
}

@media (max-width: 768px) {
    @keyframes slideDown {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(100%);
        }
    }
}

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

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .vibecode-pwa-prompt-container,
    .vibecode-pwa-prompt-overlay {
        animation: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .vibecode-pwa-prompt-container {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .vibecode-pwa-prompt-title {
        color: #f9fafb;
    }
    
    .vibecode-pwa-prompt-message {
        color: #d1d5db;
    }
    
    .vibecode-pwa-prompt-close {
        color: #9ca3af;
    }
    
    .vibecode-pwa-prompt-close:hover {
        background: #374151;
        color: #f9fafb;
    }
    
    .vibecode-pwa-btn-secondary {
        background: #374151;
        color: #f9fafb;
    }
    
    .vibecode-pwa-btn-secondary:hover {
        background: #4b5563;
    }
}
